Commit 9f1d376c authored by Camil Staps's avatar Camil Staps 🐧

saplcg: more predefined constructors

parent fa1128fe
...@@ -37,13 +37,25 @@ defaultParserState :: ParserState ...@@ -37,13 +37,25 @@ defaultParserState :: ParserState
defaultParserState = defaultParserState =
{ ps_level = 0 { ps_level = 0
, ps_constructors = fromList , ps_constructors = fromList
[ ("_predefined._Nil", {index=0,nr_cons=2,nr_args=0,args=[]}) [ ("_predefined._Unit", {index=0,nr_cons=1,nr_args=0,args=[]})
, ("_predefined._Cons", {index=1,nr_cons=2,nr_args=2,args=[TypedVar (NormalVar "x" 0) NoType, TypedVar (NormalVar "xs" 0) NoType]}) , ("_predefined._Nil", nil)
, ("_predefined._|Nil", nil)
, ("_predefined._!Nil", nil)
, ("_predefined._Nil!", nil)
, ("_predefined._!Nil!", nil)
, ("_predefined._Cons", cons)
, ("_predefined._|Cons", cons)
, ("_predefined._!Cons", cons)
, ("_predefined._Cons!", cons)
, ("_predefined._!Cons!", cons)
] ]
, ps_functions = newMap , ps_functions = newMap
, ps_CAFs = newMap , ps_CAFs = newMap
, ps_genFuns = [] , ps_genFuns = []
} }
where
nil = {index=0,nr_cons=2,nr_args=0,args=[]}
cons = {index=1,nr_cons=2,nr_args=2,args=[TypedVar (NormalVar "x" 0) NoType, TypedVar (NormalVar "xs" 0) NoType]}
Start w Start w
# ([prog:args],w) = getCommandLine w # ([prog:args],w) = getCommandLine w
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment