rust/src/grammar
Michael McConville 552b70aad3 Fix whitespace alignment
Trivial, but my eye is twitching.
2015-12-24 21:39:38 -05:00
..
.gitignore
check.sh
lexer.l Adjust src/grammar for the introduced <- op 2015-10-27 23:06:37 +02:00
parser-lalr-main.c
parser-lalr.y Fix whitespace alignment 2015-12-24 21:39:38 -05:00
raw-string-literal-ambiguity.md
README.md
RustLexer.g4 Adjust src/grammar for the introduced <- op 2015-10-27 23:06:37 +02:00
testparser.py
tokens.h
verify.rs fix rustc-test 2015-11-26 19:19:54 +02:00
xidcontinue.g4
xidstart.g4

Reference grammar.

Uses antlr4 and a custom Rust tool to compare ASTs/token streams generated. You can use the check-lexer 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" RustLexer.tokens || 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.