Commit Graph
6 Commits
Author SHA1 Message Date
8d5d48a4a7 [toolchain][parser] Parse for statement. (#2180)
Summary:

Add support for parsing `for` loops.

Co-authored-by: ergawy <kareem.ergawy@guardsquare.com>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2022-10-03 08:36:19 -07:00
Kareem Ergawyandergawy d44cde3c15 [Toolchain][Parser] Add support for package directive. (#2144)
Summary:

Adds parsing support for the `package` directive as specified by the
`Code and name organization` design doc.

Co-authored-by: ergawy <kareem.ergawy@guardsquare.com>
2022-09-07 10:54:27 +03:00
Richard Smith fe28dd9a33 [toolchain] Parsing support for struct literals, following #561 / #653. (#699)
This supports both struct type literals, `{.x: i32, .y: i32}`, and struct
value literals, `{.x = 3, .y = 4}`. The degenerate case of `{}` is
treated as a struct value literal, with the expectation that an empty
struct value has the same type/value duality as an empty tuple value.
2021-08-27 18:18:33 -07:00
Richard Smith b1993a6cd0 [toolchain] Parsing support for tuple literal syntax. (#694)
For now, we permit non-empty tuples to have trailing commas, and require
a trailing comma if there's exactly one list element. The exact rule
here has not yet been decided.
2021-08-02 16:18:18 -07:00
Richard Smith 61b30b1243 [toolchain] Parse variables and parameters as 'name: Type'. (#574)
Factor out code for pattern parsing, that only recognizes this form for
now, and uniformly form a 'PatternBinding' parse node for this, for
both variables and patterns.
2021-06-14 14:28:45 -07:00
Chandler Carruth 8f8ab23a77 Move the toolchain into a top-level directory. (#567)
This should clean up our top level directory and the build patterns.

No non-mechanical edits here. Just injecting `toolchain/` and
`TOOLCHAIN_` and then running formatting tools.
2021-06-08 03:01:37 -07:00