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,322
Issues
4,322
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
362
Merge Requests
362
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
16b62831
Commit
16b62831
authored
Jan 17, 2012
by
Simon Peyton Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate {| and |} vestiges in lexer/parser
They weren't being lexed any more, but we still had productions!
parent
bb50135b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
19 deletions
+8
-19
compiler/parser/Lexer.x
compiler/parser/Lexer.x
+0
-2
compiler/parser/Parser.y.pp
compiler/parser/Parser.y.pp
+8
-17
No files found.
compiler/parser/Lexer.x
View file @
16b62831
...
...
@@ -509,8 +509,6 @@ data Token
| ITocurly -- special symbols
| ITccurly
| ITocurlybar -- {|, for type applications
| ITccurlybar -- |}, for type applications
| ITvocurly
| ITvccurly
| ITobrack
...
...
compiler/parser/Parser.y.pp
View file @
16b62831
...
...
@@ -294,8 +294,6 @@ incorrect.
'{'
{
L
_
ITocurly
}
--
special
symbols
'}'
{
L
_
ITccurly
}
'{|'
{
L
_
ITocurlybar
}
'|}'
{
L
_
ITccurlybar
}
vocurly
{
L
_
ITvocurly
}
--
virtual
open
curly
(
from
layout
)
vccurly
{
L
_
ITvccurly
}
--
virtual
close
curly
(
from
layout
)
'['
{
L
_
ITobrack
}
...
...
@@ -1427,14 +1425,6 @@ aexp1 :: { LHsExpr RdrName }
;
checkRecordSyntax
(
LL
r
)
}}
|
aexp2
{
$1
}
--
Here
was
the
syntax
for
type
applications
that
I
was
planning
--
but
there
are
difficulties
(
e
.
g
.
what
order
for
type
args
)
--
so
it
's not enabled yet.
-- But this case *is* used for the left hand side of a generic definition,
-- which is parsed as an expression before being munged into a pattern
| qcname '
{|
' type '
|}
' { LL $ HsApp (sL (getLoc $1) (HsVar (unLoc $1)))
(sL (getLoc $3) (HsType $3)) }
aexp2
::
{
LHsExpr
RdrName
}
:
ipvar
{
L1
(
HsIPVar
$
!
unLoc
$1
)
}
|
qcname
{
L1
(
HsVar
$
!
unLoc
$1
)
}
...
...
@@ -1586,16 +1576,17 @@ squals :: { Located [LStmt RdrName] } -- In reverse order, because the last
--
|
'{|'
pquals
'|}'
{
L1
[
$2
]
}
--
It
is
possible
to
enable
bracketing
(
associating
)
qualifier
lists
by
uncommenting
the
lines
with
{|
|}
--
above
.
Due
to
a
lack
of
consensus
on
the
syntax
,
this
feature
is
not
being
used
until
we
get
user
--
demand
.
--
It
is
possible
to
enable
bracketing
(
associating
)
qualifier
lists
--
by
uncommenting
the
lines
with
{|
|}
above
.
Due
to
a
lack
of
--
consensus
on
the
syntax
,
this
feature
is
not
being
used
until
we
--
get
user
demand
.
transformqual
::
{
Located
([
LStmt
RdrName
]
->
Stmt
RdrName
)
}
--
Function
is
applied
to
a
list
of
stmts
*
in
order
*
:
'then'
exp
{
LL
$
\
leftStmts
->
(
mkTransformStmt
leftStmt
s
$2
)
}
|
'then'
exp
'by'
exp
{
LL
$
\
leftStmts
->
(
mkTransformByStmt
leftStmt
s
$2
$4
)
}
|
'then'
'group'
'using'
exp
{
LL
$
\
leftStmts
->
(
mkGroupUsingStmt
leftStmt
s
$4
)
}
|
'then'
'group'
'by'
exp
'using'
exp
{
LL
$
\
leftStmts
->
(
mkGroupByUsingStmt
leftStmt
s
$4
$6
)
}
:
'then'
exp
{
LL
$
\
ss
->
(
mkTransformStmt
s
s
$2
)
}
|
'then'
exp
'by'
exp
{
LL
$
\
ss
->
(
mkTransformByStmt
s
s
$2
$4
)
}
|
'then'
'group'
'using'
exp
{
LL
$
\
ss
->
(
mkGroupUsingStmt
s
s
$4
)
}
|
'then'
'group'
'by'
exp
'using'
exp
{
LL
$
\
ss
->
(
mkGroupByUsingStmt
s
s
$4
$6
)
}
--
Note
that
'group'
is
a
special_id
,
which
means
that
you
can
enable
--
TransformListComp
while
still
using
Data
.
List
.
group
.
However
,
this
...
...
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