- tryCatch(dispatch(io, readPacket(io)),
- swankTopLevel=function(c) NULL)
+ withRestarts(tryCatch(dispatch(io, readPacket(io)),
+ swankTopLevel=function(c) NULL),
+ abort="return to SLIME's toplevel")
- sldbLoop(io, newSldbState, id) })},
+ withRestarts(sldbLoop(io, newSldbState, id), abort=paste("return to sldb level", newSldbState$level)) })},
finally=sendToEmacs(io, list(quote(`:return`), if(ok) list(quote(`:ok`), value) else list(quote(`:abort`)), id)))
}
makeSldbState <- function(condition, level, id) {
calls <- rev(sys.calls())[-1]
frames <- rev(sys.frames())[-1]
finally=sendToEmacs(io, list(quote(`:return`), if(ok) list(quote(`:ok`), value) else list(quote(`:abort`)), id)))
}
makeSldbState <- function(condition, level, id) {
calls <- rev(sys.calls())[-1]
frames <- rev(sys.frames())[-1]
- ret <- list(condition=condition, level=level, id=id, calls=calls, frames=frames)
+ restarts <- rev(computeRestarts(condition))[-1]
+ ret <- list(condition=condition, level=level, id=id, restarts=restarts, calls=calls, frames=frames)
function (x) { ret <- list(frameNumber, paste(format(x), sep="", collapse=" ")); frameNumber <<- 1+frameNumber; ret }})
}
computeRestartsForEmacs <- function () {
function (x) { ret <- list(frameNumber, paste(format(x), sep="", collapse=" ")); frameNumber <<- 1+frameNumber; ret }})
}
computeRestartsForEmacs <- function () {
`swank:invoke-nth-restart-for-emacs` <- function(io, sldbState, level, n) {
if(sldbState$level == level) {
`swank:invoke-nth-restart-for-emacs` <- function(io, sldbState, level, n) {
if(sldbState$level == level) {