projects
/
matthijs
/
master-project
/
cλash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove createEntity from the VHDLState monad.
[matthijs/master-project/cλash.git]
/
VHDL.hs
diff --git
a/VHDL.hs
b/VHDL.hs
index d9dce9e699f9188dfefc9726f625a7369bc7cd29..6f3705e421d6f0d55b16faef97054ac3f3462367 100644
(file)
--- a/
VHDL.hs
+++ b/
VHDL.hs
@@
-38,13
+38,12
@@
getDesignFiles funcs =
createEntity ::
HsFunction -- | The function signature
-> FuncData -- | The function data collected so far
createEntity ::
HsFunction -- | The function signature
-> FuncData -- | The function data collected so far
- ->
VHDLState ()
+ ->
Maybe Entity -- | The resulting entity
createEntity hsfunc fdata =
createEntity hsfunc fdata =
- let func = flatFunc fdata in
- case func of
+ case flatFunc fdata of
-- Skip (builtin) functions without a FlatFunction
-- Skip (builtin) functions without a FlatFunction
- Nothing ->
do return ()
+ Nothing ->
Nothing
-- Create an entity for all other functions
Just flatfunc ->
let
-- Create an entity for all other functions
Just flatfunc ->
let
@@
-60,9
+59,8
@@
createEntity hsfunc fdata =
then Nothing
else Just $ AST.PackageDec pkg_id (map AST.PDITD $ ty_decls ++ ty_decls')
AST.EntityDec entity_id _ = ent_decl'
then Nothing
else Just $ AST.PackageDec pkg_id (map AST.PDITD $ ty_decls ++ ty_decls')
AST.EntityDec entity_id _ = ent_decl'
- entity' = Entity entity_id args' res' (Just ent_decl') pkg_decl
- in do
- setEntity hsfunc entity'
+ in
+ Just $ Entity entity_id args' res' (Just ent_decl') pkg_decl
where
mkMap ::
[(SignalId, SignalInfo)]
where
mkMap ::
[(SignalId, SignalInfo)]