From d744fa7ae5e638c1ca16f400a49633a705208ce4 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sun, 18 Feb 2024 21:55:46 +0100 Subject: WIP big parser refactor with better typing --- src/AST.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/AST.hs') 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 ++ "\"") -- cgit v1.2.3-70-g09d2