Commit ea480db3 authored by simonmar's avatar simonmar

[project @ 2004-05-07 11:23:56 by simonmar]

make a SrcSpan for the whole file that is not "unhelpful"
parent bde1dd37
......@@ -27,7 +27,8 @@ import ForeignCall ( Safety(..), CExportSpec(..),
import OccName ( UserFS, varName, dataName, tcClsName, tvName )
import DataCon ( DataCon, dataConName )
import SrcLoc ( Located(..), unLoc, getLoc, noLoc, combineSrcSpans,
SrcSpan, combineLocs, mkGeneralSrcSpan, srcLocFile )
SrcSpan, combineLocs, srcLocFile,
mkSrcLoc, mkSrcSpan )
import Module
import CmdLineOpts ( opt_SccProfilingOn )
import Type ( Kind, mkArrowKind, liftedTypeKind )
......@@ -1554,8 +1555,12 @@ comb4 a b c d = combineSrcSpans (getLoc a) $ combineSrcSpans (getLoc b) $
sL :: SrcSpan -> a -> Located a
sL span a = span `seq` L span a
-- Make a source location that is just the filename. This seems slightly
-- neater than trying to construct the span of the text within the file.
-- Make a source location for the file. We're a bit lazy here and just
-- 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 = do l <- getSrcLoc; return (mkGeneralSrcSpan (srcLocFile l))
fileSrcSpan = do
l <- getSrcLoc;
let loc = mkSrcLoc (srcLocFile l) 1 0;
return (mkSrcSpan loc loc)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment