Skip to content

Commit

Permalink
Follow-up to #2657: include #2511, references (#2870)
Browse files Browse the repository at this point in the history
With this change `docs/design/lexical_conventions/symbolic_tokens.md` should now include all operators and symbols from accepted proposals.
  • Loading branch information
josh11b authored Jun 2, 2023
1 parent 6d399c8 commit 684168f
Showing 1 changed file with 46 additions and 7 deletions.
53 changes: 46 additions & 7 deletions docs/design/lexical_conventions/symbolic_tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,24 @@ source file:
| `*` | Indirection, multiplication, and forming pointer types |
| `/` | Division |
| `%` | Modulus |
| `=` | Assignment |
| `^` | Complementing and Bitwise XOR |
| `&` | Address-of and Bitwise AND |
| `\|` | Bitwise OR |
| `<<` | Arithmetic and Logical Left-shift |
| `>>` | Arithmetic and Logical Right-shift |
| `=` | Assignment and initialization |
| `++` | Increment |
| `--` | Decrement |
| `+=` | Add-and-assign |
| `-=` | Subtract-and-assign |
| `*=` | Multiply-and-assign |
| `/=` | Divide-and-assign |
| `%=` | Modulus-and-assign |
| `&=` | Bitwise-AND-and-assign |
| `\|=` | Bitwise-OR-and-assign |
| `^=` | Bitwise-XOR-and-assign |
| `<<=` | Left-shift-and-assign |
| `>>=` | Right-shift-and-assign |
| `==` | Equality or equal to |
| `!=` | Inequality or not equal to |
| `>` | Greater than |
Expand All @@ -87,15 +99,42 @@ source file:
| `:!` | Generic binding |
| `;` | Statement separator |

TODO: The assignment operators in
[#2511](https://github.com/carbon-language/carbon-lang/pull/2511) are still to
be added.

## Alternatives considered

- [Proposal: p0601](/proposals/p0601.md#alternatives-considered)
[Alternatives from proposal #601](/proposals/p0601.md#alternatives-considered):

- lex the longest sequence of symbolic characters rather than lexing only the
longest known operator
- support an extensible operator set
- different whitespace restrictions or no whitespace restrictions

## References

- Proposal
[#601: Symbolic tokens](https://github.com/carbon-language/carbon-lang/pull/601)
[#162: Basic Syntax](https://github.com/carbon-language/carbon-lang/pull/162)
- Proposal
[#339: Add `var <type> <identifier> [ = <value> ];` syntax for variables](https://github.com/carbon-language/carbon-lang/pull/339)
- Proposal
[#438: Add statement syntax for function declarations](https://github.com/carbon-language/carbon-lang/pull/438)
- Proposal
[#561: Basic classes: use cases, struct literals, struct types, and future work](https://github.com/carbon-language/carbon-lang/pull/561)
- Proposal
[#601: Operator tokens](https://github.com/carbon-language/carbon-lang/pull/601)
- Proposal
[#676: `:!` generic syntax](https://github.com/carbon-language/carbon-lang/pull/676)
- Proposal
[#702: Comparison operators](https://github.com/carbon-language/carbon-lang/pull/702)
- Proposal
[#989: Member access expressions](https://github.com/carbon-language/carbon-lang/pull/989)
- Proposal
[#1083: Arithmetic expressions](https://github.com/carbon-language/carbon-lang/pull/1083)
- Proposal
[#1191: Arithmetic expressions](https://github.com/carbon-language/carbon-lang/pull/1191)
- Proposal
[#2188: Pattern matching syntax and semantics](https://github.com/carbon-language/carbon-lang/pull/2188)
- Proposal
[#2274: Subscript syntax and semantics](https://github.com/carbon-language/carbon-lang/pull/2274)
- Proposal
[#2511: Assignment statements](https://github.com/carbon-language/carbon-lang/pull/2511)
- Proposal
[#2665: Semicolons terminate statements](https://github.com/carbon-language/carbon-lang/pull/2665)

0 comments on commit 684168f

Please sign in to comment.