non flat parsers
[clean-tests.git] / gengen / test.icl
index 122b099..e0e46ef 100644 (file)
@@ -15,7 +15,7 @@ import Data.GenType
 import Data.GenType.CType
 import Data.GenType.CParser
 
-derive gType Either, T, R, Frac, Tr, Fix, Odd, Even, SR, List, Enum, NT, Blurp, EnumList, ER, CP
+derive gType Either, T, R, Frac, Tr, Fix, Odd, Even, SR, List, Enum, NT, Blurp, EnumList, ER, CP, RA, Nest
 
 :: T a = T2 a Char
 :: NT =: NT Int
@@ -24,7 +24,7 @@ derive gType Either, T, R, Frac, Tr, Fix, Odd, Even, SR, List, Enum, NT, Blurp,
        f5 :: [([#Int], [#Int!], [!Int!], [!Int], [Int!])],
        f6 :: ({!Int}, {R Bool}, {#Char}, {32#Int}),/*({!Int}, {#Char}, {R Bool})*/
        f7 :: {!Int}}
-:: Tr m b= Tr (m Int b)
+:: Tr m b= Tr (m Int b) | TrBork
 :: Frac a = (/.) infixl 7 a a  | Flurp
 :: Fix f = Fix (f (Fix f))
 
@@ -34,7 +34,8 @@ derive gType Either, T, R, Frac, Tr, Fix, Odd, Even, SR, List, Enum, NT, Blurp,
 
 :: EnumList = ECons Enum EnumList | ENil
 
-:: ER = {nat :: T Int, bool :: Bool}
+:: ER = {nat :: Int, bool :: Bool}
+:: RA a = {a1 :: a, a2 :: Int}
 
 :: CP = CLeft Int Bool | CRight Char Char
 
@@ -50,6 +51,7 @@ Start =
        ( flatTypedef $ gTypeToType $ unBox t
        , typedefs $ map (map gTypeToType) $ map (filter (not o isBasic)) $ flattenGType $ unBox t
        , flatParser $ gTypeToType $ unBox t
+       , parsers $ map (map gTypeToType) $ map (filter (not o isBasic)) $ flattenGType $ unBox t
        )
 
 //Start = typedefs //$ (\x->[[gTypeToType x]])
@@ -60,11 +62,12 @@ Start =
 //     $ flattenGType
 //     $ unBox t
 
+:: Nest m = Nest (m (m (m Int))) | NestBlurp
 
 //t :: Box GType (?# Int)
 //t :: Box GType (Maybe [Maybe (Either Bool String)])
 //t :: Box GType ([SR], Enum, T Int, NT, Blurp Int)
 //t :: Box GType [EnumList]
-t :: Box GType (Either (Int, Char) (?CP))
+t :: Box GType (Nest ?, Tr Either (?(Int, Enum)))
 //t :: Box GType (Odd Int, (), [Either (R (T *World)) (Frac Real)], Tr Either Bool, Fix Maybe)
 t = gType{|*|}