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

Tweaks to get Bitescript going in JRuby 1.6.3 in --1.9 mode #8

Merged
merged 3 commits into from
Jul 11, 2011
Merged

Tweaks to get Bitescript going in JRuby 1.6.3 in --1.9 mode #8

merged 3 commits into from
Jul 11, 2011

Conversation

undees
Copy link
Contributor

@undees undees commented Jul 10, 2011

These commits tweak Bitescript (plus its build files and examples) to work in JRuby 1.6.3 in --1.9 mode. Together, they do the following:

  1. Fix bytecode.rb, which assumes the contents of ASM's Opcodes constant are strings (they are symbols in --1.9 mode).

  2. Update hello_world_macro.bs to run without errors.

  3. Update the gemspec to use a time format recognized by strftime.

When Bitescript launches under JRuby 1.6.3 with the --1.9 flag set, the following error occurs at line 307 of bytecode.rb before the input file gets parsed:

TypeError: can't convert Symbol into String

The issue: under --1.8, the Opcodes constant (imported from ASM) contains strings.  Under --1.9, it contains symbols.  This commit runs all the opcodes through to_s.  Tested with both --1.8 and --1.9.
The following changes get hello_world_macro.bs running under the latest JRuby/Bitescript:
* Invoke print and println with [void, object] instead of [Object] to get the correct signature
* ldc 0 / aload instead of aaload 0 to access the argument array
* Add a comment to make command-line usage clear
"gem build" was failing with an unrecognized time format, "YYYY-MM-DD".  This commit uses "%Y-%m-%d" instead.
headius added a commit that referenced this pull request Jul 11, 2011
Tweaks to get Bitescript going in JRuby 1.6.3 in --1.9 mode
@headius headius merged commit adbad5e into headius:master Jul 11, 2011
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

Successfully merging this pull request may close these issues.

None yet

2 participants