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
ea480db3
Commit
ea480db3
authored
May 07, 2004
by
simonmar
Browse files
[project @ 2004-05-07 11:23:56 by simonmar]
make a SrcSpan for the whole file that is not "unhelpful"
parent
bde1dd37
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/parser/Parser.y.pp
View file @
ea480db3
...
@@ -27,7 +27,8 @@ import ForeignCall ( Safety(..), CExportSpec(..),
...
@@ -27,7 +27,8 @@ import ForeignCall ( Safety(..), CExportSpec(..),
import
OccName
(
UserFS
,
varName
,
dataName
,
tcClsName
,
tvName
)
import
OccName
(
UserFS
,
varName
,
dataName
,
tcClsName
,
tvName
)
import
DataCon
(
DataCon
,
dataConName
)
import
DataCon
(
DataCon
,
dataConName
)
import
SrcLoc
(
Located
(
..
),
unLoc
,
getLoc
,
noLoc
,
combineSrcSpans
,
import
SrcLoc
(
Located
(
..
),
unLoc
,
getLoc
,
noLoc
,
combineSrcSpans
,
SrcSpan
,
combineLocs
,
mkGeneralSrcSpan
,
srcLocFile
)
SrcSpan
,
combineLocs
,
srcLocFile
,
mkSrcLoc
,
mkSrcSpan
)
import
Module
import
Module
import
CmdLineOpts
(
opt_SccProfilingOn
)
import
CmdLineOpts
(
opt_SccProfilingOn
)
import
Type
(
Kind
,
mkArrowKind
,
liftedTypeKind
)
import
Type
(
Kind
,
mkArrowKind
,
liftedTypeKind
)
...
@@ -1554,8 +1555,12 @@ comb4 a b c d = combineSrcSpans (getLoc a) $ combineSrcSpans (getLoc b) $
...
@@ -1554,8 +1555,12 @@ comb4 a b c d = combineSrcSpans (getLoc a) $ combineSrcSpans (getLoc b) $
sL
::
SrcSpan
->
a
->
Located
a
sL
::
SrcSpan
->
a
->
Located
a
sL
span
a
=
span
`
seq
`
L
span
a
sL
span
a
=
span
`
seq
`
L
span
a
--
Make
a
source
location
that
is
just
the
filename
.
This
seems
slightly
--
Make
a
source
location
for
the
file
.
We
'
re
a
bit
lazy
here
and
just
--
neater
than
trying
to
construct
the
span
of
the
text
within
the
file
.
--
make
a
point
SrcSpan
at
line
1
,
column
0
.
Strictly
speaking
we
should
--
try
to
find
the
span
of
the
whole
file
(
ToDo
)
.
fileSrcSpan
::
P
SrcSpan
fileSrcSpan
::
P
SrcSpan
fileSrcSpan
=
do
l
<-
getSrcLoc
;
return
(
mkGeneralSrcSpan
(
srcLocFile
l
))
fileSrcSpan
=
do
l
<-
getSrcLoc
;
let
loc
=
mkSrcLoc
(
srcLocFile
l
)
1
0
;
return
(
mkSrcSpan
loc
loc
)
}
}
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