From 10e05942ca019f2b172f8eb37c34359cb5a118b3 Mon Sep 17 00:00:00 2001 From: Ken Domino Date: Sun, 2 Jul 2023 16:27:10 -0400 Subject: [PATCH] Fix for #4342--EmitToken(token) must be exported and virtualized. Required for porting https://github.com/antlr/grammars-v4/tree/master/python/python3 to the Go target. This change just mirrors the APIs for the other targets, like Java, CSharp, and JavaScript/TypeScript. Signed-off-by: Ken Domino --- runtime/Go/antlr/v4/lexer.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/Go/antlr/v4/lexer.go b/runtime/Go/antlr/v4/lexer.go index 30d50af43a..dabab7ce85 100644 --- a/runtime/Go/antlr/v4/lexer.go +++ b/runtime/Go/antlr/v4/lexer.go @@ -20,6 +20,7 @@ type Lexer interface { Recognizer Emit() Token + EmitToken(Token) SetChannel(int) PushMode(int) @@ -311,7 +312,7 @@ func (b *BaseLexer) EmitToken(token Token) { // / func (b *BaseLexer) Emit() Token { t := b.factory.Create(b.tokenFactorySourcePair, b.thetype, b.text, b.channel, b.TokenStartCharIndex, b.GetCharIndex()-1, b.TokenStartLine, b.TokenStartColumn) - b.EmitToken(t) + b.Virt.EmitToken(t) return t }