diff --git a/ext/liboga/org/liboga/xml/Lexer.rl b/ext/liboga/org/liboga/xml/Lexer.rl index a42c3bf..4b80ae0 100644 --- a/ext/liboga/org/liboga/xml/Lexer.rl +++ b/ext/liboga/org/liboga/xml/Lexer.rl @@ -26,6 +26,18 @@ public class Lexer extends RubyObject @JRubyMethod public IRubyObject advance_native(ThreadContext context) { + int act = 0; + int cs = 0; + int ts = 0; + int te = 0; + int p = 0; + int pe = 0; + int eof = 0; + int top = 0; + + int[] data = {}; + int[] stack = {}; + %% write init; %% write exec; diff --git a/lib/oga.rb b/lib/oga.rb index 1a74658..213e50b 100644 --- a/lib/oga.rb +++ b/lib/oga.rb @@ -1,11 +1,17 @@ require 'set' -require_relative 'liboga' - require_relative 'oga/xml/lexer' require_relative 'oga/xml/parser' require_relative 'oga/xml/pull_parser' +require_relative 'liboga' + +# FIXME: it looks like this should not be needed but stuff doesn't load without +# it. +if RUBY_ENGINE == 'jruby' + org.liboga.LibogaService.new.basicLoad(JRuby.runtime) +end + require_relative 'oga/xml/node' require_relative 'oga/xml/element' require_relative 'oga/xml/document'