Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
jberryman
GHC
Commits
85bcfc6c
Commit
85bcfc6c
authored
Apr 05, 2004
by
simonpj
Browse files
[project @ 2004-04-05 07:54:39 by simonpj]
Fix parsing bug in new deriving stuff, which was killing the HEAD
parent
76fcd85d
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/parser/Parser.y.pp
View file @
85bcfc6c
...
@@ -898,8 +898,15 @@ strict_mark :: { Located HsBang }
...
@@ -898,8 +898,15 @@ strict_mark :: { Located HsBang }
: '
!
' { L1 HsStrict }
: '
!
' { L1 HsStrict }
| '
{
-
# UNPACK' '#-}' '!' { LL HsUnbox }
| '
{
-
# UNPACK' '#-}' '!' { LL HsUnbox }
--
We
allow
the
odd
-
looking
'inst_type'
in
a
deriving
clause
,
so
that
--
we
can
do
deriving
(
forall
a
.
C
[
a
]
)
in
a
newtype
(
GHC
extension
)
.
--
The
'C [a]'
part
is
converted
to
an
HsPredTy
by
checkInstType
--
We
don
't allow a context, but that'
s
sorted
out
by
the
type
checker
.
deriving
::
{
Located
(
Maybe
[
LHsType
RdrName
])
}
deriving
::
{
Located
(
Maybe
[
LHsType
RdrName
])
}
:
{
-
empty
-
}
{
noLoc
Nothing
}
:
{
-
empty
-
}
{
noLoc
Nothing
}
|
'deriving'
qtycon
{
%
do
{
let
{
L
loc
tv
=
$2
}
;
p
<-
checkInstType
(
L
loc
(
HsTyVar
tv
))
;
return
(
LL
(
Just
[
p
]))
}
}
|
'deriving'
'('
')'
{
LL
(
Just
[])
}
|
'deriving'
'('
')'
{
LL
(
Just
[])
}
|
'deriving'
'('
inst_types1
')'
{
LL
(
Just
$3
)
}
|
'deriving'
'('
inst_types1
')'
{
LL
(
Just
$3
)
}
--
Glasgow
extension
:
allow
partial
--
Glasgow
extension
:
allow
partial
...
...
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