summaryrefslogtreecommitdiff
path: root/ast.hs
diff options
context:
space:
mode:
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 []) = "{}"