From b5e399769454e54d0f47ba5ca0d6f228f57f346a Mon Sep 17 00:00:00 2001 From: Phil Elson Date: Wed, 30 Oct 2024 09:11:29 +0100 Subject: [PATCH] Fixed handling of empty lists when rendering the Python3 generated files Signed-off-by: Phil Elson --- .../templates/codegen/Python3/Python3.stg | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/Python3/Python3.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/Python3/Python3.stg index 08b8577593..1a0ec0d493 100644 --- a/tool/resources/org/antlr/v4/tool/templates/codegen/Python3/Python3.stg +++ b/tool/resources/org/antlr/v4/tool/templates/codegen/Python3/Python3.stg @@ -84,6 +84,7 @@ def exit(self, ctx: . }; separator="\n"> del + >> @@ -108,6 +109,7 @@ def visit(self, ctx: . del + >> @@ -141,11 +143,11 @@ class (Parser): sharedContextCache = PredictionContextCache() literalNames = [ - }; null="\"\\"", separator=",\n", anchor>, + }; null="\"\\"", separator=",\n", anchor>, ] symbolicNames = [ - }; null="\"\\"", separator=",\n", anchor>, + }; null="\"\\"", separator=",\n", anchor>, ] @@ -153,7 +155,7 @@ class (Parser): ruleNames = [ - "}; separator=",\n", wrap, anchor>, + "}; separator=",\n", wrap, anchor>, ] EOF = .EOF @@ -825,8 +827,7 @@ class (Lexer): channelNames = [ "DEFAULT_TOKEN_CHANNEL", "HIDDEN", - "}; separator=",\n", anchor> - , + "}; separator=",\n", anchor>, ] modeNames = [ @@ -834,13 +835,13 @@ class (Lexer): ] literalNames = [ - "\", - }; separator=",\n", anchor>, + "\", + }; separator=",\n", anchor>, ] symbolicNames = [ - "\", - }; separator=",\n", anchor>, + "\", + }; separator=",\n", anchor>, ] ruleNames = [