Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validate_syntax does not complain about unexpected end of input #15

Open
filipsch opened this issue Apr 22, 2016 · 4 comments
Open

validate_syntax does not complain about unexpected end of input #15

filipsch opened this issue Apr 22, 2016 · 4 comments

Comments

@filipsch
Copy link

Is there a way to have validate_syntax() to also raise an error for the following examples?

validate_syntax("mean(1:3")
validate_syntax("x[y[1]")

Thanks for considering this!

@kevinushey
Copy link
Owner

kevinushey commented Apr 22, 2016

This will become possible with the full parser implementation + diagnostics; right now the parser does report it (although it reports a bunch of nonsense and doesn't get the position right). Using the dev version of sourcetools:

> sourcetools:::parse_string("mean(1:3")
Warning in sourcetools:::parse_string("mean(1:3") :

  [0:0]: expected ',' or 'bracket'
  [0:0]: unexpected end of input
  [0:0]: unexpected token ''; expected type 'bracket'

So hopefully we'll have this soon 😃

@filipsch
Copy link
Author

I see, thanks for this clarification. I'm looking forward to a full implementation of the parser then, awesome project!

@filipsch
Copy link
Author

I've dug through a lot of the code that RStudio IDE uses for 'parsing diagnostics', and it seems that you're making parts of that available straight inside R now. Very exciting.

Is there a way for me to contribute to this project? Things you don't have the time for yourself that you'd like to see added? I'm happy to help in building out this package further.

@kevinushey
Copy link
Owner

I haven't had as much time as I'd like to work on this package lately, and don't have as clear a picture of where contributions would be helpful. I think once more of the core is tightened up there will be some places where contributions will be welcomed; hopefully that will come sooner than later!

(In particular, I need to get the C++ side to a state where it's possible to interact with the internal parse trees from R -- once we have that, there's a lot more that can be done, I think)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants