diff options
| author | bringert <bringert@cs.chalmers.se> | 2006-12-21 16:48:46 +0000 |
|---|---|---|
| committer | bringert <bringert@cs.chalmers.se> | 2006-12-21 16:48:46 +0000 |
| commit | a335b29c0a85ea81ee1017f18dd6f2595d2a5227 (patch) | |
| tree | e0b4d7356c3bf5cb82e9d7e11ff9e4d3e5f4e764 /src/GF/JavaScript/ParJS.y | |
| parent | 51df5b8a8d562a3ac4b280b37e7ab04279e22d04 (diff) | |
Meta variables are now treated as functions with name ? in SISR, VoiceXML and JavaScript linearization. VoiceXML now returns the partial result when update() is false.
Diffstat (limited to 'src/GF/JavaScript/ParJS.y')
| -rw-r--r-- | src/GF/JavaScript/ParJS.y | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/GF/JavaScript/ParJS.y b/src/GF/JavaScript/ParJS.y index 58be324ac..21d1468b6 100644 --- a/src/GF/JavaScript/ParJS.y +++ b/src/GF/JavaScript/ParJS.y @@ -24,6 +24,7 @@ import GF.JavaScript.ErrM '.' { PT _ (TS ".") } '[' { PT _ (TS "[") } ']' { PT _ (TS "]") } + ':' { PT _ (TS ":") } 'false' { PT _ (TS "false") } 'function' { PT _ (TS "function") } 'new' { PT _ (TS "new") } @@ -81,7 +82,7 @@ ListStmt : {- empty -} { [] } DeclOrExpr :: { DeclOrExpr } DeclOrExpr : 'var' ListDeclVar { Decl $2 } - | Expr { DExpr $1 } + | Expr1 { DExpr $1 } DeclVar :: { DeclVar } @@ -123,6 +124,7 @@ Expr16 : Ident { EVar $1 } | 'this' { EThis } | 'function' '(' ListIdent ')' '{' ListStmt '}' { EFun $3 (reverse $6) } | '[' ListExpr ']' { EArray $2 } + | '{' ListProperty '}' { EObj $2 } | '(' Expr ',' ListExpr ')' { eseq1_ $2 $4 } | '(' Expr ')' { $2 } @@ -185,6 +187,16 @@ Expr12 :: { Expr } Expr12 : Expr13 { $1 } +Property :: { Property } +Property : Ident ':' Expr { Prop $1 $3 } + + +ListProperty :: { [Property] } +ListProperty : {- empty -} { [] } + | Property { (:[]) $1 } + | Property ',' ListProperty { (:) $1 $3 } + + { |
