From 16ace4b429574f160ca9e515818d1d842ad39a3f Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Sun, 18 Nov 2012 18:02:10 -0600 Subject: [PATCH] Fix token definitions: tokens in a tokens{...} block now have type TOKEN_REF (was ID before commit 38214f6312) --- tool/src/org/antlr/v4/semantics/SemanticPipeline.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/src/org/antlr/v4/semantics/SemanticPipeline.java b/tool/src/org/antlr/v4/semantics/SemanticPipeline.java index da87b3b64..550b33a4c 100644 --- a/tool/src/org/antlr/v4/semantics/SemanticPipeline.java +++ b/tool/src/org/antlr/v4/semantics/SemanticPipeline.java @@ -151,7 +151,7 @@ public class SemanticPipeline { void assignLexerTokenTypes(Grammar g, List tokensDefs) { Grammar G = g.getOutermostGrammar(); // put in root, even if imported for (GrammarAST def : tokensDefs) { - if ( def.getType()== ANTLRParser.ID ) G.defineTokenName(def.getText()); + if ( def.getType()== ANTLRParser.TOKEN_REF ) G.defineTokenName(def.getText()); } /* Define token types for nonfragment rules which do not include a 'type(...)'