repositories
/
cc1516.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1c2e08d
)
Function parameters
author
pimjager
<pim@pimjager.nl>
Wed, 13 Apr 2016 17:52:24 +0000
(19:52 +0200)
committer
pimjager
<pim@pimjager.nl>
Wed, 13 Apr 2016 17:52:24 +0000
(19:52 +0200)
examples/StmtEx.spl
patch
|
blob
|
history
sem.icl
patch
|
blob
|
history
diff --git
a/examples/StmtEx.spl
b/examples/StmtEx.spl
index
d52e5b7
..
ef8cb88
100644
(file)
--- a/
examples/StmtEx.spl
+++ b/
examples/StmtEx.spl
@@
-16,10
+16,10
@@
facR(n) :: Int -> Int {
return 5;
}
-test(
n
) :: Int -> Bool {
+test(
e
) :: Int -> Bool {
var i = 0;
facR(z);
- while (
n
< 3) {
+ while (
e
< 3) {
return True;
}
}
diff --git
a/sem.icl
b/sem.icl
index
addadad
..
603d53a
100644
(file)
--- a/
sem.icl
+++ b/
sem.icl
@@
-49,7
+49,7
@@
semFunDecl fd=:(FunDecl p f args mt vds stmts) =
(case mt of
Nothing = let t = IdType f in putIdent f t >>| pure t
Just t = putIdent f t >>| pure t) >>= \ft ->
- mapM_ (\a->
putIdent a (IdType <$> freshIdent
)) args >>|
+ mapM_ (\a->
freshIdent >>= \fr-> putIdent a (IdType fr
)) args >>|
mapM_ semVarDecl vds >>|
mapM_ (checkStmt $ resultType ft) stmts >>|
restoreGamma gamma >>| pure fd