I get the following error (could be friendlier) using trunk development:
:[-1,-1]:[0,0]: ../../temp/in.rb:0: syntax error, expecting end-of-file
'\n' ')' ',' ':' ';' '?' '[' ']' '}' kRESCUE
kENSURE kEND kTHEN kELSIF kELSE kWHEN kDO_COND kDO_BLOCK
kAND kOR kIF_MOD kUNLESS_MOD kWHILE_MOD kUNTIL_MOD
kRESCUE_MOD tPOW tCMP tEQ tEQQ tNEQ tGEQ tLEQ tANDOP
tOROP tMATCH tNMATCH tDOT tDOT2 tDOT3 tLSHFT tRSHFT tCOLON2 tASSOC
tLBRACE_ARG tSTAR2 tAMPER2 tPERCENT tDIVIDE tPLUS tMINUS tLT
tGT tPIPE tCARET tSTRING_BEG but found tLCURLY instead (SyntaxError)
The problem is in Ruby, you must include parens if you want an argument
and a block to be provided. So that line should be:
include_class('java.lang.String') { |p,name| "J" + name }
-Tom
On Mon, 20 Mar 2006, Ola Bini defenestrated me:
> Trying to compile this:
> include_class "java.lang.String" { |p,name| "J" + name }
>
> Gives my this exception:
> Serializing 1 file to D:\Project\jruby\build\classes\jruby
> java.lang.NullPointerException
> at org.jruby.main.ASTSerializer.serialize(ASTSerializer.java:89)
> at org.jruby.main.ASTSerializer.serialize(ASTSerializer.java:64)
> at org.jruby.util.ant.JRubySerialize.execute(JRubySerialize.java:106)
> at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
> at org.apache.tools.ant.Task.perform(Task.java:364)
> at org.apache.tools.ant.Target.execute(Target.java:341)
> at org.apache.tools.ant.Target.performTasks(Target.java:369)
> at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
> at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
> at org.apache.tools.ant.Main.runBuild(Main.java:673)
> at org.apache.tools.ant.Main.startAnt(Main.java:188)
> at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
> at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
>
> But it handles
> include_class ("java.lang.String") { |p,name| "J" + name }
> without problem.
>
> Regards
> Ola Bini
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Jruby-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jruby-devel
--
+ http://www.tc.umn.edu/~enebo +---- mailto:[EMAIL PROTECTED] ----+
| Thomas E Enebo, Protagonist | "Luck favors the prepared |
| | mind." -Louis Pasteur |
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Jruby-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jruby-devel