Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
curry
curry-frontend
Commits
830a23c2
Commit
830a23c2
authored
Mar 02, 2015
by
Jan Rasmus Tikovsky
Browse files
Minor fix for generation of untyped AbstractCurry
parent
b2465b9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Generators/GenAbstractCurry.hs
View file @
830a23c2
...
...
@@ -161,9 +161,12 @@ trLocalDecls ds = do
insertDeclLhs
::
Decl
->
GAC
()
-- Insert all variables declared in local declarations
insertDeclLhs
(
PatternDecl
_
p
_
)
=
mapM_
genVarIndex
(
bv
p
)
insertDeclLhs
(
FreeDecl
_
vs
)
=
mapM_
genVarIndex
vs
insertDeclLhs
_
=
return
()
insertDeclLhs
(
PatternDecl
_
p
_
)
=
mapM_
genVarIndex
(
bv
p
)
insertDeclLhs
(
FreeDecl
_
vs
)
=
mapM_
genVarIndex
vs
insertDeclLhs
s
@
(
TypeSig
_
_
_
)
=
do
uacy
<-
S
.
gets
untypedAcy
S
.
when
uacy
(
insertSig
s
)
insertDeclLhs
_
=
return
()
trLocalDecl
::
Decl
->
GAC
[
CLocalDecl
]
trLocalDecl
f
@
(
FunctionDecl
_
_
_
)
=
map
CLocalFunc
<$>
trFuncDecl
f
...
...
@@ -173,10 +176,6 @@ trLocalDecl (PatternDecl _ p rhs) = (\p' rhs' -> [CLocalPat p' rhs'])
<$>
trPat
p
<*>
trRhs
rhs
trLocalDecl
(
FreeDecl
_
vs
)
=
(
\
vs'
->
[
CLocalVars
vs'
])
<$>
mapM
getVarIndex
vs
trLocalDecl
s
@
(
TypeSig
_
_
_
)
=
do
uacy
<-
S
.
gets
untypedAcy
S
.
when
uacy
(
insertSig
s
)
return
[]
trLocalDecl
_
=
return
[]
-- can not occur (types etc.)
insertSig
::
Decl
->
GAC
()
...
...
test/UntypedAcy.curry
View file @
830a23c2
f :: Int -> Int
f x = x + 1
where
h :: Bool -> Bool
h x = not x
g y = h y * k y
where
h :: Int -> Int
h a = a * 2
h :: Int -> Int
k b = b `div` 2
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment