nonExist now does the expected thing

This commit is contained in:
kr.angelov
2013-08-23 13:17:45 +00:00
parent 7c98267193
commit a20cd77d25
13 changed files with 70 additions and 15 deletions

View File

@@ -152,6 +152,7 @@ instance Binary Symbol where
put (SymVar n l) = putWord8 2 >> put (n,l)
put (SymKS ts) = putWord8 3 >> put ts
put (SymKP d vs) = putWord8 4 >> put (d,vs)
put SymNE = putWord8 5
get = do tag <- getWord8
case tag of
0 -> liftM2 SymCat get get
@@ -159,6 +160,7 @@ instance Binary Symbol where
2 -> liftM2 SymVar get get
3 -> liftM SymKS get
4 -> liftM2 (\d vs -> SymKP d vs) get get
5 -> return SymNE
_ -> decodingError
instance Binary PArg where

View File

@@ -60,6 +60,7 @@ data Symbol
| SymVar {-# UNPACK #-} !Int {-# UNPACK #-} !Int
| SymKS [Token]
| SymKP [Token] [Alternative]
| SymNE -- non exist
deriving (Eq,Ord,Show)
data Production
= PApply {-# UNPACK #-} !FunId [PArg]