mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Support parsing and testing unimplemented expressions (#957)
Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
co-authored by
Jon Meow
parent
be0c1e9da6
commit
dc5e62fc7a
@@ -28,7 +28,12 @@ The parser is implemented using the flex and bison parser generator tools.
|
||||
- [`syntax.ypp`](syntax/syntax.ypp) the grammar
|
||||
|
||||
The parser translates program text into an abstract syntax tree (AST), defined
|
||||
in the [ast](ast/) subdirectory.
|
||||
in the [ast](ast/) subdirectory. The `UnimplementedExpression` node type can be
|
||||
used to define new expression syntaxes without defining their semantics, and the
|
||||
same techniques can be applied to other kinds of AST nodes as needed. See the
|
||||
handling of the `UNIMPL_EXAMPLE` token for an example of how this is done, and
|
||||
see [`unimplemented_example_test.cpp`](syntax/unimplemented_example_test.cpp)
|
||||
for an example of how to test it.
|
||||
|
||||
The [type checker](interpreter/typecheck.h) defines what it means for an AST to
|
||||
be a valid program. The type checker prints an error and exits if the AST is
|
||||
|
||||
Reference in New Issue
Block a user