JavaScript example: Use LogicalExpression nodes for "&&" and "||"

The buildLogicalExpression function was defined, but not used;
specifically, the Logical(AND|OR)Expression(NoIn)? rules were
constructing BinaryExpression nodes, but are now LogicalExpression
nodes as per the ESTree spec (es5.md).
redux
Ali Tavakoli 8 years ago
parent bf08c6cbc3
commit d914c7b150

@ -855,12 +855,12 @@ BitwiseOROperator
LogicalANDExpression
= head:BitwiseORExpression
tail:(__ LogicalANDOperator __ BitwiseORExpression)*
{ return buildBinaryExpression(head, tail); }
{ return buildLogicalExpression(head, tail); }
LogicalANDExpressionNoIn
= head:BitwiseORExpressionNoIn
tail:(__ LogicalANDOperator __ BitwiseORExpressionNoIn)*
{ return buildBinaryExpression(head, tail); }
{ return buildLogicalExpression(head, tail); }
LogicalANDOperator
= "&&"
@ -868,12 +868,12 @@ LogicalANDOperator
LogicalORExpression
= head:LogicalANDExpression
tail:(__ LogicalOROperator __ LogicalANDExpression)*
{ return buildBinaryExpression(head, tail); }
{ return buildLogicalExpression(head, tail); }
LogicalORExpressionNoIn
= head:LogicalANDExpressionNoIn
tail:(__ LogicalOROperator __ LogicalANDExpressionNoIn)*
{ return buildBinaryExpression(head, tail); }
{ return buildLogicalExpression(head, tail); }
LogicalOROperator
= "||"

Loading…
Cancel
Save