]> gitweb.factorcode.org Git - factor.git/commitdiff
Add support for 'with' in js parser. Now parses jquery successfully
authorChris Double <chris@bethia.(none)>
Mon, 30 Jun 2008 07:25:23 +0000 (19:25 +1200)
committerChris Double <chris@bethia.(none)>
Thu, 10 Jul 2008 01:56:06 +0000 (13:56 +1200)
extra/peg/javascript/ast/ast.factor
extra/peg/javascript/parser/parser.factor

index 47ab6da864e00468122781d07878dfc1a457a1cf..9f67af86aaa957bb60d12950b77d6420e84c31aa 100644 (file)
@@ -38,5 +38,6 @@ TUPLE: ast-continue ;
 TUPLE: ast-throw e ;
 TUPLE: ast-try t e c f ;
 TUPLE: ast-return e ;
+TUPLE: ast-with expr body ;
 TUPLE: ast-case c cs ;
 TUPLE: ast-default cs ;
index 45da7c3bb45c320bbd8685e933d7206eeeceb739..7ace52815079f01f2bc354c16e25eb902623d129 100644 (file)
@@ -189,6 +189,7 @@ Stmt               =   Block
                      | "try" Block:t "catch" "(" Name:e ")" Block:c Finally:f => [[ t e c f ast-try boa ]]
                      | "return" Expr:e Sc                            => [[ e ast-return boa ]]
                      | "return" Sc                                   => [[ "undefined" ast-get boa ast-return boa ]]
+                     | "with" "(" Expr:e ")" Stmt:b                  => [[ e b ast-with boa ]]
                      | Expr:e Sc                                     => [[ e ]]
                      | ";"                                           => [[ "undefined" ast-get boa ]]
 SrcElem            =   "function" Name:n FuncRest:f                  => [[ n f ast-var boa ]]