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
Alex D
GHC
Commits
252abd9e
Commit
252abd9e
authored
Sep 07, 2004
by
simonmar
Browse files
[project @ 2004-09-07 12:30:27 by simonmar]
Fix up the SrcSpan on the rhs of a function binding.
parent
6a56f3ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/parser/Parser.y.pp
View file @
252abd9e
...
...
@@ -941,7 +941,7 @@ deriving :: { Located (Maybe [LHsType RdrName]) }
decl :: { Located (OrdList (LHsDecl RdrName)) }
: sigdecl { $1 }
| infixexp opt_sig rhs {% do { r <- checkValDef $1 $2
(unLoc
$3
)
;
| infixexp opt_sig rhs {% do { r <- checkValDef $1 $2 $3;
return (LL $ unitOL (LL $ ValD r)) } }
rhs :: { Located (GRHSs RdrName) }
...
...
ghc/compiler/parser/RdrHsSyn.lhs
View file @
252abd9e
...
...
@@ -762,17 +762,16 @@ patFail loc = parseError loc "Parse error in pattern"
checkValDef
:: LHsExpr RdrName
-> Maybe (LHsType RdrName)
-> GRHSs RdrName
->
Located (
GRHSs RdrName
)
-> P (HsBind RdrName)
checkValDef lhs opt_sig grhss
checkValDef lhs opt_sig
(L rhs_span
grhss
)
| Just (f,inf,es) <- isFunLhs lhs []
= if isQual (unLoc f)
then parseError (getLoc f) ("Qualified name in function definition: " ++
showRdrName (unLoc f))
else do ps <- checkPatterns es
return (FunBind f inf [L (getLoc f) (Match ps opt_sig grhss)])
-- TODO: span is wrong
return (FunBind f inf [L rhs_span (Match ps opt_sig grhss)])
| otherwise = do
lhs <- checkPattern lhs
return (PatBind lhs grhss)
...
...
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