diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-01-29 22:29:24 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-01-29 22:29:24 +0100 |
commit | 8f444b0c2a6d468a596949926eccf1edf932d4df (patch) | |
tree | a55eb16637d0c7f0ebb3fa4f4ab7dbb80cf8af40 /ast.hs | |
parent | ce13c3ff2b64e1bfde13f735d871ea0a0e58a145 (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.hs | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 []) = "{}" |