kevinushey / sourcetools

Tools for reading, tokenizing, and parsing R code.
MIT License
77 stars 3 forks source link

parse_string doesn't detect missing comma #10

Closed wch closed 8 years ago

wch commented 8 years ago

For example:

parse_string("f(1,2 3)")
# expression(f(1, 2, ))
kevinushey commented 8 years ago

This is now properly reported:

> sourcetools:::parse_string("f(1,2 3)")
expression(f(1, 2, ))
Warning message:
In sourcetools:::parse_string("f(1,2 3)") :
  [0:6]: expected ',' or 'bracket'