blob: bb7e0de9f20b35af849b1fda49b7223e1c6fb30b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
module LTypes where
import Utils
data LWord
= LSymbol String
| LInteger Integer
| LFloat Double
| LBool Bool
| LChar Char
| LLabel String
| LStringLitRef String
| LPhrase [LWord]
deriving (Show, Eq)
reprWord :: LWord -> String
reprWord (LSymbol a) = a
reprWord (LInteger a) = show a
reprWord (LFloat a) = show a
reprWord (LBool a) = show a
reprWord (LChar a) = show a
reprWord (LLabel a) = a
reprWord (LStringLitRef a) = "StrLit(" ++ a ++ ")"
reprWord (LPhrase a) = "P[ " ++ map reprWord a $> unwords ++ " ]"
|