projects
/
matthijs
/
master-project
/
cλash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
66ef8c8
)
Allow variables to be bound to complex expressions.
author
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Mon, 2 Feb 2009 14:27:20 +0000
(15:27 +0100)
committer
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Mon, 2 Feb 2009 14:27:20 +0000
(15:27 +0100)
Previously, variables (in let expressions for example) could only be bound
to single values. This enables them to be bound to for example tuples as
well.
Translator.hs
patch
|
blob
|
history
diff --git
a/Translator.hs
b/Translator.hs
index 2f6a2922d4bad2098cc4aa722af698b00998c1bf..bdf66882954c1d108163fc4cd0df7937816c2d9c 100644
(file)
--- a/
Translator.hs
+++ b/
Translator.hs
@@
-137,10
+137,10
@@
expandExpr binds lam@(Lam b expr) = do
res_signal')
expandExpr binds (Var id) =
- return ([], [], [],
Single (signal_id, ty)
)
+ return ([], [], [],
bind
)
where
-- Lookup the id in our binds map
-
Single (signal_id, ty)
= Maybe.fromMaybe
+
bind
= Maybe.fromMaybe
(error $ "Argument " ++ getOccString id ++ "is unknown")
(lookup id binds)