Hi,

With R-3.1.0 I get:
> getParseData(parse(text = "{1}", keep.source = TRUE))
  line1 col1 line2 col2 id parent     token terminal text
7     1    1     1    3  7      9      expr    FALSE
1     1    1     1    1  1      7       '{'     TRUE    {
2     1    2     1    2  2      3 NUM_CONST     TRUE    1
3     1    2     1    2  3      5      expr    FALSE
4     1    3     1    3  4      7       '}'     TRUE    }

Which has two problems:
1) the parent of the first expression (id=7) should be 0
2) the parent of the expression with id=3 should be 7

For reference, with R-3.0.2:

> getParseData(parse(text = "{1}", keep.source = TRUE))
  line1 col1 line2 col2 id parent     token terminal text
7     1    1     1    3  7      0      expr    FALSE
1     1    1     1    1  1      7       '{'     TRUE    {
2     1    2     1    2  2      3 NUM_CONST     TRUE    1
3     1    2     1    2  3      7      expr    FALSE
4     1    3     1    3  4      7       '}'     TRUE    }

which is correct.

        [[alternative HTML version deleted]]

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to