Generate JavaScript type annotator. Use lindef in JavaScript.

This commit is contained in:
bringert
2006-12-21 00:01:45 +00:00
parent 7cceec0802
commit 15fd1d590a
7 changed files with 73 additions and 47 deletions

View File

@@ -11,11 +11,22 @@ prCanon2js :: CanonGrammar -> String
prCanon2js gr = gfcc2js $ mkCanon2gfcc gr
gfcc2js :: C.Grammar -> String
gfcc2js (C.Grm _ _ cs) = JS.printTree $ JS.Program $ concatMap concrete2js cs
gfcc2js (C.Grm (C.Hdr n _) as cs) = JS.printTree $ JS.Program $ abstract2js n as ++ concatMap (concrete2js n) cs
concrete2js :: C.Concrete -> [JS.Element]
concrete2js (C.Cnc (C.CId c) ds) =
[JS.ElStmt $ JS.SDeclOrExpr $ JS.Decl [JS.DInit l (new "Linearizer" [])]]
abstract2js :: C.CId -> C.Abstract -> [JS.Element]
abstract2js (C.CId n) (C.Abs ds) =
[JS.ElStmt $ JS.SDeclOrExpr $ JS.Decl [JS.DInit a (new "Abstract" [])]]
++ concatMap (absdef2js a) ds
where a = JS.Ident n
absdef2js :: JS.Ident -> C.AbsDef -> [JS.Element]
absdef2js a (C.Fun (C.CId f) (C.Typ args (C.CId cat)) _) =
[JS.ElStmt $ JS.SDeclOrExpr $ JS.DExpr $ JS.ECall (JS.EMember (JS.EVar a) (JS.Ident "addType"))
[JS.EStr f, JS.EArray [JS.EStr x | C.CId x <- args], JS.EStr cat]]
concrete2js :: C.CId -> C.Concrete -> [JS.Element]
concrete2js (C.CId a) (C.Cnc (C.CId c) ds) =
[JS.ElStmt $ JS.SDeclOrExpr $ JS.Decl [JS.DInit l (new "Concrete" [JS.EVar (JS.Ident a)])]]
++ concatMap (cncdef2js l) ds
where l = JS.Ident c

View File

@@ -44,6 +44,7 @@ data Expr =
| ENull
| EThis
| EFun [Ident] [Stmt]
| EArray [Expr]
| ESeq [Expr]
deriving (Eq,Ord,Show)

View File

@@ -38,6 +38,7 @@ EFalse. Expr16 ::= "false" ;
ENull. Expr16 ::= "null" ;
EThis. Expr16 ::= "this" ;
EFun. Expr16 ::= "function" "(" [Ident] ")" "{" [Stmt] "}" ;
EArray. Expr16 ::= "[" [Expr] "]" ;
eseq1. Expr16 ::= "(" Expr "," [Expr] ")";
internal ESeq. Expr16 ::= "(" [Expr] ")" ;

View File

@@ -212,21 +212,21 @@ happyOutTok x = unsafeCoerce# x
{-# INLINE happyOutTok #-}
happyActOffsets :: HappyAddr
happyActOffsets = HappyA# "\x00\x00\x76\x00\x00\x00\x70\x00\x78\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9d\x00\x00\x00\x9a\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9c\x01\x00\x00\x00\x00\x11\x00\x73\x00\x00\x00\x8e\x01\x00\x00\x00\x00\x73\x00\x00\x00\x00\x00\x00\x00\x99\x00\x82\x00\x00\x00\x7f\x00\x00\x00\x83\x00\x81\x00\x69\x00\x56\x00\x62\x01\x05\x00\x9c\x01\x56\x00\x9c\x01\x9c\x01\x00\x00\x00\x00\x59\x00\x00\x00\x66\x00\x7e\x00\x00\x00\x9c\x01\x00\x00\x00\x00\x7c\x00\x65\x00\x35\x00\x9c\x01\x00\x00\x35\x00\x9c\x01\x00\x00\x00\x00\x64\x00\x63\x00\x61\x00\x34\x00\x60\x00\x9c\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x46\x00\x00\x00\x00\x00\x4c\x01\x00\x00\x36\x01\x00\x00\x00\x00"#
happyActOffsets = HappyA# "\x00\x00\x91\x00\x00\x00\x8a\x00\x97\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9d\x00\x00\x00\x9a\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbb\x01\x00\x00\xbb\x01\x00\x00\x11\x00\x75\x00\x00\x00\xad\x01\x00\x00\x00\x00\x75\x00\x00\x00\x00\x00\x00\x00\x82\x00\x9b\x00\x00\x00\x81\x00\x00\x00\x85\x00\x84\x00\x83\x00\x57\x00\x78\x00\x7e\x00\x81\x01\x05\x00\xbb\x01\x56\x00\xbb\x01\xbb\x01\x00\x00\x00\x00\x59\x00\x00\x00\x66\x00\x00\x00\xbb\x01\x00\x00\x00\x00\xbb\x01\x00\x00\x7c\x00\x65\x00\x35\x00\xbb\x01\x00\x00\x35\x00\xbb\x01\x00\x00\x00\x00\x64\x00\x63\x00\x61\x00\x34\x00\x00\x00\x60\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x46\x00\x00\x00\x00\x00\x6b\x01\x00\x00\x55\x01\x00\x00\x00\x00"#
happyGotoOffsets :: HappyAddr
happyGotoOffsets = HappyA# "\x23\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x01\x3d\x00\x00\x00\x45\x00\x31\x00\x00\x00\xf9\x00\x00\x00\x00\x00\xbb\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x44\x00\x20\x00\x00\x00\x9c\x00\x2b\x00\xda\x00\xb3\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x43\x00\x5e\x00\x00\x00\xae\x01\xbb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x25\x00\x00\x00\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x00\x00\x00\x00\xff\xff\x20\x00\x00\x00\x20\x00\x00\x00\x00\x00"#
happyGotoOffsets = HappyA# "\x23\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x37\x01\x3d\x00\xbb\x00\x00\x00\x45\x00\x31\x00\x00\x00\x18\x01\x00\x00\x00\x00\xda\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x44\x00\x00\x00\x00\x00\x20\x00\x00\x00\x9c\x00\x2b\x00\xf9\x00\xd2\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7d\x00\x00\x00\x00\x00\x5e\x00\x00\x00\x00\x00\x00\x00\x43\x00\x3f\x00\x00\x00\xcd\x01\xda\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x25\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x00\x00\x00\x00\xff\xff\x20\x00\x00\x00\x20\x00\x00\x00\x00\x00"#
happyDefActions :: HappyAddr
happyDefActions = HappyA# "\xf7\xff\x00\x00\xfe\xff\x00\x00\xfa\xff\xdd\xff\xdc\xff\xdb\xff\xda\xff\xf6\xff\xf8\xff\x00\x00\xc3\xff\xe4\xff\xe2\xff\xde\xff\xeb\xff\xcf\xff\xce\xff\xcd\xff\xcc\xff\xcb\xff\xca\xff\xc9\xff\xc8\xff\xc7\xff\xc6\xff\xc5\xff\xc4\xff\x00\x00\xee\xff\xd8\xff\x00\x00\x00\x00\xd7\xff\x00\x00\xd6\xff\xd9\xff\xe8\xff\xfd\xff\xfc\xff\xfb\xff\xea\xff\xe7\xff\xec\xff\x00\x00\xf1\xff\x00\x00\x00\x00\x00\x00\xf5\xff\x00\x00\x00\x00\xd2\xff\x00\x00\x00\x00\x00\x00\xef\xff\xe5\xff\x00\x00\xe1\xff\x00\x00\xd1\xff\xd3\xff\xd2\xff\xed\xff\xf2\xff\xf4\xff\x00\x00\xf5\xff\xd2\xff\xf0\xff\xe8\xff\x00\x00\xe9\xff\xe6\xff\x00\x00\x00\x00\x00\x00\xf5\xff\x00\x00\xd2\xff\xdf\xff\xe0\xff\xd0\xff\xd4\xff\xf3\xff\xee\xff\x00\x00\xe3\xff\xee\xff\x00\x00\xd5\xff\x00\x00\xf9\xff"#
happyDefActions = HappyA# "\xf7\xff\x00\x00\xfe\xff\x00\x00\xfa\xff\xdd\xff\xdc\xff\xdb\xff\xda\xff\xf6\xff\xf8\xff\x00\x00\xc2\xff\xe4\xff\xe2\xff\xde\xff\xeb\xff\xce\xff\xcd\xff\xcc\xff\xcb\xff\xca\xff\xc9\xff\xc8\xff\xc7\xff\xc6\xff\xc5\xff\xc4\xff\xc3\xff\x00\x00\xee\xff\xd1\xff\xd8\xff\x00\x00\x00\x00\xd7\xff\x00\x00\xd6\xff\xd9\xff\xe8\xff\xfd\xff\xfc\xff\xfb\xff\xea\xff\xe7\xff\xec\xff\x00\x00\xf1\xff\x00\x00\x00\x00\x00\x00\xf5\xff\x00\x00\xd0\xff\x00\x00\x00\x00\xd1\xff\x00\x00\x00\x00\x00\x00\xef\xff\xe5\xff\x00\x00\xe1\xff\x00\x00\xd2\xff\xd1\xff\xed\xff\xf2\xff\xd1\xff\xd4\xff\xf4\xff\x00\x00\xf5\xff\xd1\xff\xf0\xff\xe8\xff\x00\x00\xe9\xff\xe6\xff\x00\x00\x00\x00\x00\x00\xf5\xff\xcf\xff\x00\x00\xdf\xff\xe0\xff\xd3\xff\xf3\xff\xee\xff\x00\x00\xe3\xff\xee\xff\x00\x00\xd5\xff\x00\x00\xf9\xff"#
happyCheck :: HappyAddr
happyCheck = HappyA# "\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x01\x00\x05\x00\x02\x00\x09\x00\x08\x00\x05\x00\x0a\x00\x08\x00\x09\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x01\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x13\x00\x00\x00\x09\x00\x04\x00\x08\x00\x06\x00\x0a\x00\x00\x00\x07\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x00\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x00\x00\x00\x00\x00\x00\x09\x00\x13\x00\x13\x00\x03\x00\x07\x00\x07\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x02\x00\x0a\x00\x03\x00\x02\x00\x02\x00\x02\x00\x02\x00\x13\x00\x01\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x05\x00\x01\x00\x05\x00\x01\x00\x06\x00\x13\x00\x05\x00\x18\x00\x13\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x07\x00\x07\x00\xff\xff\x06\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x01\x00\xff\xff\x03\x00\x04\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x01\x00\xff\xff\x03\x00\x04\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x01\x00\xff\xff\x03\x00\x04\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x01\x00\xff\xff\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x01\x00\xff\xff\xff\xff\xff\xff\xff\xff\x06\x00\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x01\x00\x10\x00\x11\x00\xff\xff\x13\x00\x14\x00\x15\x00\x16\x00\xff\xff\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\xff\xff\x10\x00\x11\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x0b\x00\x0c\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\xff\xff\x0b\x00\x0c\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
happyCheck = HappyA# "\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x01\x00\x05\x00\x02\x00\x09\x00\x08\x00\x05\x00\x0a\x00\x08\x00\x09\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x01\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x13\x00\x00\x00\x09\x00\x04\x00\x08\x00\x06\x00\x0a\x00\x00\x00\x07\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x00\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x00\x00\x00\x00\x00\x00\x09\x00\x13\x00\x13\x00\x03\x00\x07\x00\x07\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x02\x00\x0a\x00\x03\x00\x02\x00\x02\x00\x02\x00\x02\x00\x13\x00\x13\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x05\x00\x0a\x00\x05\x00\x01\x00\x01\x00\x01\x00\x06\x00\x13\x00\x07\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x05\x00\x07\x00\x18\x00\x06\x00\x13\x00\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x01\x00\xff\xff\x03\x00\x04\x00\xff\xff\xff\xff\xff\xff\xff\xff\x09\x00\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x01\x00\xff\xff\x03\x00\x04\x00\xff\xff\xff\xff\xff\xff\xff\xff\x09\x00\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x01\x00\xff\xff\x03\x00\x04\x00\xff\xff\xff\xff\xff\xff\xff\xff\x09\x00\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x01\x00\xff\xff\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x09\x00\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x01\x00\xff\xff\xff\xff\xff\xff\xff\xff\x06\x00\xff\xff\xff\xff\x09\x00\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x01\x00\x10\x00\x11\x00\xff\xff\x13\x00\x14\x00\x15\x00\x16\x00\x09\x00\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\xff\xff\x10\x00\x11\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x0b\x00\x0c\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\xff\xff\x0b\x00\x0c\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
happyTable :: HappyAddr
happyTable = HappyA# "\x00\x00\x05\x00\x06\x00\x07\x00\x08\x00\x36\x00\x09\x00\x40\x00\x5d\x00\x0a\x00\x41\x00\x0b\x00\x37\x00\x38\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x33\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x03\x00\x43\x00\x5b\x00\x03\x00\x41\x00\x04\x00\x0b\x00\x3c\x00\x56\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x30\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x43\x00\x43\x00\x31\x00\x33\x00\x03\x00\x03\x00\x5b\x00\x4d\x00\x44\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x54\x00\x3e\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x56\x00\x54\x00\x58\x00\x59\x00\x5a\x00\x4f\x00\x53\x00\x03\x00\x46\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x4c\x00\x3e\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x50\x00\x47\x00\x52\x00\x33\x00\x48\x00\x03\x00\x49\x00\xff\xff\x03\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x50\x00\x3e\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x4a\x00\x39\x00\x00\x00\x3a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x3d\x00\x3e\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x4a\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x3b\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x2d\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x34\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1e\x00\x00\x00\x1f\x00\x5f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x30\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x03\x00\x28\x00\x29\x00\x2a\x00\x1e\x00\x00\x00\x1f\x00\x5d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x30\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x03\x00\x28\x00\x29\x00\x2a\x00\x1e\x00\x00\x00\x1f\x00\x43\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x30\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x03\x00\x28\x00\x29\x00\x2a\x00\x1e\x00\x00\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x03\x00\x28\x00\x29\x00\x2a\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x30\x00\x22\x00\x23\x00\x1e\x00\x25\x00\x26\x00\x00\x00\x03\x00\x28\x00\x29\x00\x2a\x00\x00\x00\x00\x00\x20\x00\x30\x00\x22\x00\x23\x00\x00\x00\x25\x00\x26\x00\x2a\x00\x03\x00\x28\x00\x29\x00\x2a\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x2b\x00\x4b\x00\x2a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3a\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x00\x00\x2b\x00\x2c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
happyTable = HappyA# "\x00\x00\x05\x00\x06\x00\x07\x00\x08\x00\x39\x00\x09\x00\x42\x00\x60\x00\x0a\x00\x43\x00\x0b\x00\x3a\x00\x3b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x34\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x03\x00\x47\x00\x5e\x00\x03\x00\x43\x00\x04\x00\x0b\x00\x3f\x00\x59\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x31\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x47\x00\x47\x00\x32\x00\x36\x00\x03\x00\x03\x00\x5e\x00\x51\x00\x48\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x50\x00\x35\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x59\x00\x58\x00\x5b\x00\x5c\x00\x5d\x00\x53\x00\x57\x00\x03\x00\x03\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x54\x00\x35\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x54\x00\x47\x00\x46\x00\x4a\x00\x4b\x00\x34\x00\x4c\x00\x03\x00\x4e\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x55\x00\x35\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x4d\x00\x3c\x00\xff\xff\x3d\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x40\x00\x35\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x34\x00\x35\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x4e\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x3e\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x2e\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x37\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1e\x00\x00\x00\x1f\x00\x62\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x21\x00\x31\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x03\x00\x29\x00\x2a\x00\x2b\x00\x1e\x00\x00\x00\x1f\x00\x60\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x21\x00\x31\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x03\x00\x29\x00\x2a\x00\x2b\x00\x1e\x00\x00\x00\x1f\x00\x45\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x21\x00\x31\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x03\x00\x29\x00\x2a\x00\x2b\x00\x1e\x00\x00\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x03\x00\x29\x00\x2a\x00\x2b\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x30\x00\x00\x00\x00\x00\x20\x00\x00\x00\x21\x00\x31\x00\x23\x00\x24\x00\x1e\x00\x26\x00\x27\x00\x00\x00\x03\x00\x29\x00\x2a\x00\x2b\x00\x20\x00\x00\x00\x21\x00\x31\x00\x23\x00\x24\x00\x00\x00\x26\x00\x27\x00\x2b\x00\x03\x00\x29\x00\x2a\x00\x2b\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x2c\x00\x4f\x00\x2b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3d\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
happyReduceArr = array (1, 60) [
happyReduceArr = array (1, 61) [
(1 , happyReduce_1),
(2 , happyReduce_2),
(3 , happyReduce_3),
@@ -286,7 +286,8 @@ happyReduceArr = array (1, 60) [
(57 , happyReduce_57),
(58 , happyReduce_58),
(59 , happyReduce_59),
(60 , happyReduce_60)
(60 , happyReduce_60),
(61 , happyReduce_61)
]
happy_n_terms = 25 :: Int
@@ -633,8 +634,17 @@ happyReduction_42 (happy_x_7 `HappyStk`
(EFun happy_var_3 (reverse happy_var_6)
) `HappyStk` happyRest}}
happyReduce_43 = happyReduce 5# 16# happyReduction_43
happyReduction_43 (happy_x_5 `HappyStk`
happyReduce_43 = happySpecReduce_3 16# happyReduction_43
happyReduction_43 happy_x_3
happy_x_2
happy_x_1
= case happyOut21 happy_x_2 of { happy_var_2 ->
happyIn20
(EArray happy_var_2
)}
happyReduce_44 = happyReduce 5# 16# happyReduction_44
happyReduction_44 (happy_x_5 `HappyStk`
happy_x_4 `HappyStk`
happy_x_3 `HappyStk`
happy_x_2 `HappyStk`
@@ -646,8 +656,8 @@ happyReduction_43 (happy_x_5 `HappyStk`
(eseq1_ happy_var_2 happy_var_4
) `HappyStk` happyRest}}
happyReduce_44 = happySpecReduce_3 16# happyReduction_44
happyReduction_44 happy_x_3
happyReduce_45 = happySpecReduce_3 16# happyReduction_45
happyReduction_45 happy_x_3
happy_x_2
happy_x_1
= case happyOut22 happy_x_2 of { happy_var_2 ->
@@ -655,20 +665,20 @@ happyReduction_44 happy_x_3
(happy_var_2
)}
happyReduce_45 = happySpecReduce_0 17# happyReduction_45
happyReduction_45 = happyIn21
happyReduce_46 = happySpecReduce_0 17# happyReduction_46
happyReduction_46 = happyIn21
([]
)
happyReduce_46 = happySpecReduce_1 17# happyReduction_46
happyReduction_46 happy_x_1
happyReduce_47 = happySpecReduce_1 17# happyReduction_47
happyReduction_47 happy_x_1
= case happyOut22 happy_x_1 of { happy_var_1 ->
happyIn21
((:[]) happy_var_1
)}
happyReduce_47 = happySpecReduce_3 17# happyReduction_47
happyReduction_47 happy_x_3
happyReduce_48 = happySpecReduce_3 17# happyReduction_48
happyReduction_48 happy_x_3
happy_x_2
happy_x_1
= case happyOut22 happy_x_1 of { happy_var_1 ->
@@ -677,92 +687,92 @@ happyReduction_47 happy_x_3
((:) happy_var_1 happy_var_3
)}}
happyReduce_48 = happySpecReduce_1 18# happyReduction_48
happyReduction_48 happy_x_1
happyReduce_49 = happySpecReduce_1 18# happyReduction_49
happyReduction_49 happy_x_1
= case happyOut23 happy_x_1 of { happy_var_1 ->
happyIn22
(happy_var_1
)}
happyReduce_49 = happySpecReduce_1 19# happyReduction_49
happyReduction_49 happy_x_1
happyReduce_50 = happySpecReduce_1 19# happyReduction_50
happyReduction_50 happy_x_1
= case happyOut24 happy_x_1 of { happy_var_1 ->
happyIn23
(happy_var_1
)}
happyReduce_50 = happySpecReduce_1 20# happyReduction_50
happyReduction_50 happy_x_1
happyReduce_51 = happySpecReduce_1 20# happyReduction_51
happyReduction_51 happy_x_1
= case happyOut25 happy_x_1 of { happy_var_1 ->
happyIn24
(happy_var_1
)}
happyReduce_51 = happySpecReduce_1 21# happyReduction_51
happyReduction_51 happy_x_1
happyReduce_52 = happySpecReduce_1 21# happyReduction_52
happyReduction_52 happy_x_1
= case happyOut26 happy_x_1 of { happy_var_1 ->
happyIn25
(happy_var_1
)}
happyReduce_52 = happySpecReduce_1 22# happyReduction_52
happyReduction_52 happy_x_1
happyReduce_53 = happySpecReduce_1 22# happyReduction_53
happyReduction_53 happy_x_1
= case happyOut27 happy_x_1 of { happy_var_1 ->
happyIn26
(happy_var_1
)}
happyReduce_53 = happySpecReduce_1 23# happyReduction_53
happyReduction_53 happy_x_1
happyReduce_54 = happySpecReduce_1 23# happyReduction_54
happyReduction_54 happy_x_1
= case happyOut28 happy_x_1 of { happy_var_1 ->
happyIn27
(happy_var_1
)}
happyReduce_54 = happySpecReduce_1 24# happyReduction_54
happyReduction_54 happy_x_1
happyReduce_55 = happySpecReduce_1 24# happyReduction_55
happyReduction_55 happy_x_1
= case happyOut29 happy_x_1 of { happy_var_1 ->
happyIn28
(happy_var_1
)}
happyReduce_55 = happySpecReduce_1 25# happyReduction_55
happyReduction_55 happy_x_1
happyReduce_56 = happySpecReduce_1 25# happyReduction_56
happyReduction_56 happy_x_1
= case happyOut30 happy_x_1 of { happy_var_1 ->
happyIn29
(happy_var_1
)}
happyReduce_56 = happySpecReduce_1 26# happyReduction_56
happyReduction_56 happy_x_1
happyReduce_57 = happySpecReduce_1 26# happyReduction_57
happyReduction_57 happy_x_1
= case happyOut31 happy_x_1 of { happy_var_1 ->
happyIn30
(happy_var_1
)}
happyReduce_57 = happySpecReduce_1 27# happyReduction_57
happyReduction_57 happy_x_1
happyReduce_58 = happySpecReduce_1 27# happyReduction_58
happyReduction_58 happy_x_1
= case happyOut32 happy_x_1 of { happy_var_1 ->
happyIn31
(happy_var_1
)}
happyReduce_58 = happySpecReduce_1 28# happyReduction_58
happyReduction_58 happy_x_1
happyReduce_59 = happySpecReduce_1 28# happyReduction_59
happyReduction_59 happy_x_1
= case happyOut33 happy_x_1 of { happy_var_1 ->
happyIn32
(happy_var_1
)}
happyReduce_59 = happySpecReduce_1 29# happyReduction_59
happyReduction_59 happy_x_1
happyReduce_60 = happySpecReduce_1 29# happyReduction_60
happyReduction_60 happy_x_1
= case happyOut34 happy_x_1 of { happy_var_1 ->
happyIn33
(happy_var_1
)}
happyReduce_60 = happySpecReduce_1 30# happyReduction_60
happyReduction_60 happy_x_1
happyReduce_61 = happySpecReduce_1 30# happyReduction_61
happyReduction_61 happy_x_1
= case happyOut17 happy_x_1 of { happy_var_1 ->
happyIn34
(happy_var_1

View File

@@ -122,6 +122,7 @@ Expr16 : Ident { EVar $1 }
| 'null' { ENull }
| 'this' { EThis }
| 'function' '(' ListIdent ')' '{' ListStmt '}' { EFun $3 (reverse $6) }
| '[' ListExpr ']' { EArray $2 }
| '(' Expr ',' ListExpr ')' { eseq1_ $2 $4 }
| '(' Expr ')' { $2 }

View File

@@ -145,6 +145,7 @@ instance Print Expr where
ENull -> prPrec i 16 (concatD [doc (showString "null")])
EThis -> prPrec i 16 (concatD [doc (showString "this")])
EFun ids stmts -> prPrec i 16 (concatD [doc (showString "function") , doc (showString "(") , prt 0 ids , doc (showString ")") , doc (showString "{") , prt 0 stmts , doc (showString "}")])
EArray exprs -> prPrec i 16 (concatD [doc (showString "[") , prt 0 exprs , doc (showString "]")])
ESeq exprs -> prPrec i 16 (concatD [doc (showString "(") , prt 0 exprs , doc (showString ")")])
prtList es = case es of

View File

@@ -61,6 +61,7 @@ transExpr x = case x of
ENull -> failure x
EThis -> failure x
EFun ids stmts -> failure x
EArray exprs -> failure x
ESeq exprs -> failure x