From f9ea46ef15cdc7933a5bdbd85826f9647562d6b3 Mon Sep 17 00:00:00 2001 From: David Majda Date: Mon, 31 May 2010 15:26:35 +0200 Subject: [PATCH] Fix string literal parsing in the JavaScript grammar --- examples/javascript.pegjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/javascript.pegjs b/examples/javascript.pegjs index 9ee3fd9..75e7d50 100644 --- a/examples/javascript.pegjs +++ b/examples/javascript.pegjs @@ -152,8 +152,8 @@ FutureReservedWord: Literal : NullLiteral / BooleanLiteral - / NumericLiteral { return { type: "NumericLiteral", value: $1 }; } - / StringLiteral { return { type: "StringLiteral", value: $1[1] }; } + / NumericLiteral { return { type: "NumericLiteral", value: $1 }; } + / StringLiteral { return { type: "StringLiteral", value: $1 }; } / RegularExpressionLiteral NullLiteral: NullToken { return { type: "NullLiteral" }; }