Get for(x in y) { } working in js parser
parent
bf664e7ec8
commit
87bbe8cae1
|
@ -42,15 +42,35 @@ Expr = OrExpr:e "?" Expr:t ":" Expr:f => [[ e t f ast-cond-exp
|
||||||
| OrExpr:e "||=" Expr:rhs => [[ e rhs "||" ast-mset boa ]]
|
| OrExpr:e "||=" Expr:rhs => [[ e rhs "||" ast-mset boa ]]
|
||||||
| OrExpr:e => [[ e ]]
|
| OrExpr:e => [[ e ]]
|
||||||
|
|
||||||
|
ExprNoIn = OrExprNoIn:e "?" ExprNoIn:t ":" ExprNoIn:f => [[ e t f ast-cond-expr boa ]]
|
||||||
|
| OrExprNoIn:e "=" ExprNoIn:rhs => [[ e rhs ast-set boa ]]
|
||||||
|
| OrExprNoIn:e "+=" ExprNoIn:rhs => [[ e rhs "+" ast-mset boa ]]
|
||||||
|
| OrExprNoIn:e "-=" ExprNoIn:rhs => [[ e rhs "-" ast-mset boa ]]
|
||||||
|
| OrExprNoIn:e "*=" ExprNoIn:rhs => [[ e rhs "*" ast-mset boa ]]
|
||||||
|
| OrExprNoIn:e "/=" ExprNoIn:rhs => [[ e rhs "/" ast-mset boa ]]
|
||||||
|
| OrExprNoIn:e "%=" ExprNoIn:rhs => [[ e rhs "%" ast-mset boa ]]
|
||||||
|
| OrExprNoIn:e "&&=" ExprNoIn:rhs => [[ e rhs "&&" ast-mset boa ]]
|
||||||
|
| OrExprNoIn:e "||=" ExprNoIn:rhs => [[ e rhs "||" ast-mset boa ]]
|
||||||
|
| OrExprNoIn:e => [[ e ]]
|
||||||
|
|
||||||
OrExpr = OrExpr:x "||" AndExpr:y => [[ x y "||" ast-binop boa ]]
|
OrExpr = OrExpr:x "||" AndExpr:y => [[ x y "||" ast-binop boa ]]
|
||||||
| AndExpr
|
| AndExpr
|
||||||
|
OrExprNoIn = OrExprNoIn:x "||" AndExprNoIn:y => [[ x y "||" ast-binop boa ]]
|
||||||
|
| AndExprNoIn
|
||||||
AndExpr = AndExpr:x "&&" EqExpr:y => [[ x y "&&" ast-binop boa ]]
|
AndExpr = AndExpr:x "&&" EqExpr:y => [[ x y "&&" ast-binop boa ]]
|
||||||
| EqExpr
|
| EqExpr
|
||||||
|
AndExprNoIn = AndExprNoIn:x "&&" EqExprNoIn:y => [[ x y "&&" ast-binop boa ]]
|
||||||
|
| EqExprNoIn
|
||||||
EqExpr = EqExpr:x "==" RelExpr:y => [[ x y "==" ast-binop boa ]]
|
EqExpr = EqExpr:x "==" RelExpr:y => [[ x y "==" ast-binop boa ]]
|
||||||
| EqExpr:x "!=" RelExpr:y => [[ x y "!=" ast-binop boa ]]
|
| EqExpr:x "!=" RelExpr:y => [[ x y "!=" ast-binop boa ]]
|
||||||
| EqExpr:x "===" RelExpr:y => [[ x y "===" ast-binop boa ]]
|
| EqExpr:x "===" RelExpr:y => [[ x y "===" ast-binop boa ]]
|
||||||
| EqExpr:x "!==" RelExpr:y => [[ x y "!==" ast-binop boa ]]
|
| EqExpr:x "!==" RelExpr:y => [[ x y "!==" ast-binop boa ]]
|
||||||
| RelExpr
|
| RelExpr
|
||||||
|
EqExprNoIn = EqExprNoIn:x "==" RelExprNoIn:y => [[ x y "==" ast-binop boa ]]
|
||||||
|
| EqExprNoIn:x "!=" RelExprNoIn:y => [[ x y "!=" ast-binop boa ]]
|
||||||
|
| EqExprNoIn:x "===" RelExprNoIn:y => [[ x y "===" ast-binop boa ]]
|
||||||
|
| EqExprNoIn:x "!==" RelExprNoIn:y => [[ x y "!==" ast-binop boa ]]
|
||||||
|
| RelExprNoIn
|
||||||
RelExpr = RelExpr:x ">" ShiftExpr:y => [[ x y ">" ast-binop boa ]]
|
RelExpr = RelExpr:x ">" ShiftExpr:y => [[ x y ">" ast-binop boa ]]
|
||||||
| RelExpr:x ">=" ShiftExpr:y => [[ x y ">=" ast-binop boa ]]
|
| RelExpr:x ">=" ShiftExpr:y => [[ x y ">=" ast-binop boa ]]
|
||||||
| RelExpr:x "<" ShiftExpr:y => [[ x y "<" ast-binop boa ]]
|
| RelExpr:x "<" ShiftExpr:y => [[ x y "<" ast-binop boa ]]
|
||||||
|
@ -58,6 +78,12 @@ RelExpr = RelExpr:x ">" ShiftExpr:y => [[ x y ">" ast-bino
|
||||||
| RelExpr:x "instanceof" ShiftExpr:y => [[ x y "instanceof" ast-binop boa ]]
|
| RelExpr:x "instanceof" ShiftExpr:y => [[ x y "instanceof" ast-binop boa ]]
|
||||||
| RelExpr:x "in" ShiftExpr:y => [[ x y "in" ast-binop boa ]]
|
| RelExpr:x "in" ShiftExpr:y => [[ x y "in" ast-binop boa ]]
|
||||||
| ShiftExpr
|
| ShiftExpr
|
||||||
|
RelExprNoIn = RelExprNoIn:x ">" ShiftExpr:y => [[ x y ">" ast-binop boa ]]
|
||||||
|
| RelExprNoIn:x ">=" ShiftExpr:y => [[ x y ">=" ast-binop boa ]]
|
||||||
|
| RelExprNoIn:x "<" ShiftExpr:y => [[ x y "<" ast-binop boa ]]
|
||||||
|
| RelExprNoIn:x "<=" ShiftExpr:y => [[ x y "<=" ast-binop boa ]]
|
||||||
|
| RelExprNoIn:x "instanceof" ShiftExpr:y => [[ x y "instanceof" ast-binop boa ]]
|
||||||
|
| ShiftExpr
|
||||||
ShiftExpr = ShiftExpr:x "<<" AddExpr:y => [[ x y "<<" ast-binop boa ]]
|
ShiftExpr = ShiftExpr:x "<<" AddExpr:y => [[ x y "<<" ast-binop boa ]]
|
||||||
| ShiftExpr:x ">>>" AddExpr:y => [[ x y ">>>" ast-binop boa ]]
|
| ShiftExpr:x ">>>" AddExpr:y => [[ x y ">>>" ast-binop boa ]]
|
||||||
| ShiftExpr:x ">>" AddExpr:y => [[ x y ">>" ast-binop boa ]]
|
| ShiftExpr:x ">>" AddExpr:y => [[ x y ">>" ast-binop boa ]]
|
||||||
|
@ -111,14 +137,14 @@ Binding = Name:n "=" Expr:v => [[ n v ast-var
|
||||||
Block = "{" SrcElems:ss "}" => [[ ss ]]
|
Block = "{" SrcElems:ss "}" => [[ ss ]]
|
||||||
Bindings = (Binding ("," Binding => [[ second ]])* => [[ first2 swap prefix ]])?
|
Bindings = (Binding ("," Binding => [[ second ]])* => [[ first2 swap prefix ]])?
|
||||||
For1 = "var" Bindings => [[ second ]]
|
For1 = "var" Bindings => [[ second ]]
|
||||||
| Expr
|
| ExprNoIn
|
||||||
| Spaces => [[ "undefined" ast-get boa ]]
|
| Spaces => [[ "undefined" ast-get boa ]]
|
||||||
For2 = Expr
|
For2 = Expr
|
||||||
| Spaces => [[ "true" ast-get boa ]]
|
| Spaces => [[ "true" ast-get boa ]]
|
||||||
For3 = Expr
|
For3 = Expr
|
||||||
| Spaces => [[ "undefined" ast-get boa ]]
|
| Spaces => [[ "undefined" ast-get boa ]]
|
||||||
ForIn1 = "var" Name:n => [[ n "undefined" ast-get boa ast-var boa ]]
|
ForIn1 = "var" Name:n => [[ n "undefined" ast-get boa ast-var boa ]]
|
||||||
| Expr
|
| PrimExprHd
|
||||||
Switch1 = "case" Expr:c ":" SrcElems:cs => [[ c cs ast-case boa ]]
|
Switch1 = "case" Expr:c ":" SrcElems:cs => [[ c cs ast-case boa ]]
|
||||||
| "default" ":" SrcElems:cs => [[ cs ast-default boa ]]
|
| "default" ":" SrcElems:cs => [[ cs ast-default boa ]]
|
||||||
SwitchBody = Switch1*
|
SwitchBody = Switch1*
|
||||||
|
|
Loading…
Reference in New Issue