Skip to content

Commit ceca1ad

Browse files
authored
Merge pull request #3832 from jimidle/feature/antlr3101
fix: #2826 Go template is incorrect for dynamic scopes
2 parents e51cfcc + 4e9377b commit ceca1ad

File tree

1 file changed

+2
-2
lines changed
  • tool/resources/org/antlr/v4/tool/templates/codegen/Go

1 file changed

+2
-2
lines changed

tool/resources/org/antlr/v4/tool/templates/codegen/Go/Go.stg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,8 +906,8 @@ ThisRulePropertyRef_text(r) ::= "p.GetTokenStream().GetTextFromTokens(localctx.G
906906
ThisRulePropertyRef_ctx(r) ::= "<ctx(r)>"
907907
ThisRulePropertyRef_parser(r) ::= "p"
908908

909-
NonLocalAttrRef(s) ::= "GetInvokingContext(<s.ruleIndex>).<s.escapedName>"
910-
SetNonLocalAttr(s, rhsChunks) ::= "GetInvokingContext(<s.ruleIndex>).<s.escapedName> = <rhsChunks>"
909+
NonLocalAttrRef(s) ::= "p.GetInvokingContext(<s.ruleIndex>).(*<s.ruleName; format={cap}>Context).<s.escapedName>"
910+
SetNonLocalAttr(s, rhsChunks) ::= "p.GetInvokingContext(<s.ruleIndex>).(*<s.ruleName; format={cap}>Context).<s.escapedName> = <rhsChunks>"
911911

912912
AddToLabelList(a) ::= "<ctx(a.label)>.<a.listName> = append(<ctx(a.label)>.<a.listName>, <labelref(a.label)>)"
913913

0 commit comments

Comments
 (0)