summaryrefslogtreecommitdiff
path: root/Language/C.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2021-10-09 10:19:46 +0200
committerTom Smeding <tom@tomsmeding.com>2021-10-09 10:19:46 +0200
commit961b6fc01f9c2f0220070849d22b2a30ca031324 (patch)
tree4aad269afbe41c28684f2c028fb59d64a5935760 /Language/C.hs
parentab75ec49d7248d5c908090f9ed7b234a0ff333d9 (diff)
Static C functions; clean up
Diffstat (limited to 'Language/C.hs')
-rw-r--r--Language/C.hs15
1 files changed, 11 insertions, 4 deletions
diff --git a/Language/C.hs b/Language/C.hs
index 6a3256f..9a65115 100644
--- a/Language/C.hs
+++ b/Language/C.hs
@@ -5,10 +5,17 @@ data Program = Program [FunDef]
deriving (Show)
data FunDef
- = FunDef Type Name [(Type, Name)] StExpr
- | ProcDef Name [(Type, Name)] [Stmt]
+ = FunDef FunAttrs Type Name [(Type, Name)] StExpr
+ | ProcDef FunAttrs Name [(Type, Name)] [Stmt]
deriving (Show, Eq)
+data FunAttrs = FunAttrs
+ { faStatic :: Bool }
+ deriving (Show, Eq)
+
+defAttrs :: FunAttrs
+defAttrs = FunAttrs { faStatic = False }
+
-- | Some C types.
data Type
= TInt Bits
@@ -53,5 +60,5 @@ data Expr
fundefName :: FunDef -> Name
-fundefName (FunDef _ n _ _) = n
-fundefName (ProcDef n _ _) = n
+fundefName (FunDef _ _ n _ _) = n
+fundefName (ProcDef _ n _ _) = n