rust/src/grammar
Brendan Zabarauskas 936d999b52 Use common variants for open and close delimiters
This common representation for delimeters should make pattern matching easier. Having a separate `token::DelimToken` enum also allows us to enforce the invariant that the opening and closing delimiters must be the same in `ast::TtDelimited`, removing the need to ensure matched delimiters when working with token trees.
2014-10-30 09:35:52 +11:00
..
.gitignore Byte/raw binary literal fixes 2014-07-21 10:59:58 -07:00
check.sh Add a ton of ignore-lexer-test 2014-07-21 18:38:40 -07:00
raw-string-literal-ambiguity.md adding proof of context-sensitivy of raw string literals 2014-07-27 02:13:19 -04:00
README.md Don't run lexer tests by default 2014-07-21 19:26:20 -07:00
RustLexer.g4 Update ANTLR float suffix grammar 2014-09-29 12:52:35 +02:00
verify.rs Use common variants for open and close delimiters 2014-10-30 09:35:52 +11:00

Reference grammar.

Uses antlr4 and a custom Rust tool to compare ASTs/token streams generated. You can use the check-syntax make target to run all of the available tests.

To use manually:

antlr4 RustLexer.g4
javac *.java
rustc -O verify.rs
for file in ../*/**.rs; do
    echo $file;
    grun RustLexer tokens -tokens < $file | ./verify $file || break
done

Note That the ../*/**.rs glob will match every *.rs file in the above directory and all of its recursive children. This is a zsh extension.