Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
Add explicit EOF to top-level parser rule
Browse files Browse the repository at this point in the history
* Fixes #1154
* Generally helps catch trailing syntax errors
* Performance-neutral relative to previous grammar
* Recommended by antlr4 devs, can help performance in some cases
* See antlr/antlr4#1540
  • Loading branch information
albert-magyar committed Oct 29, 2019
1 parent 7b18778 commit 39010b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/antlr4/FIRRTL.g4
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import firrtl.LexerHelper;

// Does there have to be at least one module?
circuit
: 'circuit' id ':' info? INDENT module* DEDENT
: 'circuit' id ':' info? INDENT module* DEDENT EOF
;

module
Expand Down

0 comments on commit 39010b7

Please sign in to comment.