Skip to content

Commit

Permalink
fix: antlr#2826 Go template is incorrect for dynamic scopes
Browse files Browse the repository at this point in the history
closes antlr#2826
obviates PR antlr#3101

Signed-off-by: Jim.Idle <jimi@gatherstars.com>
Signed-off-by: Eric Vergnaud <eric.vergnaud@wanadoo.fr>
  • Loading branch information
Jim.Idle authored and ericvergnaud committed Sep 9, 2022
1 parent f3aa043 commit 34f209b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tool/resources/org/antlr/v4/tool/templates/codegen/Go/Go.stg
Original file line number Diff line number Diff line change
Expand Up @@ -906,8 +906,8 @@ ThisRulePropertyRef_text(r) ::= "p.GetTokenStream().GetTextFromTokens(localctx.G
ThisRulePropertyRef_ctx(r) ::= "<ctx(r)>"
ThisRulePropertyRef_parser(r) ::= "p"

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

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

Expand Down

0 comments on commit 34f209b

Please sign in to comment.