You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closes#72
Fairly simple change:
- Tuple types
- Tuple expressions
- Tuple indexing expressions. Error out on invalid indices such as `0xa`
or anything that is not a `usize`.
Note that `t.0.0` does not currently work, but `t.0 .0`. Once we
implement #66, we can then write `(t.0).0`. In the future, we can
support `t.0.0` which can be done in two ways:
- Special case the lexer to _not_ parse the `0.0` as a real in the case
of a tuple access (this means the lexer now has to concern itself with
the context).
- Break the real `0.0` apart in the pasrer, which kinda what Rust does
(see rust-lang/rust#71322 after an attempt for
the other method in rust-lang/rust#70420)
A number of keywords are reserved and cannot be used as identifiers. The keywords are: `bool`, `constraint`, `else`, `false`, `real`, `fn`, `if`, `int`, `let`, `maximize`, `minimize`, `satisfy`, `solve`, `true`, `type`.
65
+
A number of keywords are reserved and cannot be used as identifiers. The keywords are: `bool`, `constraint`, `else`, `false`, `real`, `fn`, `if`, `int`, `let`, `maximize`, `minimize`, `satisfy`, `solve`, `true`.
66
66
67
67
## High-level Intent Structure
68
68
@@ -138,7 +138,8 @@ Expressions represent values and have the following syntax:
138
138
| <int-literal>
139
139
| <real-literal>
140
140
| <string-literal>
141
-
| <tuple-literal>
141
+
| <tuple-expr>
142
+
| <tuple-index-expr>
142
143
| <if-expr>
143
144
| <call-expr>
144
145
```
@@ -249,15 +250,23 @@ let string = "first line\
249
250
third line";
250
251
```
251
252
252
-
#### Tuple Literals
253
+
#### Tuple Expressions and Tuple Indexing Expressions
The type of the expressions passed as arguments must match the argument types of the called function. The return type of the function must also be appropriate for the calling context.
0 commit comments