diff options
| author | kr_angelov <kr_angelov@gmail.com> | 2006-12-28 16:35:16 +0000 |
|---|---|---|
| committer | kr_angelov <kr_angelov@gmail.com> | 2006-12-28 16:35:16 +0000 |
| commit | 48b4e3de1dd02a9956a7a051ea5c44fb24b6130a (patch) | |
| tree | 292dd64ddffd9feb9f0eef12c0f72eb56a5171cf /src/GF/Canon/CanonToJS.hs | |
| parent | 46c8026b9d7e5f6d061b7dd340bfeb4a012b07c8 (diff) | |
simplify GFCC syntax
Diffstat (limited to 'src/GF/Canon/CanonToJS.hs')
| -rw-r--r-- | src/GF/Canon/CanonToJS.hs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/GF/Canon/CanonToJS.hs b/src/GF/Canon/CanonToJS.hs index bcd64e282..7e88a5ef2 100644 --- a/src/GF/Canon/CanonToJS.hs +++ b/src/GF/Canon/CanonToJS.hs @@ -53,22 +53,19 @@ term2js l t = f t C.R xs -> new "Arr" (map f xs) C.P x y -> JS.ECall (JS.EMember (f x) (JS.Ident "sel")) [f y] C.S xs -> new "Seq" (map f xs) - C.K t -> tokn2js t + C.KS s -> new "Str" [JS.EStr s] + C.KP ss vs -> new "Seq" (map JS.EStr ss) -- FIXME C.V i -> JS.EIndex (JS.EVar children) (JS.EInt i) C.C i -> new "Int" [JS.EInt i] C.F (C.CId f) -> JS.ECall (JS.EMember (JS.EVar l) (JS.Ident "rule")) [JS.EStr f, JS.EVar children] C.FV xs -> new "Variants" (map f xs) - C.W str x -> new "Suffix" [JS.EStr str, f x] + C.W str ss -> new "Suffix" (JS.EStr str : map JS.EStr ss) C.RP x y -> new "Rp" [f x, f y] C.TM -> new "Meta" [] argIdent :: Integer -> JS.Ident argIdent n = JS.Ident ("x" ++ show n) -tokn2js :: C.Tokn -> JS.Expr -tokn2js (C.KS s) = new "Str" [JS.EStr s] -tokn2js (C.KP ss vs) = new "Seq" (map JS.EStr ss) -- FIXME - children :: JS.Ident children = JS.Ident "cs" |
