summaryrefslogtreecommitdiff
path: root/ast.hs
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-01-29 22:29:24 +0100
committertomsmeding <tom.smeding@gmail.com>2017-01-29 22:29:24 +0100
commit8f444b0c2a6d468a596949926eccf1edf932d4df (patch)
treea55eb16637d0c7f0ebb3fa4f4ab7dbb80cf8af40 /ast.hs
parentce13c3ff2b64e1bfde13f735d871ea0a0e58a145 (diff)
Calling external functions!
- Call extern-declared functions - Parse 'c'har literals - Correctly make function arguments into local variables - Fix error message in check.hs (new line 153)
Diffstat (limited to 'ast.hs')
-rw-r--r--ast.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/ast.hs b/ast.hs
index f566335..8cecab6 100644
--- a/ast.hs
+++ b/ast.hs
@@ -20,6 +20,8 @@ data Declaration
,valueOf :: Maybe Expression}
| DecTypedef {typeOf :: Type
,nameOf :: Name}
+ | DecExtern {typeOf :: Type
+ ,nameOf :: Name}
deriving (Show)
data Block = Block [Statement]
@@ -102,6 +104,8 @@ instance PShow Declaration where
concat [pshow t, " ", n, " = ", pshow e, ";"]
pshow (DecTypedef t n) =
concat ["type ", n, " = ", pshow t, ";"]
+ pshow (DecExtern t n) =
+ concat ["extern ", pshow t, " ", n, ";"]
instance PShow Block where
pshow (Block []) = "{}"