From 69276220df02d2c226021d79ee4a4fd173ae85ee Mon Sep 17 00:00:00 2001 From: Matthew Hall Date: Sat, 18 Feb 2023 00:11:29 +1300 Subject: String literals, fizzbuzz, other tweaks --- DSL/Types.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'DSL/Types.hs') diff --git a/DSL/Types.hs b/DSL/Types.hs index 8d59a06..bb1f862 100644 --- a/DSL/Types.hs +++ b/DSL/Types.hs @@ -5,12 +5,14 @@ import DSL.BaseParsers (Parser(..)) data StackData = StackInt Integer | StackBool Bool + | StackString String deriving (Eq) instance Show StackData where show (StackInt x) = show x show (StackBool True) = "true" show (StackBool False) = "false" + show (StackString s) = show s type TypeCheck = StackData -> Bool @@ -70,8 +72,9 @@ data TokenTag | T_WHILE | T_DO | T_END - | T_BOOL_LITERAL | T_INT_LITERAL + | T_BOOL_LITERAL + | T_STRING_LITERAL | T_INTRINSIC Intrinsic deriving (Show, Eq) -- cgit v1.2.1