diff options
| author | meza <meza@student.chalmers.se> | 2008-04-29 13:05:24 +0000 |
|---|---|---|
| committer | meza <meza@student.chalmers.se> | 2008-04-29 13:05:24 +0000 |
| commit | 314f147bff04c3b02e0f43b77e4b7a3f1fd9e433 (patch) | |
| tree | e4aef58509c94c4b578a1a715f550beb621c9fed /src/GF/JavaScript/PrintJS.hs | |
| parent | ba6a2b5d6ec8d22136f1a5e985a8f77e70379c2c (diff) | |
JS.cf : Changed the JS grammar to support strings as property names in objects. Changed pretty much all the files in the same folder as well as GFCCToJS.hs and SISR.hs to reflect the changes.
Diffstat (limited to 'src/GF/JavaScript/PrintJS.hs')
| -rw-r--r-- | src/GF/JavaScript/PrintJS.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/GF/JavaScript/PrintJS.hs b/src/GF/JavaScript/PrintJS.hs index 7a8ea41b2..66e78346e 100644 --- a/src/GF/JavaScript/PrintJS.hs +++ b/src/GF/JavaScript/PrintJS.hs @@ -153,11 +153,17 @@ instance Print Expr where instance Print Property where prt i e = case e of - Prop id expr -> prPrec i 0 (concatD [prt 0 id , doc (showString ":") , prt 0 expr]) + Prop propertyname expr -> prPrec i 0 (concatD [prt 0 propertyname , doc (showString ":") , prt 0 expr]) prtList es = case es of [] -> (concatD []) [x] -> (concatD [prt 0 x]) x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs]) +instance Print PropertyName where + prt i e = case e of + IdentPropName id -> prPrec i 0 (concatD [prt 0 id]) + StringPropName str -> prPrec i 0 (concatD [prt 0 str]) + + |
