Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,274
Issues
4,274
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
412
Merge Requests
412
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
05eae534
Commit
05eae534
authored
Nov 29, 2004
by
simonpj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[project @ 2004-11-29 16:16:57 by simonpj]
Update ambiguity errors
parent
c73c3891
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
15 deletions
+24
-15
ghc/compiler/parser/Parser.y.pp
ghc/compiler/parser/Parser.y.pp
+24
-15
No files found.
ghc/compiler/parser/Parser.y.pp
View file @
05eae534
...
...
@@ -46,36 +46,49 @@ import GLAEXTS
{
-
-----------------------------------------------------------------------------
Conflicts
:
3
3
shift
/
reduce
,
[
SDM
19
/
9
/
2002
]
Conflicts
:
3
4
shift
/
reduce
(
1.15
)
10
for
abiguity
in
'if x then y else z + 1'
[
State
1
36
]
10
for
abiguity
in
'if x then y else z + 1'
[
State
1
78
]
(
shift
parses
as
'if x then y else (z + 1)'
,
as
per
longest
-
parse
rule
)
10
because
op
might
be
:
:
-
!
*
.
`
x
`
VARSYM
CONSYM
QVARSYM
QCONSYM
1
for
ambiguity
in
'if x then y else z with ?x=3'
[
State
136
]
(
shift
parses
as
'if x then y else (z with ?x=3)'
1
for
ambiguity
in
'if x then y else z :: T'
[
State
136
]
1
for
ambiguity
in
'if x then y else z :: T'
[
State
178
]
(
shift
parses
as
'if x then y else (z :: T)'
,
as
per
longest
-
parse
rule
)
4
for
ambiguity
in
'if x then y else z -< e'
4
for
ambiguity
in
'if x then y else z -< e'
[
State
178
]
(
shift
parses
as
'if x then y else (z -< T)'
,
as
per
longest
-
parse
rule
)
There
are
four
such
operators
:
-<
,
>-
,
-<<
,
>>-
2
for
ambiguity
in
'case v of { x :: T -> T ... } '
[
States
11
,
253
]
Which
of
these
two
is
intended
?
case
v
of
(
x::T
)
->
T
--
Rhs
is
T
or
case
v
of
(
x::T
->
T
)
->
..
--
Rhs
is
...
8
for
ambiguity
in
'e :: a `b` c'
.
Does
this
mean
[
States
1
60
,
246
]
8
for
ambiguity
in
'e :: a `b` c'
.
Does
this
mean
[
States
1
1
,
253
]
(
e::a
)
`
b
`
c
,
or
(
e
::
(
a
`
b
`
c
))
As
well
as
`
b
`
we
can
have
!
,
QCONSYM
,
and
CONSYM
,
hence
3
cases
Same
duplication
between
states
11
and
253
as
the
previous
case
1
for
ambiguity
in
'let ?x ...'
[
State
268
]
1
for
ambiguity
in
'let ?x ...'
[
State
329
]
the
parser
can
't tell whether the ?x is the lhs of a normal binding or
an implicit binding. Fortunately resolving as shift gives it the only
sensible meaning, namely the lhs of an implicit binding.
1 for ambiguity in '
{
-
# RULES "name" [ ... #-} [State 3
3
2]
1 for ambiguity in '
{
-
# RULES "name" [ ... #-} [State 3
8
2]
we
don
't know whether the '
[
' starts the activation or not: it
might be the start of the declaration with the activation being
empty. --SDM 1/4/2002
1 for ambiguity in '
{
-
# RULES "name" forall = ... #-}' [State 394]
6 for conflicts between `fdecl'
and
`
fdeclDEPRECATED
', [States 393,394]
which are resolved correctly, and moreover,
should go away when `fdeclDEPRECATED'
is
removed
.
1
for
ambiguity
in
'{-# RULES "name" forall = ... #-}'
[
State
474
]
since
'forall'
is
a
valid
variable
name
,
we
don
't know whether
to treat a forall on the input as the beginning of a quantifier
or the beginning of the rule itself. Resolving to shift means
...
...
@@ -83,10 +96,6 @@ Conflicts: 33 shift/reduce, [SDM 19/9/2002]
This
saves
explicitly
defining
a
grammar
for
the
rule
lhs
that
doesn
't include '
forall
'.
6 for conflicts between `fdecl'
and
`
fdeclDEPRECATED
', [States 384,385]
which are resolved correctly, and moreover,
should go away when `fdeclDEPRECATED'
is
removed
.
-- ---------------------------------------------------------------------------
-- Adding location info
...
...
Write
Preview
Markdown
is supported
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