diff options
| author | krasimir <krasimir@chalmers.se> | 2009-12-14 10:54:22 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2009-12-14 10:54:22 +0000 |
| commit | c036459214852ca01868f5da81408f49b22a49e9 (patch) | |
| tree | 72a767680911cba272a033b07fc750c0d4f1d0d3 /src/compiler/GF/Compile/PGFtoJS.hs | |
| parent | faa638d6fc5dbc47d5e3ef3d4da42449005c3a0d (diff) | |
remove the old parsing code and the -erasing=on flag
Diffstat (limited to 'src/compiler/GF/Compile/PGFtoJS.hs')
| -rw-r--r-- | src/compiler/GF/Compile/PGFtoJS.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/GF/Compile/PGFtoJS.hs b/src/compiler/GF/Compile/PGFtoJS.hs index ff75d8fe6..01be44e8c 100644 --- a/src/compiler/GF/Compile/PGFtoJS.hs +++ b/src/compiler/GF/Compile/PGFtoJS.hs @@ -96,13 +96,14 @@ parser2js p = [new "Parser" [JS.EObj $ [JS.Prop (JS.IntPropName cat) (JS.EArray JS.EObj $ map cats (Map.assocs (startCats p)), JS.EInt (totalCats p)]] where - cats (c,is) = JS.Prop (JS.IdentPropName (JS.Ident (showCId c))) (JS.EArray (map JS.EInt is)) + cats (c,(start,end)) = JS.Prop (JS.IdentPropName (JS.Ident (showCId c))) (JS.EObj [JS.Prop (JS.IdentPropName (JS.Ident "s")) (JS.EInt start) + ,JS.Prop (JS.IdentPropName (JS.Ident "e")) (JS.EInt end)]) frule2js :: Production -> JS.Expr frule2js (FApply funid args) = new "Rule" [JS.EInt funid, JS.EArray (map JS.EInt args)] frule2js (FCoerce arg) = new "Coerce" [JS.EInt arg] -ffun2js (FFun f _ lins) = new "FFun" [JS.EStr (showCId f), JS.EArray (map JS.EInt (Array.elems lins))] +ffun2js (FFun f lins) = new "FFun" [JS.EStr (showCId f), JS.EArray (map JS.EInt (Array.elems lins))] seq2js :: Array.Array FIndex FSymbol -> JS.Expr seq2js seq = JS.EArray [sym2js s | s <- Array.elems seq] |
