Commit 22705b4a authored by Christophe Rhodes's avatar Christophe Rhodes
Browse files

more srcref frobbing

I do not pretend to understand whether this is new, but in 2.14
parsing an expression, in addition to adding srcref attributes to the
results of the parse, can result in actual srcref elements being in
the results.  Those srcrefs also need to be frobbed so that display of
functions at the repl works properly.  (I do think this worked in 2.12
without this extra frobbing, but I am totally prepared to admit that I
can't really remember).

Since we're on the case, also frob things that look like srcrefs but
aren't under "srcref" attributes, such as "wholeSrcref"s
parent cc42bfe8
......@@ -525,6 +525,12 @@ computeRestartsForEmacs <- function (sldbState) {
if(mode(s) == "name") {
if(is(s, "srcref")) {
## more monumental KLUDGE: parsing (in 2.14, at least) appears
## to put srcrefs directly in `length 2' objects, which we need
## to frob directly.
srcrefs <- attr(s, "srcref")
attribs <- attributes(s)
new <-
......@@ -536,6 +542,9 @@ computeRestartsForEmacs <- function (sldbState) {
if(!is.null(attr(s, "srcref"))) {
attr(new, "srcref") <- frob(srcrefs)
if(!is.null(attr(s, "wholeSrcref"))) {
attr(new, "wholeSrcref") <- frob(list(attr(s, "wholeSrcref")))[[1]]
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