Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
a2d98d07
Commit
a2d98d07
authored
Apr 18, 2007
by
Simon Marlow
Browse files
handle out-of-range lines in :break more gracefully
parent
3a0ddd1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/ghci/InteractiveUI.hs
View file @
a2d98d07
...
...
@@ -1573,10 +1573,12 @@ findBreakAndSet mod lookupTickTree = do
-- - the rightmost subexpression enclosing the specified line
--
findBreakByLine
::
Int
->
TickArray
->
Maybe
(
BreakIndex
,
SrcSpan
)
findBreakByLine
line
arr
=
listToMaybe
(
sortBy
leftmost
complete
)
`
mplus
`
listToMaybe
(
sortBy
leftmost
incomplete
)
`
mplus
`
listToMaybe
(
sortBy
rightmost
ticks
)
findBreakByLine
line
arr
|
not
(
inRange
(
bounds
arr
)
line
)
=
Nothing
|
otherwise
=
listToMaybe
(
sortBy
leftmost
complete
)
`
mplus
`
listToMaybe
(
sortBy
leftmost
incomplete
)
`
mplus
`
listToMaybe
(
sortBy
rightmost
ticks
)
where
ticks
=
arr
!
line
...
...
@@ -1587,8 +1589,10 @@ findBreakByLine line arr =
where
ends_here
(
nm
,
span
)
=
srcSpanEndLine
span
==
line
findBreakByCoord
::
(
Int
,
Int
)
->
TickArray
->
Maybe
(
BreakIndex
,
SrcSpan
)
findBreakByCoord
(
line
,
col
)
arr
=
listToMaybe
(
sortBy
rightmost
contains
)
findBreakByCoord
(
line
,
col
)
arr
|
not
(
inRange
(
bounds
arr
)
line
)
=
Nothing
|
otherwise
=
listToMaybe
(
sortBy
rightmost
contains
)
where
ticks
=
arr
!
line
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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