summaryrefslogtreecommitdiff
path: root/src/GF/Canon/CanonToJS.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-09-19 13:49:12 +0000
committeraarne <aarne@cs.chalmers.se>2007-09-19 13:49:12 +0000
commit7825a1a1c54d6922c709bed7de3f23f049e0046e (patch)
tree9eedd42bf67ae46b8f233234064c1edce133587c /src/GF/Canon/CanonToJS.hs
parenta886f7042b2ad16fa3ef120548df9773ffafbb45 (diff)
adapted GFCC2FCFG to other uses of GFCC, made it to default parser
Diffstat (limited to 'src/GF/Canon/CanonToJS.hs')
-rw-r--r--src/GF/Canon/CanonToJS.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/GF/Canon/CanonToJS.hs b/src/GF/Canon/CanonToJS.hs
index 7e88a5ef2..beefefa04 100644
--- a/src/GF/Canon/CanonToJS.hs
+++ b/src/GF/Canon/CanonToJS.hs
@@ -53,13 +53,14 @@ 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.KS s -> new "Str" [JS.EStr s]
- C.KP ss vs -> new "Seq" (map JS.EStr ss) -- FIXME
+ C.K (C.KS s) -> new "Str" [JS.EStr s]
+ C.K (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 ss -> new "Suffix" (JS.EStr str : map JS.EStr ss)
+ C.W str (C.R r) ->
+ new "Suffix" (JS.EStr str : [JS.EStr s | C.K (C.KS s) <- r])
C.RP x y -> new "Rp" [f x, f y]
C.TM -> new "Meta" []