Commit Graph
1118 Commits
Author SHA1 Message Date
Adrien Leravat cbd4b8d82d Add explorer support for short-circuit evaluation for 'and' and 'or' (#1789)
Implements short-circuit evaluation for `and` and `or` binary
operators.

Fixes #1651
2022-07-29 13:10:40 -07:00
Zenong Zhang 13f97e09e8 Added back error message on action stack. (#1826) 2022-07-29 13:07:00 -07:00
Krishna Agarwal 4d53e3ffe3 grammar error (#1795) 2022-07-29 11:02:52 -07:00
pmqttandm new df93623741 Extends carbon to generate random number to make samples more interesting (#1643)
Implements the Rand function to carbon

Co-authored-by: m new <michael.burzan@outlook.de>
2022-07-29 10:39:30 -07:00
SADIK KUZU df2ec7ab22 Update pre-commit config (#1773)
Update pre-commit config yaml file

* Updating https://github.com/pre-commit/pre-commit-hooks ... updating db7346d375eda68a0174f2c057dd97f2fbffe030 -> v4.3.0 (frozen).
* Updating https://github.com/google/pre-commit-tool-hooks ... already up to date.
* Updating https://github.com/psf/black ... updating ae2c0758c9e61a385df9700dc9c231bf54887041 -> 22.6.0 (frozen).
* Updating https://github.com/pre-commit/mirrors-prettier ... updating 5e374fda194d7f7ce9eebbd582b2a5594838c85b -> v2.7.1 (frozen).
* Updating https://github.com/PyCQA/flake8 ... already up to date.
* Updating https://github.com/pre-commit/mirrors-mypy ... updating a04404bdf52c2cbc9c5bd705454b89bd83b84383 -> v0.971 (frozen).
* Updating https://github.com/codespell-project/codespell ... already up to date.
* Updating https://github.com/google/pre-commit-tool-hooks ... already up to date.
2022-07-29 07:53:34 -07:00
1b2047d075 Added the ZLib development package as a Linux requirement to the Main Tools section (#1558)
Fixes #1527

On Debian, the zlib1g-dev package is required to build and should be given as a requirement.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2022-07-28 23:05:30 -07:00
yale 85cb70c0a3 Add DevContainer (#1608)
With DevContainer, developers can join the project without deploy the build env.

Signed-off-by: cyw3 <2927096163@qq.com>
2022-07-28 16:03:48 -07:00
7be95ccb19 Operator overloading modulo (#1808)
Co-authored-by: m new <michael.burzan@outlook.de>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2022-07-28 17:45:07 -04:00
9f89c63503 Add operator modulo (#1681)
Co-authored-by: m new <michael.burzan@outlook.de>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2022-07-28 12:51:35 -07:00
Mats Larsen 8ba4916ab4 Implement minimal textmate language definition (#1595)
TextMate is the go-to definition language for syntax highlighting for editors lack dedicated language support for a given programming language. This patch contains a very minimal, yet functional TextMate bundle definition for Carbon.

This allows Carbon users to import the TextMate bundle into their editors to get basic syntax highlighting for Carbon code until we have a more solid specification for the language (that's when the fun with dedicated plugins/extensions begins!).

**Support**
- String literals with escape codes (currently using C highlighting rules)
- Numeric literals in decimal, hexadecimal and binary (lacks _ separator support though)
- Single and multi-line comments
- Highlighting of all? (let me know if some are missing) keywords in the language

Here is an image of the highlighting in action in IntelliJ Dracula mode
![image](https://user-images.githubusercontent.com/42585241/180587912-23b5ae3e-2bdb-49a1-83e8-24e6e0b7cfb5.png)
2022-07-28 11:32:41 -07:00
purpl3r0se f050a08c45 Update README.md (#1803)
I atleast believe this is a typo, may not be tho.
2022-07-28 10:22:21 -07:00
Richard Smith f3127d2e83 Fix test failure due to racing commits. (#1802) 2022-07-28 09:25:14 -07:00
josh11b 64f3284a19 Update links to visible copies of docs (#1786)
I've manually copied some Google docs that were referenced in our design .md files so they may be publicly viewable.
2022-07-27 17:45:05 -07:00
josh11b 132098c1dc Update CONTRIBUTING (#1784)
Three changes:
- no more forums
- only contributors in meetings
- links to issues, including good first issues
2022-07-27 17:43:48 -07:00
Ethan Havemann ae530d63fd Tense Fix (#1764) 2022-07-27 15:32:49 -07:00
Richard Smith 15ec5113aa Add extensibility support for arithmetic operators. (#1751)
Add new prelude interfaces `Negate`, `AddWith`, `SubWith`, and `MulWith`, and
use them to implement non-builtin arithmetic operations.
2022-07-27 15:09:27 -07:00
SADIK KUZU 34a18b5e9e Update github workflow actions' versions (#1776)
Update github workflow actions' versions

* actions/checkout: v2 -> v3
* actions/setup-python: v3 -> v4
* pre-commit/action: v2.0.2 -> v3.0.0
* actions/setup-go: v2 -> v3
* actions/stale: v4 -> v5

Reference links: 

* https://github.com/actions/checkout/releases
* https://github.com/actions/setup-python/releases
* https://github.com/pre-commit/action/releases
* https://github.com/actions/setup-go#v3
* https://github.com/actions/stale#usage

`.github/workflows`:

* pre-commit.yaml
* stale.yaml
* tests.yaml
2022-07-27 14:35:15 -07:00
SADIK KUZU 0b75f8590c Update brew install command for gh cli (#1775)
Reference: https://github.com/cli/cli#macos
2022-07-27 11:31:40 -07:00
Dan Sarginson 3de94947c0 Update print example in FAQ (#1772)
The named file does not exist
2022-07-27 11:04:12 -07:00
Thejaswi Kadur 790e075986 Convert first Print argument to String before evaluating (#1548)
Fixes #1439.
2022-07-27 10:29:09 -07:00
2430c31ea2 [docs] adds new FAQ entries (#1752)
We've observed the following things cropping up regularly enough to
address as 'frequently asked':

* Why isn't there a Carbon logo?
* Where should I ask questions?
* What are the prerequisites for building Carbon?
* Why aren't people willing to discuss certain topics?

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2022-07-26 19:07:40 -07:00
josh11bandJon Ross-Perkins eb2d6cfed3 Update the generic implementation model (#1398)
The previous implementation model involved the caller of a function knowing what impls the function will need. With the addition of blanket impls and specialization to the design, that is in general no longer possible. Instead the caller provides a type which is used as a key to look up the impl, which is expected to occur during monomorphization, though we allow the compiler to employ other strategies when the set of impls is predictable.

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2022-07-26 19:04:26 -07:00
db8927d545 Clarify status in main README (#1748)
Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2022-07-26 16:43:44 -07:00
Richard Smith 7a67715ac5 Error: track message and prefix/location separately. (#1529)
This allows us to combine multiple Errors together without repeating the prefix
information. Also fixes several cases where two "COMPILATION ERROR" prefixes
would be prepended to the same message when errors with prefixes and locations
were produced by the lexer and parser.
2022-07-26 15:08:19 -07:00
Tim Crown 856a5c4536 Fix broken link in doc (#1716)
Broken link in explorer/ast/README.md
2022-07-26 11:37:59 -07:00
Kshitij roodkee 8023296728 Update conditional.md (#1714)
Changed the heading, so that there is uniformity across the docs.
2022-07-26 11:37:24 -07:00
Roland Siegbert f612c7191c Add wikipedia link to ABI in README (#1671)
For easier lookup of the non-goal of a stable API: https://en.wikipedia.org/wiki/Application_binary_interface
2022-07-25 19:44:15 -07:00
Patryk Gutowski 25b6a36b0d Exclude .svg from pre-commit #1655 (#1688)
There was unnecessary checking the .svg images (anyway it did not help a lot as mentioned on the #1655 #1652 issues).
Regex upgraded so it excludes all .svg.

Tested it on the other files and I think it's correct for now.
2022-07-25 10:29:37 -07:00
FZC eded7ee270 gitignore .idea dir (#1704)
Related issue = close #1703
2022-07-25 09:01:32 -07:00
Saurabh MudgalandJon Ross-Perkins b79a481f8f Fixed typo and grammar in README.md (#1646)
Summary of resolved issues/ changes:

1. 'our' typed twice under **Join us** heading in README.md --> 'our ' is no longer repeated, typo fixed
2. verb form and comma related errors under **Memory Safety** heading in README.md --> grammar fixed
3. missing article and hyphen related errors under **Generics** heading in README.md --> grammar fixed
4. punctuation and preposition related errors under **Why build Carbon?** heading in README.md --> grammar fixed

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2022-07-24 18:32:08 -07:00
Zenong Zhang 075b3aba1b Implementation of unformed state for global variables. (#1571)
- Allocate UninitializedValue on heap when a VariableDeclaration does not have initialization.
- Added test cases.
2022-07-24 15:32:38 -07:00
ooxi fc0d7a84db Fix link rendering for correct display in GitHub (#1666)
Unfortunately, GitHub does not render `[file]` as a link to `file`. Instead, `[file](file)` is required.

This patch fixes the rendering of [utils/highlightjs](https://github.com/carbon-language/carbon-lang/tree/trunk/utils/highlightjs)
2022-07-24 14:56:54 -07:00
Patryk Gutowski a8de3074d8 Fix typo in svg image #1647 (#1652)
There was an extra ')' when calling function QuickSort, switched files and uploaded google drive image.
2022-07-24 14:55:13 -07:00
ooxi 6224f50b8d Fix spelling of primitive types (#1663)
Primitive types have been renamed in pull request #861 and also the design document.
2022-07-24 13:08:31 -07:00
Anton Roos 6cef4645ac Fix grammar errors (#1648)
Fix grammar errors:
- the following audiences sounds more natural.
- are instead of is.
- "to use" is wordy and superfluous.
2022-07-24 12:37:00 -07:00
Joshua Peterson 39d6c4139f Add a link the the stacked pull request docs (#1657)
The stacked pull request documentation exists now, so remove the TODO
and add a link to it.
2022-07-24 10:43:27 -07:00
yogesh kartik 19cf9f1243 remove the redundancy (#1631)
removed one "our" in readme.md at line 302.
2022-07-24 09:34:08 -07:00
EnabledFish 088a32128d Fix: Replace Int: x -> x: Int (#1620)
Declaring variables should use `var x: Int`.
2022-07-24 09:13:08 -07:00
Martim Martinsandmartimartins 31df852738 Remove non-needed Python 2.x inherit from object (#1622)
In Python 3.x it is not necessary to have `object` inheritance in classes, it may be useful to have `object` inheritance in classes if the code has support for Python 3.x, 2.x, but currently the present code does not contain support for python 2.x.

Co-authored-by: martimartins <martim13artins13@gmail.com>
2022-07-23 18:15:29 -07:00
CharlieS1103andJon Ross-Perkins 68740764f3 Sentence structure and Grammar in Evolution.md (#1543)
Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2022-07-23 18:03:12 -07:00
Kira Malinova 3c8233016c Add missing bazel run subcommand (#1623) 2022-07-23 15:00:23 -07:00
Joshua Peterson 9287c825eb Add debugging troubleshooting for GDB (#1613)
Older versions of GDB (before version 10.1) don't work with the
DWARF v5 debugging format the LLVM uses. The error message
which GDB shows when this happens is a bit misleading though.

Provide documentation about how to deal with that error message.
2022-07-23 08:53:03 -07:00
Parisa KhaleghiandJon Ross-Perkins 0bcc6d4ae6 Update contribution_tools.md (#1517)
VS Code is a Code editor, not an IDE!

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2022-07-23 08:47:16 -07:00
Yen-Jen Wang 01530a58ed Fix some typos. (#1598) 2022-07-23 02:09:59 -07:00
Kris JusiakandKris Jusiak b75655852f ✅ [explorer] Add tests for implicit tuple to array conversion (#1582)
Problem:
- Explorer doesn't cover implicit tuple to array conversion.

Solution:
- Add to_array.carbon which converts tuple to array if the size matches.
- Add fail_to_array.carbon which doesn't compile becase the size of array doesn't match the size of tuple.

Co-authored-by: Kris Jusiak <kris@jusiak.net>
2022-07-22 17:26:30 -07:00
Chandler CarruthandJon Ross-Perkins 34610c862a Add a link to the CppNorth announcement video. (#1581)
Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2022-07-22 16:34:30 -07:00
Josh Soref 066b103881 Spelling (#1580)
This PR corrects misspellings identified by the [check-spelling action](https://github.com/marketplace/actions/check-spelling).

The misspellings have been reported at https://github.com/jsoref/carbon-lang/commit/38a1c1640151899fd6da0442a92557f9543b6280#commitcomment-79197316

The action reports that the changes in this PR would make it happy: https://github.com/jsoref/carbon-lang/commit/173c8f9083a68aa61f7cfe94f720f1e5dc7f1ea3

Note: this PR does not include the action. If you're interested in running a spell check on every PR and push, that can be offered separately.

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-07-22 16:14:21 -07:00
Wolfgang E SanyerandChandler Carruth d134990157 Update contribution_tools.md (#1513)
The repository can be forked and cloned using the `gh` cli

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2022-07-22 15:04:15 -07:00
prprprpony abee4cc73d Fix some typos in parser_impl.h (#1569) 2022-07-22 11:41:40 -07:00
Richard Smith 59ae6e31b6 Rename PrimitiveOperatorExpression to OperatorExpression. (#1530)
This isn't modeling only primitive operators any more: it also models operators
that are rewritten as calls to an interface function.
2022-07-22 11:36:36 -07:00