Use a method for getting input in the XML lexer.

Instead of directly accessing the `data` instance variable the C/Java code now
uses the method `read_data`. This is part of one of the various steps required
to allow Oga to read data from IO like instances. It also means I can freely
change the name of the instance variable without also having to change the
C/Java code.
This commit is contained in:
Yorick Peterse committed 2014-05-21 00:27:23 +02:00
1 parent 418b4ef498
commit 6b9d65923a
3 files changed
+13 -4

No files matched your search

+1 -1
View File
@@ -82,7 +82,7 @@ public class Lexer extends RubyObject
public IRubyObject advance_native(ThreadContext context)
{
// Pull the data in from Ruby land.
RubyString rb_str = (RubyString) this.getInstanceVariable("@data");
RubyString rb_str = (RubyString) this.callMethod(context, "read_data");
Encoding encoding = rb_str.getEncoding();
byte[] data = rb_str.getBytes();