Added "action" to badWords set for Go runtime.

Some spaced replaced with tabs.
This commit is contained in:
Ivan Kochurkin 2017-02-17 23:31:51 +03:00
parent 628aa8ff02
commit fab6172749
1 changed files with 5 additions and 4 deletions

View File

@ -50,7 +50,7 @@ public class GoTarget extends Target {
}; };
/** Avoid grammar symbols in this set to prevent conflicts in gen'd code. */ /** Avoid grammar symbols in this set to prevent conflicts in gen'd code. */
private final Set<String> badWords = new HashSet<String>(goKeywords.length + goPredeclaredIdentifiers.length + 2); private final Set<String> badWords = new HashSet<String>(goKeywords.length + goPredeclaredIdentifiers.length + 3);
private static final boolean DO_GOFMT = !Boolean.parseBoolean(System.getenv("ANTLR_GO_DISABLE_GOFMT")) private static final boolean DO_GOFMT = !Boolean.parseBoolean(System.getenv("ANTLR_GO_DISABLE_GOFMT"))
&& !Boolean.parseBoolean(System.getProperty("antlr.go.disable-gofmt")); && !Boolean.parseBoolean(System.getProperty("antlr.go.disable-gofmt"));
@ -59,12 +59,12 @@ public class GoTarget extends Target {
super(gen, "Go"); super(gen, "Go");
} }
@Override @Override
public String getVersion() { public String getVersion() {
return "4.6.1"; return "4.6.1";
} }
public Set<String> getBadWords() { public Set<String> getBadWords() {
if (badWords.isEmpty()) { if (badWords.isEmpty()) {
addBadWords(); addBadWords();
} }
@ -77,6 +77,7 @@ public class GoTarget extends Target {
badWords.addAll(Arrays.asList(goPredeclaredIdentifiers)); badWords.addAll(Arrays.asList(goPredeclaredIdentifiers));
badWords.add("rule"); badWords.add("rule");
badWords.add("parserRule"); badWords.add("parserRule");
badWords.add("action");
} }
@Override @Override