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
0e793827
Commit
0e793827
authored
Jan 05, 2016
by
Björn Peemöller
Browse files
Precedence checks now accepts precedence of record labels
parent
67959071
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Checks/PrecCheck.hs
View file @
0e793827
...
...
@@ -91,7 +91,7 @@ bindPrecs ds = case findDouble opFixDecls of
ops
->
mapM_
(
report
.
errUndefinedOperator
)
ops
where
(
fixDs
,
nonFixDs
)
=
partition
isInfixDecl
ds
opFixDecls
=
[
op
|
InfixDecl
_
_
_
ops
<-
fixDs
,
op
<-
ops
]
opFixDecls
=
[
op
|
InfixDecl
_
_
_
ops
<-
fixDs
,
op
<-
ops
]
bvs
=
concatMap
boundValues
nonFixDs
bindPrec
::
ModuleIdent
->
Decl
->
OpPrecEnv
->
OpPrecEnv
...
...
@@ -99,11 +99,12 @@ bindPrec m (InfixDecl _ fix mprec ops) pEnv
|
p
==
defaultP
=
pEnv
|
otherwise
=
foldr
(
flip
(
bindP
m
)
p
)
pEnv
ops
where
p
=
OpPrec
fix
(
mkPrec
mprec
)
bindPrec
_
_
pEnv
=
pEnv
bindPrec
_
_
pEnv
=
pEnv
boundValues
::
Decl
->
[
Ident
]
boundValues
(
DataDecl
_
_
_
cs
)
=
map
constrId
cs
boundValues
(
NewtypeDecl
_
_
_
(
NewConstrDecl
_
_
c
_
))
=
[
c
]
boundValues
(
DataDecl
_
_
_
cs
)
=
[
v
|
c
<-
cs
,
v
<-
constrId
c
:
recordLabels
c
]
boundValues
(
NewtypeDecl
_
_
_
nc
)
=
nconstrId
nc
:
nrecordLabels
nc
boundValues
(
FunctionDecl
_
f
_
)
=
[
f
]
boundValues
(
ForeignDecl
_
_
_
f
_
)
=
[
f
]
boundValues
(
ExternalDecl
_
fs
)
=
fs
...
...
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