diff --git a/ext/c/lexer.rl b/ext/c/lexer.rl
index c122e9f..e952d6f 100644
--- a/ext/c/lexer.rl
+++ b/ext/c/lexer.rl
@@ -113,7 +113,6 @@ VALUE oga_xml_lexer_advance(VALUE self, VALUE data_block)
ID id_on_element_name = rb_intern("on_element_name");
ID id_on_element_ns = rb_intern("on_element_ns");
ID id_on_element_open_end = rb_intern("on_element_open_end");
- ID id_on_element_start = rb_intern("on_element_start");
ID id_on_proc_ins_end = rb_intern("on_proc_ins_end");
ID id_on_proc_ins_name = rb_intern("on_proc_ins_name");
ID id_on_proc_ins_start = rb_intern("on_proc_ins_start");
diff --git a/ext/java/org/liboga/xml/Lexer.rl b/ext/java/org/liboga/xml/Lexer.rl
index 458f9c9..12d219d 100644
--- a/ext/java/org/liboga/xml/Lexer.rl
+++ b/ext/java/org/liboga/xml/Lexer.rl
@@ -121,7 +121,6 @@ public class Lexer extends RubyObject
String id_on_element_name = "on_element_name";
String id_on_element_ns = "on_element_ns";
String id_on_element_open_end = "on_element_open_end";
- String id_on_element_start = "on_element_start";
String id_on_proc_ins_end = "on_proc_ins_end";
String id_on_proc_ins_name = "on_proc_ins_name";
String id_on_proc_ins_start = "on_proc_ins_start";
diff --git a/ext/ragel/base_lexer.rl b/ext/ragel/base_lexer.rl
index 27a6cb0..8a6e469 100644
--- a/ext/ragel/base_lexer.rl
+++ b/ext/ragel/base_lexer.rl
@@ -367,7 +367,6 @@
element_end = '' identifier (':' identifier)* '>';
action start_element {
- callback_simple(id_on_element_start);
fhold;
fnext element_name;
}
diff --git a/lib/oga/xml/lexer.rb b/lib/oga/xml/lexer.rb
index 63c71a4..03dbc77 100644
--- a/lib/oga/xml/lexer.rb
+++ b/lib/oga/xml/lexer.rb
@@ -337,13 +337,6 @@ module Oga
add_token(:T_XML_DECL_END)
end
- ##
- # Called on the start of an element.
- #
- def on_element_start
- add_token(:T_ELEM_START)
- end
-
##
# Called on the start of a processing instruction.
#
diff --git a/lib/oga/xml/parser.rll b/lib/oga/xml/parser.rll
index 3343ebd..c21f320 100644
--- a/lib/oga/xml/parser.rll
+++ b/lib/oga/xml/parser.rll
@@ -27,7 +27,7 @@
%terminals T_DOCTYPE_INLINE;
%terminals T_COMMENT_START T_COMMENT_BODY T_COMMENT_END;
%terminals T_CDATA_START T_CDATA_BODY T_CDATA_END;
-%terminals T_ELEM_START T_ELEM_NAME T_ELEM_NS T_ELEM_END T_ATTR T_ATTR_NS;
+%terminals T_ELEM_NAME T_ELEM_NS T_ELEM_END T_ATTR T_ATTR_NS;
%terminals T_XML_DECL_START T_XML_DECL_END;
%terminals T_PROC_INS_START T_PROC_INS_NAME T_PROC_INS_BODY T_PROC_INS_END;
@@ -136,9 +136,9 @@ element_name_ns
;
element_start
- = T_ELEM_START element_name_ns attributes
+ = element_name_ns attributes
{
- on_element(val[1][0], val[1][1], val[2])
+ on_element(val[0][0], val[0][1], val[1])
}
;
diff --git a/spec/oga/xml/lexer/cdata_spec.rb b/spec/oga/xml/lexer/cdata_spec.rb
index 48f873d..d1a2aa7 100644
--- a/spec/oga/xml/lexer/cdata_spec.rb
+++ b/spec/oga/xml/lexer/cdata_spec.rb
@@ -37,12 +37,10 @@ describe Oga::XML::Lexer do
it 'lexes two CDATA tags following each other' do
lex(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'a', 1],
[:T_CDATA_START, nil, 1],
[:T_CDATA_BODY, 'foo', 1],
[:T_CDATA_END, nil, 1],
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'b', 1],
[:T_CDATA_START, nil, 1],
[:T_CDATA_BODY, 'bar', 1],
diff --git a/spec/oga/xml/lexer/comments_spec.rb b/spec/oga/xml/lexer/comments_spec.rb
index 772ab5b..442e2f0 100644
--- a/spec/oga/xml/lexer/comments_spec.rb
+++ b/spec/oga/xml/lexer/comments_spec.rb
@@ -59,7 +59,6 @@ describe Oga::XML::Lexer do
it 'lexes an element followed by a comment' do
lex('
').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ELEM_END, nil, 1],
[:T_COMMENT_START, nil, 1],
@@ -69,12 +68,10 @@ describe Oga::XML::Lexer do
it 'lexes two comments following each other' do
lex(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'a', 1],
[:T_COMMENT_START, nil, 1],
[:T_COMMENT_BODY, 'foo', 1],
[:T_COMMENT_END, nil, 1],
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'b', 1],
[:T_COMMENT_START, nil, 1],
[:T_COMMENT_BODY, 'bar', 1],
diff --git a/spec/oga/xml/lexer/documents_spec.rb b/spec/oga/xml/lexer/documents_spec.rb
index 2b9c689..a078ccd 100644
--- a/spec/oga/xml/lexer/documents_spec.rb
+++ b/spec/oga/xml/lexer/documents_spec.rb
@@ -20,17 +20,14 @@ describe Oga::XML::Lexer do
[:T_TEXT, "\n", 1],
#
- [:T_ELEM_START, nil, 2],
[:T_ELEM_NAME, 'html', 2],
[:T_TEXT, "\n", 2],
#
- [:T_ELEM_START, nil, 3],
[:T_ELEM_NAME, 'head', 3],
[:T_TEXT, "\n", 3],
# Title
- [:T_ELEM_START, nil, 4],
[:T_ELEM_NAME, 'title', 4],
[:T_TEXT, 'Title', 4],
[:T_ELEM_END, nil, 4],
@@ -41,7 +38,6 @@ describe Oga::XML::Lexer do
[:T_TEXT, "\n", 5],
#
- [:T_ELEM_START, nil, 6],
[:T_ELEM_NAME, 'body', 6],
[:T_ELEM_END, nil, 6],
[:T_TEXT, "\n", 6],
diff --git a/spec/oga/xml/lexer/elements_spec.rb b/spec/oga/xml/lexer/elements_spec.rb
index 0918811..71a6511 100644
--- a/spec/oga/xml/lexer/elements_spec.rb
+++ b/spec/oga/xml/lexer/elements_spec.rb
@@ -4,7 +4,6 @@ describe Oga::XML::Lexer do
describe 'elements' do
it 'lexes an opening element' do
lex('').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ELEM_END, nil, 1]
]
@@ -12,7 +11,6 @@ describe Oga::XML::Lexer do
it 'lexes an opening element with a stray double quote' do
lex('
').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ELEM_END, nil, 1]
]
@@ -20,7 +18,6 @@ describe Oga::XML::Lexer do
it 'lexes an opening element with a stray double quoted string' do
lex('
').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ELEM_END, nil, 1]
]
@@ -28,7 +25,6 @@ describe Oga::XML::Lexer do
it 'lexes an opening an closing element' do
lex('
').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ELEM_END, nil, 1]
]
@@ -36,7 +32,6 @@ describe Oga::XML::Lexer do
it 'lexes an opening an closing element with a stray double quote' do
lex('
').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ELEM_END, nil, 1]
]
@@ -44,7 +39,6 @@ describe Oga::XML::Lexer do
it 'lexes an opening an closing element with a stray double quoted string' do
lex('
').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ELEM_END, nil, 1]
]
@@ -52,7 +46,6 @@ describe Oga::XML::Lexer do
it 'lexes a paragraph element with text inside it' do
lex('Hello
').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_TEXT, 'Hello', 1],
[:T_ELEM_END, nil, 1]
@@ -62,7 +55,6 @@ describe Oga::XML::Lexer do
it 'lexes text followed by a paragraph element' do
lex('Foo').should == [
[:T_TEXT, 'Foo', 1],
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ELEM_END, nil, 1]
]
@@ -70,7 +62,6 @@ describe Oga::XML::Lexer do
it 'lexes an element with a newline in the open tag' do
lex("
").should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ELEM_END, nil, 2]
]
@@ -78,7 +69,6 @@ describe Oga::XML::Lexer do
it 'lexes an element with a carriage return in the open tag' do
lex("
").should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ELEM_END, nil, 2]
]
@@ -88,7 +78,6 @@ describe Oga::XML::Lexer do
describe 'elements with attributes' do
it 'lexes an element with an attribute without a value' do
lex('
').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ATTR, 'foo', 1],
[:T_ELEM_END, nil, 1]
@@ -97,7 +86,6 @@ describe Oga::XML::Lexer do
it 'lexes an element with an empty attribute followed by a stray double quote' do
lex('
').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ATTR, 'foo', 1],
[:T_ELEM_END, nil, 1]
@@ -106,7 +94,6 @@ describe Oga::XML::Lexer do
it 'lexes an element with an attribute with an empty value' do
lex('
').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ATTR, 'foo', 1],
[:T_STRING_DQUOTE, nil, 1],
@@ -117,7 +104,6 @@ describe Oga::XML::Lexer do
it 'lexes an attribute value followed by a stray double quote' do
lex('
').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ATTR, 'foo', 1],
[:T_STRING_DQUOTE, nil, 1],
@@ -128,7 +114,6 @@ describe Oga::XML::Lexer do
it 'lexes an attribute value followed by a stray single quote' do
lex('
').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ATTR, 'foo', 1],
[:T_STRING_DQUOTE, nil, 1],
@@ -139,7 +124,6 @@ describe Oga::XML::Lexer do
it 'lexes a paragraph element with attributes' do
lex('Hello
').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ATTR, 'class', 1],
[:T_STRING_DQUOTE, nil, 1],
@@ -152,7 +136,6 @@ describe Oga::XML::Lexer do
it 'lexes a paragraph element with a newline in an attribute' do
lex("Hello
").should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ATTR, 'class', 1],
[:T_STRING_DQUOTE, nil, 1],
@@ -165,7 +148,6 @@ describe Oga::XML::Lexer do
it 'lexes a paragraph element with single quoted attributes' do
lex("
").should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ATTR, 'class', 1],
[:T_STRING_SQUOTE, nil, 1],
@@ -177,7 +159,6 @@ describe Oga::XML::Lexer do
it 'lexes a paragraph element with a namespaced attribute' do
lex('
').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ATTR_NS, 'foo', 1],
[:T_ATTR, 'bar', 1],
@@ -192,9 +173,7 @@ describe Oga::XML::Lexer do
describe 'nested elements' do
it 'lexes a nested element' do
lex('
').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'a', 1],
[:T_ELEM_END, nil, 1],
[:T_ELEM_END, nil, 1]
@@ -203,10 +182,8 @@ describe Oga::XML::Lexer do
it 'lexes nested elements and text nodes' do
lex('Foobar baz
').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_TEXT, 'Foo', 1],
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'a', 1],
[:T_TEXT, 'bar', 1],
[:T_ELEM_END, nil, 1],
@@ -219,7 +196,6 @@ describe Oga::XML::Lexer do
describe 'void elements' do
it 'lexes a void element' do
lex(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'br', 1],
[:T_ELEM_END, nil, 1]
]
@@ -227,7 +203,6 @@ describe Oga::XML::Lexer do
it 'lexes a void element with an attribute' do
lex(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'br', 1],
[:T_ATTR, 'class', 1],
[:T_STRING_DQUOTE, nil, 1],
@@ -240,7 +215,6 @@ describe Oga::XML::Lexer do
describe 'without a space before the closing tag' do
it 'lexes a void element' do
lex(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'br', 1],
[:T_ELEM_END, nil, 1]
]
@@ -248,7 +222,6 @@ describe Oga::XML::Lexer do
it 'lexes a void element with an attribute' do
lex(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'br', 1],
[:T_ATTR, 'class', 1],
[:T_STRING_DQUOTE, nil, 1],
@@ -263,7 +236,6 @@ describe Oga::XML::Lexer do
describe 'elements with namespaces' do
it 'lexes an element with namespaces' do
lex('').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NS, 'foo', 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ELEM_END, nil, 1]
@@ -272,7 +244,6 @@ describe Oga::XML::Lexer do
it 'lexes an element with a start and end namespace' do
lex(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NS, 'foo', 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ELEM_END, nil, 1]
diff --git a/spec/oga/xml/lexer/enumerator_spec.rb b/spec/oga/xml/lexer/enumerator_spec.rb
index 6486d18..d9d6fee 100644
--- a/spec/oga/xml/lexer/enumerator_spec.rb
+++ b/spec/oga/xml/lexer/enumerator_spec.rb
@@ -11,7 +11,6 @@ describe Oga::XML::Lexer do
it 'lexes a paragraph element' do
lex(@enum).should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_TEXT, 'foo', 1],
[:T_ELEM_END, nil, 1]
diff --git a/spec/oga/xml/lexer/html_attributes_spec.rb b/spec/oga/xml/lexer/html_attributes_spec.rb
index f6b53fe..00d9020 100644
--- a/spec/oga/xml/lexer/html_attributes_spec.rb
+++ b/spec/oga/xml/lexer/html_attributes_spec.rb
@@ -4,7 +4,6 @@ describe Oga::XML::Lexer do
describe 'HTML attributes' do
it 'lexes an attribute with an unquoted value' do
lex_html(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'a', 1],
[:T_ATTR, 'href', 1],
[:T_STRING_SQUOTE, nil, 1],
@@ -16,7 +15,6 @@ describe Oga::XML::Lexer do
it 'lexes an attribute with an unquoted value containing a space' do
lex_html(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'a', 1],
[:T_ATTR, 'href', 1],
[:T_STRING_SQUOTE, nil, 1],
@@ -29,7 +27,6 @@ describe Oga::XML::Lexer do
it 'lexes an attribute with an unquoted value containing an underscore' do
lex_html(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'a', 1],
[:T_ATTR, 'href', 1],
[:T_STRING_SQUOTE, nil, 1],
@@ -41,7 +38,6 @@ describe Oga::XML::Lexer do
it 'lexes an attribute with an unquoted value containing a dash' do
lex_html(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'a', 1],
[:T_ATTR, 'href', 1],
[:T_STRING_SQUOTE, nil, 1],
@@ -53,7 +49,6 @@ describe Oga::XML::Lexer do
it 'lexes an attribute with an unquoted value containing a slash' do
lex_html(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'a', 1],
[:T_ATTR, 'href', 1],
[:T_STRING_SQUOTE, nil, 1],
diff --git a/spec/oga/xml/lexer/html_script_spec.rb b/spec/oga/xml/lexer/html_script_spec.rb
index c958e54..8c9a31a 100644
--- a/spec/oga/xml/lexer/html_script_spec.rb
+++ b/spec/oga/xml/lexer/html_script_spec.rb
@@ -4,7 +4,6 @@ describe Oga::XML::Lexer do
describe 'HTML script elements' do
it 'treats the content of a script tag as plain text' do
lex_html('').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'script', 1],
[:T_TEXT, 'foo ', 1],
[:T_TEXT, '<', 1],
@@ -15,7 +14,6 @@ describe Oga::XML::Lexer do
it 'treats style tags inside script tags as text' do
lex_html('').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'script', 1],
[:T_TEXT, '<', 1],
[:T_TEXT, 'style>', 1],
diff --git a/spec/oga/xml/lexer/html_style_spec.rb b/spec/oga/xml/lexer/html_style_spec.rb
index 310ee03..6d47b8f 100644
--- a/spec/oga/xml/lexer/html_style_spec.rb
+++ b/spec/oga/xml/lexer/html_style_spec.rb
@@ -4,7 +4,6 @@ describe Oga::XML::Lexer do
describe 'HTML style elements' do
it 'lexes an empty ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'style', 1],
[:T_ELEM_END, nil, 1]
]
@@ -12,7 +11,6 @@ describe Oga::XML::Lexer do
it 'treats the content of a style tag as plain text' do
lex_html('').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'style', 1],
[:T_TEXT, 'foo ', 1],
[:T_TEXT, '<', 1],
@@ -23,7 +21,6 @@ describe Oga::XML::Lexer do
it 'treats script tags inside style tags as text' do
lex_html('').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'style', 1],
[:T_TEXT, '<', 1],
[:T_TEXT, 'script>', 1],
@@ -35,7 +32,6 @@ describe Oga::XML::Lexer do
it 'lexes a multi-line ").should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'style', 1],
[:T_TEXT, "foo\nbar", 1],
[:T_ELEM_END, nil, 2]
@@ -44,7 +40,6 @@ describe Oga::XML::Lexer do
it 'lexes a multi-line ", :html => true).should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'style', 1],
[:T_TEXT, "foo\n", 1],
[:T_TEXT, 'bar', 2],
diff --git a/spec/oga/xml/lexer/html_void_elements_spec.rb b/spec/oga/xml/lexer/html_void_elements_spec.rb
index a0a07f2..0ad6dda 100644
--- a/spec/oga/xml/lexer/html_void_elements_spec.rb
+++ b/spec/oga/xml/lexer/html_void_elements_spec.rb
@@ -4,7 +4,6 @@ describe Oga::XML::Lexer do
describe 'HTML void elements' do
it 'lexes a void element that omits the closing /' do
lex_html(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'link', 1],
[:T_ELEM_END, nil, 1]
]
@@ -12,7 +11,6 @@ describe Oga::XML::Lexer do
it 'lexes a upper case void element' do
lex_html(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, "BR", 1],
[:T_ELEM_END, nil, 1]
]
@@ -20,7 +18,6 @@ describe Oga::XML::Lexer do
it 'lexes text after a void element' do
lex_html(' foo').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'link', 1],
[:T_ELEM_END, nil, 1],
[:T_TEXT, 'foo', 1]
@@ -29,9 +26,7 @@ describe Oga::XML::Lexer do
it 'lexes a void element inside another element' do
lex_html(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'head', 1],
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'link', 1],
[:T_ELEM_END, nil, 1],
[:T_ELEM_END, nil, 1]
@@ -40,9 +35,7 @@ describe Oga::XML::Lexer do
it 'lexes a void element inside another element with whitespace' do
lex_html(" \n").should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'head', 1],
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'link', 1],
[:T_ELEM_END, nil, 1],
[:T_TEXT, "\n", 1],
@@ -52,7 +45,6 @@ describe Oga::XML::Lexer do
it 'lexes a void element with an unquoted attribute value' do
lex_html(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'br', 1],
[:T_ATTR, 'class', 1],
[:T_STRING_SQUOTE, nil, 1],
@@ -65,7 +57,6 @@ describe Oga::XML::Lexer do
describe 'without a space before the closing tag' do
it 'lexes a void element' do
lex_html(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'br', 1],
[:T_ELEM_END, nil, 1]
]
@@ -73,7 +64,6 @@ describe Oga::XML::Lexer do
it 'lexes a void element with an attribute' do
lex_html(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'br', 1],
[:T_ATTR, 'class', 1],
[:T_STRING_DQUOTE, nil, 1],
@@ -85,7 +75,6 @@ describe Oga::XML::Lexer do
it 'lexes a void element with an unquoted attribute value' do
lex_html(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'br', 1],
[:T_ATTR, 'class', 1],
[:T_STRING_SQUOTE, nil, 1],
diff --git a/spec/oga/xml/lexer/inline_javascript_spec.rb b/spec/oga/xml/lexer/inline_javascript_spec.rb
index 36cf4d2..ceb0537 100644
--- a/spec/oga/xml/lexer/inline_javascript_spec.rb
+++ b/spec/oga/xml/lexer/inline_javascript_spec.rb
@@ -8,7 +8,6 @@ describe Oga::XML::Lexer do
it 'lexes inline Javascript' do
lex("").should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'script', 1],
[:T_TEXT, @javascript, 1],
[:T_ELEM_END, nil, 1]
@@ -17,7 +16,6 @@ describe Oga::XML::Lexer do
it 'lexes inline Javascript containing an XML comment' do
lex("").should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'script', 1],
[:T_TEXT, @javascript, 1],
[:T_COMMENT_START, nil, 1],
@@ -29,7 +27,6 @@ describe Oga::XML::Lexer do
it 'lexes inline Javascript containing a CDATA tag' do
lex("").should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'script', 1],
[:T_TEXT, @javascript, 1],
[:T_CDATA_START, nil, 1],
@@ -41,7 +38,6 @@ describe Oga::XML::Lexer do
it 'lexes inline Javascript containing a processing instruction' do
lex("").should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'script', 1],
[:T_TEXT, @javascript, 1],
[:T_PROC_INS_START, nil, 1],
@@ -53,10 +49,8 @@ describe Oga::XML::Lexer do
it 'lexes inline Javascript containing another element' do
lex("").should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'script', 1],
[:T_TEXT, @javascript, 1],
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ELEM_END, nil, 1],
[:T_ELEM_END, nil, 1]
diff --git a/spec/oga/xml/lexer/invalid_elements_spec.rb b/spec/oga/xml/lexer/invalid_elements_spec.rb
index 92ac94e..d6f99ba 100644
--- a/spec/oga/xml/lexer/invalid_elements_spec.rb
+++ b/spec/oga/xml/lexer/invalid_elements_spec.rb
@@ -4,7 +4,6 @@ describe Oga::XML::Lexer do
describe 'invalid elements' do
it 'adds missing closing tags' do
lex('').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'a', 1],
[:T_ELEM_END, nil, 1]
]
@@ -16,7 +15,6 @@ describe Oga::XML::Lexer do
it 'ignores excessive closing tags' do
lex(' ').should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'a', 1],
[:T_ELEM_END, nil, 1]
]
diff --git a/spec/oga/xml/lexer/io_spec.rb b/spec/oga/xml/lexer/io_spec.rb
index a630c6f..e7e0c3c 100644
--- a/spec/oga/xml/lexer/io_spec.rb
+++ b/spec/oga/xml/lexer/io_spec.rb
@@ -6,7 +6,6 @@ describe Oga::XML::Lexer do
io = StringIO.new("\nHello
")
lex(io).should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'p', 1],
[:T_ATTR, 'class', 1],
[:T_STRING_SQUOTE, nil, 1],
@@ -31,7 +30,6 @@ describe Oga::XML::Lexer do
lexer = described_class.new(io)
lexer.lex.should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'foo', 1],
[:T_ATTR, 'bar', 1],
[:T_STRING_SQUOTE, nil, 1],
@@ -47,7 +45,6 @@ describe Oga::XML::Lexer do
lexer = described_class.new(io)
lexer.lex.should == [
- [:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'foo', 1],
[:T_ATTR, 'bar', 1],
[:T_STRING_SQUOTE, nil, 1],