-
Notifications
You must be signed in to change notification settings - Fork 12
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
Does not work on Rubinius #7
Comments
Okay, installed new Rubinius version, now I get:
|
Seems like this is rbx related problem, posted an issue at rbx as well. Btw. seems to work fine at JRuby as well. :-) |
dbussink: NilsH: looks like it uses some stuff rbx doesn't have yet |
Hello Nils, Thanks for the compliment -- I appreciate it. Also, thanks for taking the time to research this issue so thoroughly, as you certainly saved me the extra effort involved in researching Rubinius' level of support. Admittedly, I designed my implementation squarely to be compatible with vanilla Ruby 1.8.7, adding 1.9 compatibility later on. Thus, while I've toyed around with how the library works with Rubinius, I still haven't tested it extensively on that platform. Thus, I was not aware that Rubinius does not support StopIteration, which, as you probably know, is an exception that simply signals the inner-most loop that's currently executing to stop. Reviewing the code, I see that it is used in the module ANTLR3::TokenSource, which is used to make lexers and certain token streams act Enumerable. While it's mostly there for convenience, it is used by the various TokenStream classes to harvest tokens from lexers. From what I see in the code so far, it should be a fairly simple fix. I will try and resolve it when I have a little extra time later in the week. If you would like a quick workaround in the meantime, edit the file`lib/antlr3/token.rb'. Change the following code (around line 327) to the code listed below it: OLD CODE:
NEW CODE:
By the way, the comment made by the Rubinius developer concerning Finally, as I haven't tested the code extensively with jruby yet, I'm glad to hear that it appears to be working on that platform. Thank you for the information. If you encounter any issues with it, feel free to let me know. I don't recall any jruby no-nos off the top of my head, though I wouldn't be surprised if there is somewhere in the code that uses ObjectSpace iteration. I'll have to run the tests on these platforms over the weekend and see if any issues come up. Again, thanks for the report. I'll let you know when I've uploaded a fix for the issue. Kyle |
Actually, reading back on my post, I see a bit of redundancy in the code I suggested. I would try replacing it with this instead;
|
Hey there, thx for the extensive answer and quickfix-tips. You dont have to thank me, I try to help good open source projects wherever I can. As I do not have time to dive into all of the codebases, I take it as my duty to fill good bug-reports if I recognize something is going wrong. :-) Will report any JRuby-related problems coming through my way, as I plan on using your gem in a JRuby application first, and after this for another project on rbx. But with the TokenData error we have to wait for the rbx-devs to fix the problem, as you can see here: http://github.com/evanphx/rubinius/issues/#issue/512 it seems to be a RBX-related thing. Yesterday dbussink told me in IRC he has an idea where this could be located and it should not be hard to fix. By the way: Kind regards, |
Update: Also evan says he will support the StopIteration thing soon, but he also recommended NOT to use it. By the way, your quickfix works so far in the cases I tested it. Thx for your work man! Yeah, and if you wonder why I need to run your gem on rbx: |
Hi there,
first of all: Nice work man!
But it seems not to work on Rubinius ( rbx-1.0.1-20100603 ), when trying to run my test-file I get:
But it works fine on 1.8.7
The text was updated successfully, but these errors were encountered: