Ability to get extra position information from DefaultRubyParser
----------------------------------------------------------------
Key: JRUBY-3107
URL: http://jira.codehaus.org/browse/JRUBY-3107
Project: JRuby
Issue Type: Improvement
Components: Parser
Affects Versions: JRuby 1.1.4
Reporter: Chris Williams
Assignee: Thomas E Enebo
Fix For: JRuby 1.1.5
Attachments: DefaultRubyParser.java.patch
Typically I only need comment nodes when doing more low level per token
lex/parsing, but in some cases I'd like to use the DefaultRubyParser to parse
and get back the AST/result without needing to handle tokens; and still get
back the list of CommentNodes. There's no way to currently get that, as it
creates it's own ParserSupport object without extra position info in the
constructor, and the parse method doesn't set the support object again even
though it sets the configuration on the support object.
The attached patch sets the support object on the lexer in the parse method
after setting the configuration on the support - so we can specify that for
this parse we want extra position information (essentially Comments). I also
made the support, lexer, and warning objects protected so subclasses could play
witht hem; and lastly made a constructor where we can pass in our own
ParserSupport object.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email