From 8f108c1aa8cac656da56b2505519db47080d5a26 Mon Sep 17 00:00:00 2001 From: Albert Magyar Date: Mon, 4 Nov 2019 12:34:13 -0800 Subject: Add explicit EOF to top-level parser rule (#1217) * Fixes #1154 * Tests that #1154 example produces SyntaxErrorsException * 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--- src/main/antlr4/FIRRTL.g4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/antlr4/FIRRTL.g4 b/src/main/antlr4/FIRRTL.g4 index 518cb698..0035423b 100644 --- a/src/main/antlr4/FIRRTL.g4 +++ b/src/main/antlr4/FIRRTL.g4 @@ -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 -- cgit v1.2.3