diff --git a/ext/c/lexer.rl b/ext/c/lexer.rl index 8b0da1f..9e19463 100644 --- a/ext/c/lexer.rl +++ b/ext/c/lexer.rl @@ -84,13 +84,6 @@ VALUE oga_xml_lexer_advance(VALUE self) int act = 0; int cs = 0; - int top = 0; - - /* - Fixed stack size is enough since the lexer doesn't use that many nested - fcalls. - */ - int stack[8]; %% write init; %% write exec; diff --git a/ext/java/org/liboga/xml/Lexer.rl b/ext/java/org/liboga/xml/Lexer.rl index 52b3f4f..0162e89 100644 --- a/ext/java/org/liboga/xml/Lexer.rl +++ b/ext/java/org/liboga/xml/Lexer.rl @@ -94,10 +94,6 @@ public class Lexer extends RubyObject int p = 0; int pe = data.length; int eof = data.length; - int top = 0; - - // Fixed stack size of 8 should be more than enough. - int[] stack = new int[8]; %% write init; %% write exec; diff --git a/ext/ragel/base_lexer.rl b/ext/ragel/base_lexer.rl index a0c955b..293c1ec 100644 --- a/ext/ragel/base_lexer.rl +++ b/ext/ragel/base_lexer.rl @@ -70,7 +70,7 @@ action start_doctype { callback_simple("on_doctype_start"); - fcall doctype; + fnext doctype; } # Machine for processing doctypes. Doctype values such as the public @@ -99,7 +99,7 @@ '>' => { callback_simple("on_doctype_end"); - fret; + fnext main; }; *|; @@ -112,14 +112,14 @@ action start_xml_decl { callback_simple("on_xml_decl_start"); - fcall xml_decl; + fnext xml_decl; } # Machine that processes the contents of an XML declaration tag. xml_decl := |* xml_decl_end => { callback_simple("on_xml_decl_end"); - fret; + fnext main; }; # Attributes and their values (e.g. version="1.0"). @@ -142,7 +142,7 @@ # machine. action start_element { fhold; - fcall element_head; + fnext element_head; } # Machine used for lexing the name/namespace of an element. @@ -153,7 +153,7 @@ identifier => { callback("on_element_name", data, encoding, ts, te); - fret; + fnext element_head; }; *|; @@ -168,7 +168,7 @@ '<' => { callback_simple("on_element_start"); - fcall element_name; + fnext element_name; }; newline => { @@ -186,13 +186,13 @@ # We're done with the open tag of the element. '>' => { callback_simple("on_element_open_end"); - fret; + fnext main; }; # Self closing tags. '/>' => { callback_simple("on_element_end"); - fret; + fnext main; }; *|;