From 5f9bc6ed4dfa09e8ec8b76db872f6f8967f0e77a Mon Sep 17 00:00:00 2001 From: Ali Tavakoli Date: Mon, 22 Aug 2016 23:40:54 -0400 Subject: [PATCH] JavaScript example: Add "kind" to VariableDeclaration nodes The JavaScript example grammar's VariableDeclaration nodes were missing the "kind" member (which is always set to "var", according to the ESTree spec). --- examples/javascript.pegjs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/javascript.pegjs b/examples/javascript.pegjs index 2e56a0f..42febef 100644 --- a/examples/javascript.pegjs +++ b/examples/javascript.pegjs @@ -1016,7 +1016,8 @@ VariableStatement = VarToken __ declarations:VariableDeclarationList EOS { return { type: "VariableDeclaration", - declarations: declarations + declarations: declarations, + kind: "var" }; } @@ -1124,7 +1125,8 @@ IterationStatement type: "ForStatement", init: { type: "VariableDeclaration", - declarations: declarations + declarations: declarations, + kind: "var" }, test: extractOptional(test, 0), update: extractOptional(update, 0), @@ -1158,7 +1160,8 @@ IterationStatement type: "ForInStatement", left: { type: "VariableDeclaration", - declarations: declarations + declarations: declarations, + kind: "var" }, right: right, body: body