diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-02-18 21:55:46 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-02-18 21:55:46 +0100 |
commit | d744fa7ae5e638c1ca16f400a49633a705208ce4 (patch) | |
tree | f5fe6a6aa6ed8f7ff00a6c4024dc7aa6777a892c /src/AST.hs | |
parent | 78ffb5ed5fbda230675310b37f798c500a13ef11 (diff) |
WIP big parser refactor with better typing
Diffstat (limited to 'src/AST.hs')
-rw-r--r-- | src/AST.hs | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 ++ "\"") |