about summary refs log tree commit diff
path: root/src/Syntax.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Syntax.hs')
-rw-r--r--src/Syntax.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Syntax.hs b/src/Syntax.hs
index c33f7b3..bbd8cbe 100644
--- a/src/Syntax.hs
+++ b/src/Syntax.hs
@@ -3,10 +3,11 @@ module Syntax
 
 type Idnt = String
 data Typ = TInt
-         | TRecord  [(Idnt, Typ)]
-         | TVariant [(Idnt, Typ)]
+         | TRecord  TypeDict
+         | TVariant TypeDict
          | TPtr Typ
            deriving(Eq,Show)
+type TypeDict = [(Idnt,Typ)]
 
 data Expr = Var Idnt
           | IntLit Int
@@ -16,6 +17,8 @@ data Expr = Var Idnt
           | Mult Expr Expr
           | Neg Expr
           | Deref Expr
+          | Match Expr [(Idnt, Expr)]
+          | Proj Idnt Expr 
            deriving(Eq,Show)
 data Com = Skip
          | Seq Com Com
@@ -25,6 +28,7 @@ data Com = Skip
          | Decl Idnt Expr Com
          | Alloc Idnt Expr
          | Save Idnt Expr
+         | SMatch Expr [(Idnt, Expr)]
            deriving(Eq,Show)
          
 data FuncDecl = Func Idnt [Idnt] [(Idnt,Expr)] Com Expr