diff --git a/tool/src/org/antlr/v4/codegen/target/GoTarget.java b/tool/src/org/antlr/v4/codegen/target/GoTarget.java index 7366f27286..a0311a4eeb 100644 --- a/tool/src/org/antlr/v4/codegen/target/GoTarget.java +++ b/tool/src/org/antlr/v4/codegen/target/GoTarget.java @@ -44,7 +44,13 @@ public class GoTarget extends Target { "SetInvokingState", "SetParent", "String", // misc - "rule", "parserRule", "action" + "rule", "parserRule", "action", + + // the use of start or stop abd others as a label name will cause the generation of a GetStart() or GetStop() method, which + // then clashes with the GetStart() or GetStop() method that is generated by the code gen for the rule. So, we need to + // convert it. This is not ideal as it will still probably confuse authors of parse listeners etc. but the code will + // compile. This is a proof of Hyrum's law. + "start", "stop", "exception" )); private static final boolean DO_GOFMT = !Boolean.parseBoolean(System.getenv("ANTLR_GO_DISABLE_GOFMT"))