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

Invoke the 1.8 or 1.9 parser #26

Open
ftomassetti opened this issue Sep 4, 2013 · 5 comments
Open

Invoke the 1.8 or 1.9 parser #26

ftomassetti opened this issue Sep 4, 2013 · 5 comments

Comments

@ftomassetti
Copy link

Excuse my simple question but how do I specify which version of the parser do I want to use? Wouldn't be useful to have it in the README?

@ftomassetti
Copy link
Author

Anyway, it should default to version 1.9 and I find a NotNode in my AST while the documentation of NotNode states that it should appear only in 1.8 ASTs

@chrisseaton
Copy link
Contributor

The parser version is specified as a CompatVersion object - https://github.com/jruby/jruby-parser/blob/master/src/org/jrubyparser/CompatVersion.java. That goes into a ParserConfiguration - https://github.com/jruby/jruby-parser/blob/master/src/org/jrubyparser/parser/ParserConfiguration.java - and then into Parser - https://github.com/jruby/jruby-parser/blob/master/src/org/jrubyparser/Parser.java.

1.8 is the default at the moment, but I think all the current use cases will be very explicit about what version they're targeting so nobody's probably given the default too much thought. But why version 1.9? That's not the earliest, and it's not the current, so seems a strange choice?

The README could admittedly use some work. If you fork the repo and put questions that you've found as you use the library, we can fill in the answers and merge.

@enebo
Copy link
Member

enebo commented Sep 4, 2013

1.9 is the most common version at the moment although 2.0 will be soon so if we change default (which I agree a default is probably not what should be encouraged) it should be set to 2.0.

To be clear on your notnode question it is because it is being parsed in 1.8 mode.

I also agree we should update the README or have a wiki page on getting up and running.

@ftomassetti
Copy link
Author

Ok, I will drop some questions on the README.

As a user I had to look into the source code to understand the nature of some nodes. For some of them there is no Javadoc, so I had just to try them in the REPL to figure out what they used for. Maybe I could add some examples in the javadoc of the corresponding node, if you think that could help.

@edubkendo
Copy link
Member

I added a bit to the README recently, also, set up wiki and added a couple pages. It would be awesome to get some more articles in the wiki and then link to those from the README as appropriate.

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

4 participants