tree: cec6108810fad8f30e2c294f695a3d66ca118917 [path history] [tgz]
  1. .gitignore
  2. check.sh
  3. lexer.l
  4. parser-lalr-main.c
  5. parser-lalr.y
  6. raw-string-literal-ambiguity.md
  7. README.md
  8. RustLexer.g4
  9. testparser.py
  10. tokens.h
  11. verify.rs
  12. xidcontinue.g4
  13. xidstart.g4
src/grammar/README.md

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.