Commit 3638e0ef authored by Tadej Borovšak's avatar Tadej Borovšak
Browse files

Make AST types comparable

This makes it possible to write unit tests for parser.
parent 7a19bf92
...@@ -7,13 +7,13 @@ data AExp = ...@@ -7,13 +7,13 @@ data AExp =
Loc String | Loc String |
Num Integer | Num Integer |
AOp (String, AExp, AExp) AOp (String, AExp, AExp)
deriving Show deriving (Show, Eq)
-- boolean expressions -- boolean expressions
data BExp = data BExp =
Boolean Bool | Boolean Bool |
BOp (String, AExp, AExp) BOp (String, AExp, AExp)
deriving Show deriving (Show, Eq)
-- commands -- commands
data Com = data Com =
...@@ -22,4 +22,4 @@ data Com = ...@@ -22,4 +22,4 @@ data Com =
Seq (Com, Com) | Seq (Com, Com) |
Skip | Skip |
While (BExp, Com) While (BExp, Com)
deriving Show deriving (Show, Eq)
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