[Rd] parse data wrong for R 4.0. raw strings

Gábor Csárdi c@@rd|@g@bor @end|ng |rom gm@||@com
Wed Apr 22 11:47:00 CEST 2020


This seems like a bug to me:

code <- 'x <- r"(hello, "world")"'
getParseData(parse(text = code))
#>   line1 col1 line2 col2 id parent       token terminal             text
#> 7     1    1     1   24  7      0        expr    FALSE
#> 1     1    1     1    1  1      3      SYMBOL     TRUE                x
#> 3     1    1     1    1  3      7        expr    FALSE
#> 2     1    3     1    4  2      7 LEFT_ASSIGN     TRUE               <-
#> 4     1    6     1   24  4      6   STR_CONST     TRUE "hello, "world")
#> 6     1    6     1   24  6      7        expr    FALSE

Note that for STR_CONST, the opening delimiter is not included, but
the paren from the closing delimiter is.

Best,
Gabor



More information about the R-devel mailing list