From ee3d29cc50832a5c7220f33ba0f048a6cdf79c49 Mon Sep 17 00:00:00 2001 From: Eric Vergnaud Date: Thu, 3 Sep 2015 20:59:50 +0800 Subject: [PATCH] Fixes an issue pointed out by Mike Cargal, where null literals where registered as 'null' instead of null in both lexicalNames and symbolicNames, thus resulting in erroneous error messages when handling parsing errors. --- .../v4/tool/templates/codegen/JavaScript/JavaScript.stg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/JavaScript/JavaScript.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/JavaScript/JavaScript.stg index a9cfef1c9..720516ebf 100644 --- a/tool/resources/org/antlr/v4/tool/templates/codegen/JavaScript/JavaScript.stg +++ b/tool/resources/org/antlr/v4/tool/templates/codegen/JavaScript/JavaScript.stg @@ -134,9 +134,9 @@ var decisionsToDFA = atn.decisionToState.map( function(ds, index) { return new a var sharedContextCache = new antlr4.PredictionContextCache(); -var literalNames = [ }; null="'null'", separator=", ", wrap, anchor> ]; +var literalNames = [ }; null="null", separator=", ", wrap, anchor> ]; -var symbolicNames = [ }; null="'null'", separator=", ", wrap, anchor> ]; +var symbolicNames = [ }; null="null", separator=", ", wrap, anchor> ]; var ruleNames = [ "}; separator=", ", wrap, anchor> ]; @@ -825,9 +825,9 @@ function (input) { .modeNames = [ "}; separator=", ", wrap, anchor> ]; -.literalNames = [ }; null="'null'", separator=", ", wrap, anchor> ]; +.literalNames = [ }; null="null", separator=", ", wrap, anchor> ]; -.symbolicNames = [ }; null="'null'", separator=", ", wrap, anchor> ]; +.symbolicNames = [ }; null="null", separator=", ", wrap, anchor> ]; .ruleNames = [ "}; separator=", ", wrap, anchor> ];