aboutsummaryrefslogtreecommitdiff
path: root/src/AST.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-02-18 21:55:46 +0100
committerTom Smeding <tom@tomsmeding.com>2024-02-18 21:55:46 +0100
commitd744fa7ae5e638c1ca16f400a49633a705208ce4 (patch)
treef5fe6a6aa6ed8f7ff00a6c4024dc7aa6777a892c /src/AST.hs
parent78ffb5ed5fbda230675310b37f798c500a13ef11 (diff)
WIP big parser refactor with better typing
Diffstat (limited to 'src/AST.hs')
-rw-r--r--src/AST.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/AST.hs b/src/AST.hs
index 76b39b6..878c9fb 100644
--- a/src/AST.hs
+++ b/src/AST.hs
@@ -2,6 +2,8 @@ module AST where
import Data.List.NonEmpty (NonEmpty)
+import Pretty
+
newtype Name = Name String
deriving (Show, Eq)
@@ -61,3 +63,6 @@ data Literal = LInt Integer | LFloat Rational | LChar Char | LString String
data Operator = OAdd | OSub | OMul | ODiv | OMod | OEqu | OPow
| OCons
deriving (Show)
+
+instance Pretty Name where
+ prettysPrec _ (Name n) = showString ("\"" ++ n ++ "\"")