Here is the patch for StringScanner written in java. It passes all of the existing tests in the testStringScan.rb file and also the new ones I added to exercise some added functionality that didn't exist in the ruby implementation (mainly search_full and scan_full). The modifications made are as follows:

(1) Removed strscan.rb from the builtin package.
(2) Modified org.jruby.Ruby to load the org.jruby.libraries.StringScannerLibrary instead of strscan.rb (3) Modified org.jruby.runtime.callback.ReflectionCallbackFactory and CallbackFactory by adding getMethod(String, Class, Class, Class) to deal with methods of arity 3. (4) Modified org.jruby.RubyRegexp by adding getPattern() method to return held java.util.regex.Pattern. (5) Modified org.jrubyRubyString by adding static newString() method that takes a CharSequence and removing the existing static method that takes a String.
(6) Added org.jruby.util.StringScanner.
(7) Added org.jruby.RubyStringScanner.
(8) Added org.jruby.util.StringScannerTest

Let me know what you guys think...

Attachment: strscan.patch
Description: Binary data


Kelly
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jruby-devel mailing list
Jruby-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jruby-devel

Reply via email to