oga 0.3.1-java → 0.3.2-java

Sign up to get free protection for your applications and to get access to all the features.
data/ext/c/lexer.rl CHANGED
@@ -24,6 +24,7 @@ on `ts` and `te`) so the macro ignores this argument.
24
24
 
25
25
  ID id_advance_line;
26
26
  ID id_literal_html_element_p;
27
+ ID id_html;
27
28
 
28
29
  %%machine c_lexer;
29
30
 
@@ -75,6 +76,9 @@ VALUE oga_xml_lexer_advance(VALUE self, VALUE data_block)
75
76
  OgaLexerState *state;
76
77
  int lines;
77
78
 
79
+ /* Whether or not HTML mode is enabled */
80
+ int html_p = rb_funcall(self, id_html, 0) == Qtrue;
81
+
78
82
  /* Make sure that all data passed back to Ruby has the proper encoding. */
79
83
  rb_encoding *encoding = rb_enc_get(data_block);
80
84
 
@@ -90,8 +94,12 @@ VALUE oga_xml_lexer_advance(VALUE self, VALUE data_block)
90
94
  ID id_advance_line = rb_intern("advance_line");
91
95
  ID id_on_attribute = rb_intern("on_attribute");
92
96
  ID id_on_attribute_ns = rb_intern("on_attribute_ns");
93
- ID id_on_cdata = rb_intern("on_cdata");
94
- ID id_on_comment = rb_intern("on_comment");
97
+ ID id_on_cdata_start = rb_intern("on_cdata_start");
98
+ ID id_on_cdata_body = rb_intern("on_cdata_body");
99
+ ID id_on_cdata_end = rb_intern("on_cdata_end");
100
+ ID id_on_comment_start = rb_intern("on_comment_start");
101
+ ID id_on_comment_body = rb_intern("on_comment_body");
102
+ ID id_on_comment_end = rb_intern("on_comment_end");
95
103
  ID id_on_doctype_end = rb_intern("on_doctype_end");
96
104
  ID id_on_doctype_inline = rb_intern("on_doctype_inline");
97
105
  ID id_on_doctype_name = rb_intern("on_doctype_name");
@@ -105,6 +113,7 @@ VALUE oga_xml_lexer_advance(VALUE self, VALUE data_block)
105
113
  ID id_on_proc_ins_end = rb_intern("on_proc_ins_end");
106
114
  ID id_on_proc_ins_name = rb_intern("on_proc_ins_name");
107
115
  ID id_on_proc_ins_start = rb_intern("on_proc_ins_start");
116
+ ID id_on_proc_ins_body = rb_intern("on_proc_ins_body");
108
117
  ID id_on_string_body = rb_intern("on_string_body");
109
118
  ID id_on_string_dquote = rb_intern("on_string_dquote");
110
119
  ID id_on_string_squote = rb_intern("on_string_squote");
@@ -176,6 +185,7 @@ void Init_liboga_xml_lexer()
176
185
 
177
186
  id_advance_line = rb_intern("advance_line");
178
187
  id_literal_html_element_p = rb_intern("literal_html_element?");
188
+ id_html = rb_intern("html");
179
189
 
180
190
  rb_define_method(cLexer, "advance_native", oga_xml_lexer_advance, 1);
181
191
  rb_define_method(cLexer, "reset_native", oga_xml_lexer_reset, 0);
@@ -45,15 +45,18 @@ private static byte[] init__java_lexer_actions_0()
45
45
  return new byte [] {
46
46
  0, 1, 0, 1, 3, 1, 5, 1, 6, 1, 7, 1,
47
47
  8, 1, 9, 1, 10, 1, 11, 1, 12, 1, 13, 1,
48
- 14, 1, 15, 1, 18, 1, 19, 1, 20, 1, 21, 1,
49
- 22, 1, 23, 1, 24, 1, 25, 1, 26, 1, 27, 1,
50
- 28, 1, 29, 1, 30, 1, 31, 1, 32, 1, 33, 1,
51
- 34, 1, 35, 1, 36, 1, 37, 1, 38, 1, 39, 1,
52
- 40, 1, 41, 1, 42, 1, 43, 1, 44, 1, 46, 1,
53
- 47, 1, 48, 1, 51, 1, 52, 1, 53, 1, 54, 1,
54
- 55, 1, 56, 1, 57, 1, 58, 1, 59, 1, 60, 2,
55
- 0, 1, 2, 0, 2, 2, 3, 4, 2, 6, 16, 2,
56
- 6, 17, 2, 6, 49, 2, 6, 50, 3, 6, 0, 45
48
+ 14, 1, 15, 1, 16, 1, 17, 1, 18, 1, 19, 1,
49
+ 20, 1, 23, 1, 24, 1, 25, 1, 26, 1, 27, 1,
50
+ 28, 1, 29, 1, 30, 1, 34, 1, 35, 1, 36, 1,
51
+ 37, 1, 38, 1, 39, 1, 40, 1, 41, 1, 42, 1,
52
+ 43, 1, 44, 1, 45, 1, 46, 1, 47, 1, 48, 1,
53
+ 49, 1, 50, 1, 51, 1, 52, 1, 53, 1, 54, 1,
54
+ 56, 1, 57, 1, 58, 1, 61, 1, 62, 1, 63, 1,
55
+ 64, 1, 65, 1, 66, 1, 67, 1, 68, 1, 69, 1,
56
+ 70, 2, 0, 1, 2, 0, 2, 2, 0, 33, 2, 3,
57
+ 4, 2, 6, 0, 2, 6, 21, 2, 6, 22, 2, 6,
58
+ 59, 2, 6, 60, 2, 31, 0, 2, 32, 0, 3, 6,
59
+ 0, 55
57
60
  };
58
61
  }
59
62
 
@@ -63,13 +66,13 @@ private static final byte _java_lexer_actions[] = init__java_lexer_actions_0();
63
66
  private static short[] init__java_lexer_key_offsets_0()
64
67
  {
65
68
  return new short [] {
66
- 0, 0, 4, 5, 6, 7, 9, 11, 13, 15, 17, 19,
67
- 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 41,
68
- 51, 60, 61, 62, 73, 75, 83, 92, 101, 102, 103, 104,
69
- 105, 106, 107, 108, 109, 125, 133, 142, 151, 160, 169, 178,
70
- 187, 196, 205, 214, 223, 234, 242, 243, 251, 260, 277, 278,
71
- 287, 288, 289, 300, 311, 312, 313, 315, 317, 320, 322, 324,
72
- 326, 328, 330, 332, 334
69
+ 0, 0, 4, 5, 7, 9, 11, 13, 15, 17, 19, 20,
70
+ 21, 22, 23, 24, 25, 33, 43, 52, 53, 54, 55, 56,
71
+ 67, 69, 77, 86, 95, 96, 97, 98, 99, 100, 101, 102,
72
+ 103, 104, 105, 106, 107, 108, 109, 110, 126, 134, 143, 152,
73
+ 161, 170, 179, 188, 197, 206, 215, 224, 235, 243, 244, 252,
74
+ 261, 270, 279, 281, 296, 297, 306, 307, 308, 319, 330, 331,
75
+ 332, 334, 336, 339, 341, 343, 345, 347, 349, 351, 353
73
76
  };
74
77
  }
75
78
 
@@ -79,35 +82,36 @@ private static final short _java_lexer_key_offsets[] = init__java_lexer_key_offs
79
82
  private static char[] init__java_lexer_trans_keys_0()
80
83
  {
81
84
  return new char [] {
82
- 45, 68, 91, 100, 45, 45, 45, 45, 62, 79, 111, 67,
83
- 99, 84, 116, 89, 121, 80, 112, 69, 101, 9, 32, 67,
84
- 68, 65, 84, 65, 91, 93, 93, 62, 93, 45, 95, 48,
85
- 57, 65, 90, 97, 122, 45, 58, 62, 95, 48, 57, 65,
86
- 90, 97, 122, 45, 95, 120, 48, 57, 65, 90, 97, 122,
87
- 62, 60, 33, 45, 47, 63, 95, 48, 57, 65, 90, 97,
88
- 122, 9, 32, 45, 95, 48, 57, 65, 90, 97, 122, 45,
89
- 95, 109, 48, 57, 65, 90, 97, 122, 45, 95, 108, 48,
90
- 57, 65, 90, 97, 122, 63, 62, 39, 39, 34, 34, 93,
91
- 93, 9, 32, 34, 39, 45, 62, 80, 83, 91, 95, 48,
92
- 57, 65, 90, 97, 122, 45, 95, 48, 57, 65, 90, 97,
93
- 122, 45, 85, 95, 48, 57, 65, 90, 97, 122, 45, 66,
94
- 95, 48, 57, 65, 90, 97, 122, 45, 76, 95, 48, 57,
95
- 65, 90, 97, 122, 45, 73, 95, 48, 57, 65, 90, 97,
96
- 122, 45, 67, 95, 48, 57, 65, 90, 97, 122, 45, 89,
97
- 95, 48, 57, 65, 90, 97, 122, 45, 83, 95, 48, 57,
98
- 65, 90, 97, 122, 45, 84, 95, 48, 57, 65, 90, 97,
99
- 122, 45, 69, 95, 48, 57, 65, 90, 97, 122, 45, 77,
100
- 95, 48, 57, 65, 90, 97, 122, 34, 39, 45, 63, 95,
85
+ 45, 68, 91, 100, 45, 79, 111, 67, 99, 84, 116, 89,
86
+ 121, 80, 112, 69, 101, 9, 32, 67, 68, 65, 84, 65,
87
+ 91, 45, 95, 48, 57, 65, 90, 97, 122, 45, 58, 62,
88
+ 95, 48, 57, 65, 90, 97, 122, 45, 95, 120, 48, 57,
89
+ 65, 90, 97, 122, 62, 62, 62, 60, 33, 45, 47, 63,
90
+ 95, 48, 57, 65, 90, 97, 122, 9, 32, 45, 95, 48,
91
+ 57, 65, 90, 97, 122, 45, 95, 109, 48, 57, 65, 90,
92
+ 97, 122, 45, 95, 108, 48, 57, 65, 90, 97, 122, 45,
93
+ 45, 45, 93, 93, 93, 63, 63, 62, 39, 39, 34, 34,
94
+ 93, 93, 9, 32, 34, 39, 45, 62, 80, 83, 91, 95,
101
95
  48, 57, 65, 90, 97, 122, 45, 95, 48, 57, 65, 90,
102
- 97, 122, 62, 45, 95, 48, 57, 65, 90, 97, 122, 45,
103
- 58, 95, 48, 57, 65, 90, 97, 122, 9, 10, 13, 32,
104
- 34, 39, 45, 47, 61, 62, 95, 48, 57, 65, 90, 97,
105
- 122, 10, 45, 58, 95, 48, 57, 65, 90, 97, 122, 60,
106
- 60, 33, 45, 60, 63, 95, 47, 57, 65, 90, 97, 122,
107
- 33, 45, 60, 63, 95, 47, 57, 65, 90, 97, 122, 60,
108
- 60, 47, 60, 60, 115, 60, 99, 116, 60, 114, 60, 105,
109
- 60, 112, 60, 116, 60, 62, 60, 121, 60, 108, 60, 101,
110
- 0
96
+ 97, 122, 45, 85, 95, 48, 57, 65, 90, 97, 122, 45,
97
+ 66, 95, 48, 57, 65, 90, 97, 122, 45, 76, 95, 48,
98
+ 57, 65, 90, 97, 122, 45, 73, 95, 48, 57, 65, 90,
99
+ 97, 122, 45, 67, 95, 48, 57, 65, 90, 97, 122, 45,
100
+ 89, 95, 48, 57, 65, 90, 97, 122, 45, 83, 95, 48,
101
+ 57, 65, 90, 97, 122, 45, 84, 95, 48, 57, 65, 90,
102
+ 97, 122, 45, 69, 95, 48, 57, 65, 90, 97, 122, 45,
103
+ 77, 95, 48, 57, 65, 90, 97, 122, 34, 39, 45, 63,
104
+ 95, 48, 57, 65, 90, 97, 122, 45, 95, 48, 57, 65,
105
+ 90, 97, 122, 62, 45, 95, 48, 57, 65, 90, 97, 122,
106
+ 45, 58, 95, 48, 57, 65, 90, 97, 122, 13, 32, 34,
107
+ 39, 96, 9, 10, 60, 62, 13, 32, 34, 39, 96, 9,
108
+ 10, 60, 62, 34, 39, 9, 10, 13, 32, 45, 47, 61,
109
+ 62, 95, 48, 57, 65, 90, 97, 122, 10, 45, 58, 95,
110
+ 48, 57, 65, 90, 97, 122, 60, 60, 33, 45, 60, 63,
111
+ 95, 47, 57, 65, 90, 97, 122, 33, 45, 60, 63, 95,
112
+ 47, 57, 65, 90, 97, 122, 60, 60, 47, 60, 60, 115,
113
+ 60, 99, 116, 60, 114, 60, 105, 60, 112, 60, 116, 60,
114
+ 62, 60, 121, 60, 108, 60, 101, 0
111
115
  };
112
116
  }
113
117
 
@@ -117,13 +121,13 @@ private static final char _java_lexer_trans_keys[] = init__java_lexer_trans_keys
117
121
  private static byte[] init__java_lexer_single_lengths_0()
118
122
  {
119
123
  return new byte [] {
120
- 0, 4, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2,
121
- 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4,
122
- 3, 1, 1, 5, 2, 2, 3, 3, 1, 1, 1, 1,
123
- 1, 1, 1, 1, 10, 2, 3, 3, 3, 3, 3, 3,
124
- 3, 3, 3, 3, 5, 2, 1, 2, 3, 11, 1, 3,
125
- 1, 1, 5, 5, 1, 1, 2, 2, 3, 2, 2, 2,
126
- 2, 2, 2, 2, 2
124
+ 0, 4, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1,
125
+ 1, 1, 1, 1, 2, 4, 3, 1, 1, 1, 1, 5,
126
+ 2, 2, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1,
127
+ 1, 1, 1, 1, 1, 1, 1, 10, 2, 3, 3, 3,
128
+ 3, 3, 3, 3, 3, 3, 3, 5, 2, 1, 2, 3,
129
+ 5, 5, 2, 9, 1, 3, 1, 1, 5, 5, 1, 1,
130
+ 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2
127
131
  };
128
132
  }
129
133
 
@@ -134,12 +138,12 @@ private static byte[] init__java_lexer_range_lengths_0()
134
138
  {
135
139
  return new byte [] {
136
140
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
137
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3,
138
- 3, 0, 0, 3, 0, 3, 3, 3, 0, 0, 0, 0,
139
- 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3,
140
- 3, 3, 3, 3, 3, 3, 0, 3, 3, 3, 0, 3,
141
- 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0,
142
- 0, 0, 0, 0, 0
141
+ 0, 0, 0, 0, 3, 3, 3, 0, 0, 0, 0, 3,
142
+ 0, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0,
143
+ 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3,
144
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 3, 3,
145
+ 2, 2, 0, 3, 0, 3, 0, 0, 3, 3, 0, 0,
146
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
143
147
  };
144
148
  }
145
149
 
@@ -149,69 +153,57 @@ private static final byte _java_lexer_range_lengths[] = init__java_lexer_range_l
149
153
  private static short[] init__java_lexer_index_offsets_0()
150
154
  {
151
155
  return new short [] {
152
- 0, 0, 5, 7, 9, 11, 14, 17, 20, 23, 26, 29,
153
- 32, 35, 37, 39, 41, 43, 45, 47, 49, 51, 54, 60,
154
- 68, 75, 77, 79, 88, 91, 97, 104, 111, 113, 115, 117,
155
- 119, 121, 123, 125, 127, 141, 147, 154, 161, 168, 175, 182,
156
- 189, 196, 203, 210, 217, 226, 232, 234, 240, 247, 262, 264,
157
- 271, 273, 275, 284, 293, 295, 297, 300, 303, 307, 310, 313,
158
- 316, 319, 322, 325, 328
156
+ 0, 0, 5, 7, 10, 13, 16, 19, 22, 25, 28, 30,
157
+ 32, 34, 36, 38, 40, 46, 54, 61, 63, 65, 67, 69,
158
+ 78, 81, 87, 94, 101, 103, 105, 107, 109, 111, 113, 115,
159
+ 117, 119, 121, 123, 125, 127, 129, 131, 145, 151, 158, 165,
160
+ 172, 179, 186, 193, 200, 207, 214, 221, 230, 236, 238, 244,
161
+ 251, 259, 267, 270, 283, 285, 292, 294, 296, 305, 314, 316,
162
+ 318, 321, 324, 328, 331, 334, 337, 340, 343, 346, 349
159
163
  };
160
164
  }
161
165
 
162
166
  private static final short _java_lexer_index_offsets[] = init__java_lexer_index_offsets_0();
163
167
 
164
168
 
165
- private static byte[] init__java_lexer_indicies_0()
166
- {
167
- return new byte [] {
168
- 1, 2, 3, 2, 0, 4, 0, 5, 4, 6, 4, 6,
169
- 7, 4, 8, 8, 0, 9, 9, 0, 10, 10, 0, 11,
170
- 11, 0, 12, 12, 0, 13, 13, 0, 14, 14, 0, 15,
171
- 0, 16, 0, 17, 0, 18, 0, 19, 0, 20, 0, 21,
172
- 20, 22, 20, 23, 22, 20, 24, 24, 24, 24, 24, 0,
173
- 24, 25, 26, 24, 24, 24, 24, 0, 27, 27, 28, 27,
174
- 27, 27, 0, 29, 30, 32, 31, 34, 35, 25, 36, 35,
175
- 35, 35, 35, 33, 14, 14, 37, 27, 27, 27, 27, 27,
176
- 38, 27, 27, 40, 27, 27, 27, 39, 27, 27, 41, 27,
177
- 27, 27, 39, 43, 42, 45, 44, 47, 46, 48, 46, 50,
178
- 49, 51, 49, 53, 52, 54, 52, 55, 55, 56, 57, 58,
179
- 59, 60, 61, 62, 58, 58, 58, 58, 30, 58, 58, 58,
180
- 58, 58, 63, 58, 65, 58, 58, 58, 58, 64, 58, 66,
181
- 58, 58, 58, 58, 64, 58, 67, 58, 58, 58, 58, 64,
182
- 58, 68, 58, 58, 58, 58, 64, 58, 69, 58, 58, 58,
183
- 58, 64, 58, 70, 58, 58, 58, 58, 64, 58, 71, 58,
184
- 58, 58, 58, 64, 58, 72, 58, 58, 58, 58, 64, 58,
185
- 73, 58, 58, 58, 58, 64, 58, 69, 58, 58, 58, 58,
186
- 64, 75, 76, 77, 78, 77, 77, 77, 77, 74, 77, 77,
187
- 77, 77, 77, 79, 81, 80, 82, 82, 82, 82, 82, 30,
188
- 82, 84, 82, 82, 82, 82, 83, 85, 86, 87, 85, 88,
189
- 89, 90, 91, 85, 92, 90, 90, 90, 90, 30, 86, 93,
190
- 90, 95, 90, 90, 90, 90, 94, 97, 96, 99, 96, 100,
191
- 100, 99, 100, 100, 100, 100, 100, 96, 101, 101, 99, 101,
192
- 101, 101, 101, 101, 96, 103, 102, 103, 102, 106, 103, 102,
193
- 103, 107, 102, 103, 108, 109, 102, 103, 110, 102, 103, 111,
194
- 102, 103, 112, 102, 103, 113, 102, 103, 114, 102, 103, 115,
195
- 102, 103, 116, 102, 103, 113, 102, 0
196
- };
197
- }
198
-
199
- private static final byte _java_lexer_indicies[] = init__java_lexer_indicies_0();
200
-
201
-
202
169
  private static byte[] init__java_lexer_trans_targs_0()
203
170
  {
204
171
  return new byte [] {
205
- 26, 2, 6, 13, 3, 4, 5, 26, 7, 8, 9, 10,
206
- 11, 12, 28, 14, 15, 16, 17, 18, 19, 20, 21, 26,
207
- 23, 22, 26, 29, 30, 57, 0, 26, 27, 26, 1, 26,
208
- 24, 26, 26, 26, 31, 29, 32, 33, 32, 32, 35, 34,
209
- 34, 37, 36, 36, 39, 38, 38, 40, 40, 40, 41, 40,
210
- 42, 47, 40, 40, 40, 43, 44, 45, 46, 41, 48, 49,
211
- 50, 51, 52, 52, 52, 53, 54, 52, 52, 52, 56, 55,
212
- 55, 57, 57, 58, 57, 57, 59, 25, 57, 57, 57, 57,
213
- 61, 63, 60, 62, 60, 60, 65, 66, 64, 64, 67, 68,
214
- 69, 74, 70, 71, 72, 73, 64, 75, 76
172
+ 2, 3, 10, 3, 22, 22, 22, 4, 4, 22, 5, 5,
173
+ 22, 6, 6, 22, 7, 7, 22, 8, 8, 22, 9, 9,
174
+ 22, 24, 24, 22, 11, 22, 12, 22, 13, 22, 14, 22,
175
+ 15, 22, 22, 22, 17, 17, 17, 17, 17, 22, 17, 16,
176
+ 22, 17, 17, 17, 17, 22, 25, 25, 26, 25, 25, 25,
177
+ 22, 28, 28, 31, 31, 63, 0, 23, 22, 1, 22, 16,
178
+ 18, 22, 22, 22, 22, 22, 24, 24, 22, 25, 25, 25,
179
+ 25, 25, 22, 25, 25, 27, 25, 25, 25, 22, 25, 25,
180
+ 25, 25, 25, 25, 22, 30, 29, 28, 29, 19, 28, 33,
181
+ 32, 31, 32, 20, 31, 36, 35, 34, 35, 34, 34, 37,
182
+ 38, 37, 38, 39, 40, 39, 40, 41, 42, 41, 42, 43,
183
+ 43, 43, 43, 44, 43, 45, 50, 43, 44, 44, 44, 44,
184
+ 0, 44, 44, 44, 44, 44, 43, 44, 46, 44, 44, 44,
185
+ 44, 43, 44, 47, 44, 44, 44, 44, 43, 44, 48, 44,
186
+ 44, 44, 44, 43, 44, 49, 44, 44, 44, 44, 43, 44,
187
+ 44, 44, 44, 44, 44, 43, 44, 51, 44, 44, 44, 44,
188
+ 43, 44, 52, 44, 44, 44, 44, 43, 44, 53, 44, 44,
189
+ 44, 44, 43, 44, 54, 44, 44, 44, 44, 43, 44, 44,
190
+ 44, 44, 44, 44, 43, 55, 55, 56, 57, 56, 56, 56,
191
+ 56, 55, 56, 56, 56, 56, 56, 55, 55, 55, 59, 59,
192
+ 59, 59, 59, 0, 59, 58, 59, 59, 59, 59, 58, 60,
193
+ 60, 60, 60, 60, 60, 60, 61, 60, 60, 60, 60, 60,
194
+ 60, 60, 61, 62, 62, 62, 63, 63, 64, 63, 65, 21,
195
+ 63, 63, 65, 65, 65, 65, 0, 63, 63, 65, 63, 65,
196
+ 65, 65, 65, 63, 69, 67, 68, 67, 66, 66, 68, 66,
197
+ 66, 66, 66, 66, 67, 66, 66, 68, 66, 66, 66, 66,
198
+ 66, 67, 72, 71, 72, 71, 73, 72, 71, 72, 74, 71,
199
+ 72, 75, 80, 71, 72, 76, 71, 72, 77, 71, 72, 78,
200
+ 71, 72, 79, 71, 72, 70, 71, 72, 81, 71, 72, 82,
201
+ 71, 72, 79, 71, 22, 22, 22, 22, 22, 22, 22, 22,
202
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 28, 31,
203
+ 22, 22, 22, 22, 22, 28, 28, 31, 31, 34, 34, 37,
204
+ 39, 41, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
205
+ 43, 55, 55, 58, 60, 63, 63, 66, 66, 66, 70, 70,
206
+ 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 0
215
207
  };
216
208
  }
217
209
 
@@ -221,16 +213,41 @@ private static final byte _java_lexer_trans_targs[] = init__java_lexer_trans_tar
221
213
  private static short[] init__java_lexer_trans_actions_0()
222
214
  {
223
215
  return new short [] {
224
- 103, 0, 0, 0, 0, 0, 0, 87, 0, 0, 0, 0,
225
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89,
226
- 0, 0, 93, 125, 0, 69, 0, 95, 7, 101, 0, 91,
227
- 0, 97, 105, 99, 0, 122, 11, 0, 13, 9, 1, 15,
228
- 17, 1, 19, 21, 1, 23, 25, 33, 31, 29, 119, 35,
229
- 0, 0, 27, 39, 37, 0, 0, 0, 0, 116, 0, 0,
230
- 0, 0, 47, 45, 43, 0, 0, 49, 51, 41, 0, 55,
231
- 53, 57, 59, 0, 65, 63, 0, 0, 67, 71, 73, 61,
232
- 1, 107, 79, 107, 77, 75, 128, 110, 85, 83, 1, 1,
233
- 1, 1, 1, 1, 1, 1, 81, 1, 1
216
+ 0, 0, 0, 0, 117, 101, 117, 0, 0, 117, 0, 0,
217
+ 117, 0, 0, 117, 0, 0, 117, 0, 0, 117, 0, 0,
218
+ 117, 0, 0, 117, 0, 117, 0, 117, 0, 117, 0, 117,
219
+ 0, 117, 103, 117, 0, 0, 0, 0, 0, 117, 0, 0,
220
+ 107, 0, 0, 0, 0, 117, 145, 145, 0, 145, 145, 145,
221
+ 117, 9, 13, 15, 19, 83, 0, 7, 109, 0, 105, 0,
222
+ 0, 105, 105, 105, 105, 115, 0, 0, 111, 145, 145, 145,
223
+ 145, 145, 119, 145, 145, 0, 145, 145, 145, 113, 145, 145,
224
+ 142, 145, 145, 145, 113, 133, 1, 11, 1, 0, 11, 133,
225
+ 1, 17, 1, 0, 17, 1, 1, 23, 1, 21, 23, 25,
226
+ 1, 27, 1, 29, 1, 31, 1, 33, 1, 35, 1, 43,
227
+ 43, 41, 39, 139, 45, 0, 0, 37, 139, 139, 139, 139,
228
+ 0, 139, 139, 139, 139, 139, 49, 139, 0, 139, 139, 139,
229
+ 139, 47, 139, 0, 139, 139, 139, 139, 47, 139, 0, 139,
230
+ 139, 139, 139, 47, 139, 0, 139, 139, 139, 139, 47, 139,
231
+ 136, 139, 139, 139, 139, 47, 139, 0, 139, 139, 139, 139,
232
+ 47, 139, 0, 139, 139, 139, 139, 47, 139, 0, 139, 139,
233
+ 139, 139, 47, 139, 0, 139, 139, 139, 139, 47, 139, 136,
234
+ 139, 139, 139, 139, 47, 151, 148, 1, 1, 1, 1, 1,
235
+ 1, 127, 0, 0, 0, 0, 0, 53, 51, 55, 0, 0,
236
+ 0, 0, 0, 0, 0, 57, 0, 0, 0, 0, 59, 63,
237
+ 63, 61, 61, 63, 63, 63, 0, 65, 65, 65, 65, 65,
238
+ 65, 65, 0, 69, 67, 71, 73, 75, 0, 73, 0, 0,
239
+ 79, 81, 0, 0, 0, 0, 0, 75, 85, 0, 77, 0,
240
+ 0, 0, 0, 87, 121, 1, 121, 1, 91, 91, 121, 91,
241
+ 91, 91, 91, 91, 1, 89, 89, 121, 89, 89, 89, 89,
242
+ 89, 1, 124, 154, 124, 154, 1, 124, 154, 124, 1, 154,
243
+ 124, 1, 1, 154, 124, 1, 154, 124, 1, 154, 124, 1,
244
+ 154, 124, 1, 154, 124, 95, 154, 124, 1, 154, 124, 1,
245
+ 154, 124, 1, 154, 117, 117, 117, 117, 117, 117, 117, 117,
246
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 13, 19,
247
+ 115, 111, 119, 113, 113, 11, 11, 17, 17, 23, 23, 27,
248
+ 31, 35, 49, 47, 47, 47, 47, 47, 47, 47, 47, 47,
249
+ 47, 53, 55, 59, 65, 85, 87, 93, 93, 93, 99, 97,
250
+ 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0
234
251
  };
235
252
  }
236
253
 
@@ -241,12 +258,12 @@ private static short[] init__java_lexer_to_state_actions_0()
241
258
  {
242
259
  return new short [] {
243
260
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
244
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
245
- 0, 0, 3, 0, 0, 0, 0, 0, 3, 0, 3, 0,
246
- 3, 0, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0,
247
- 0, 0, 0, 0, 3, 0, 0, 3, 0, 3, 0, 0,
248
- 3, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0,
249
- 0, 0, 0, 0, 0
261
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
262
+ 0, 0, 0, 0, 3, 0, 0, 3, 0, 0, 3, 0,
263
+ 0, 3, 0, 3, 0, 3, 0, 3, 0, 0, 0, 0,
264
+ 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 3, 0,
265
+ 3, 0, 3, 3, 0, 0, 3, 0, 0, 0, 130, 0,
266
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
250
267
  };
251
268
  }
252
269
 
@@ -257,12 +274,12 @@ private static short[] init__java_lexer_from_state_actions_0()
257
274
  {
258
275
  return new short [] {
259
276
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
260
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
261
- 0, 0, 5, 0, 0, 0, 0, 0, 5, 0, 5, 0,
262
- 5, 0, 5, 0, 5, 0, 0, 0, 0, 0, 0, 0,
263
- 0, 0, 0, 0, 5, 0, 0, 5, 0, 5, 0, 0,
264
- 5, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,
265
- 0, 0, 0, 0, 0
277
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0,
278
+ 0, 0, 0, 0, 5, 0, 0, 5, 0, 0, 5, 0,
279
+ 0, 5, 0, 5, 0, 5, 0, 5, 0, 0, 0, 0,
280
+ 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 5, 0,
281
+ 5, 0, 5, 5, 0, 0, 5, 0, 0, 0, 5, 0,
282
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
266
283
  };
267
284
  }
268
285
 
@@ -272,34 +289,38 @@ private static final short _java_lexer_from_state_actions[] = init__java_lexer_f
272
289
  private static short[] init__java_lexer_eof_trans_0()
273
290
  {
274
291
  return new short [] {
275
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
276
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
277
- 1, 0, 0, 34, 38, 39, 40, 40, 0, 45, 0, 49,
278
- 0, 52, 0, 55, 0, 64, 65, 65, 65, 65, 65, 65,
279
- 65, 65, 65, 65, 0, 80, 81, 0, 84, 0, 94, 95,
280
- 0, 99, 99, 99, 0, 105, 106, 106, 106, 106, 106, 106,
281
- 106, 106, 106, 106, 106
292
+ 0, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370,
293
+ 370, 370, 370, 370, 370, 370, 370, 371, 372, 0, 0, 373,
294
+ 374, 375, 377, 377, 0, 379, 379, 0, 381, 381, 0, 383,
295
+ 383, 0, 384, 0, 385, 0, 386, 0, 387, 397, 397, 397,
296
+ 397, 397, 397, 397, 397, 397, 397, 0, 398, 399, 0, 400,
297
+ 0, 401, 0, 0, 402, 403, 0, 406, 406, 406, 0, 407,
298
+ 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418
282
299
  };
283
300
  }
284
301
 
285
302
  private static final short _java_lexer_eof_trans[] = init__java_lexer_eof_trans_0();
286
303
 
287
304
 
288
- static final int java_lexer_start = 26;
289
- static final int java_lexer_first_final = 26;
305
+ static final int java_lexer_start = 22;
306
+ static final int java_lexer_first_final = 22;
290
307
  static final int java_lexer_error = 0;
291
308
 
292
- static final int java_lexer_en_proc_ins_body = 32;
293
- static final int java_lexer_en_string_squote = 34;
294
- static final int java_lexer_en_string_dquote = 36;
295
- static final int java_lexer_en_doctype_inline = 38;
296
- static final int java_lexer_en_doctype = 40;
297
- static final int java_lexer_en_xml_decl = 52;
298
- static final int java_lexer_en_element_name = 55;
299
- static final int java_lexer_en_element_head = 57;
300
- static final int java_lexer_en_text = 60;
301
- static final int java_lexer_en_literal_html_element = 64;
302
- static final int java_lexer_en_main = 26;
309
+ static final int java_lexer_en_comment_body = 28;
310
+ static final int java_lexer_en_cdata_body = 31;
311
+ static final int java_lexer_en_proc_ins_body = 34;
312
+ static final int java_lexer_en_string_squote = 37;
313
+ static final int java_lexer_en_string_dquote = 39;
314
+ static final int java_lexer_en_doctype_inline = 41;
315
+ static final int java_lexer_en_doctype = 43;
316
+ static final int java_lexer_en_xml_decl = 55;
317
+ static final int java_lexer_en_element_name = 58;
318
+ static final int java_lexer_en_html_attribute_value = 60;
319
+ static final int java_lexer_en_xml_attribute_value = 62;
320
+ static final int java_lexer_en_element_head = 63;
321
+ static final int java_lexer_en_text = 66;
322
+ static final int java_lexer_en_literal_html_element = 70;
323
+ static final int java_lexer_en_main = 22;
303
324
 
304
325
 
305
326
  // line 39 "ext/java/org/liboga/xml/Lexer.rl"
@@ -356,6 +377,8 @@ static final int java_lexer_en_main = 26;
356
377
  @JRubyMethod
357
378
  public IRubyObject advance_native(ThreadContext context, RubyString rb_str)
358
379
  {
380
+ Boolean html_p = this.callMethod(context, "html").isTrue();
381
+
359
382
  Encoding encoding = rb_str.getEncoding();
360
383
 
361
384
  byte[] data = rb_str.getBytes();
@@ -371,8 +394,12 @@ static final int java_lexer_en_main = 26;
371
394
  String id_advance_line = "advance_line";
372
395
  String id_on_attribute = "on_attribute";
373
396
  String id_on_attribute_ns = "on_attribute_ns";
374
- String id_on_cdata = "on_cdata";
375
- String id_on_comment = "on_comment";
397
+ String id_on_cdata_start = "on_cdata_start";
398
+ String id_on_cdata_body = "on_cdata_body";
399
+ String id_on_cdata_end = "on_cdata_end";
400
+ String id_on_comment_start = "on_comment_start";
401
+ String id_on_comment_body = "on_comment_body";
402
+ String id_on_comment_end = "on_comment_end";
376
403
  String id_on_doctype_end = "on_doctype_end";
377
404
  String id_on_doctype_inline = "on_doctype_inline";
378
405
  String id_on_doctype_name = "on_doctype_name";
@@ -386,6 +413,7 @@ static final int java_lexer_en_main = 26;
386
413
  String id_on_proc_ins_end = "on_proc_ins_end";
387
414
  String id_on_proc_ins_name = "on_proc_ins_name";
388
415
  String id_on_proc_ins_start = "on_proc_ins_start";
416
+ String id_on_proc_ins_body = "on_proc_ins_body";
389
417
  String id_on_string_body = "on_string_body";
390
418
  String id_on_string_dquote = "on_string_dquote";
391
419
  String id_on_string_squote = "on_string_squote";
@@ -394,7 +422,7 @@ static final int java_lexer_en_main = 26;
394
422
  String id_on_xml_decl_start = "on_xml_decl_start";
395
423
 
396
424
 
397
- // line 398 "ext/java/org/liboga/xml/Lexer.java"
425
+ // line 426 "ext/java/org/liboga/xml/Lexer.java"
398
426
  {
399
427
  int _klen;
400
428
  int _trans = 0;
@@ -423,7 +451,7 @@ case 1:
423
451
  // line 1 "NONE"
424
452
  {ts = p;}
425
453
  break;
426
- // line 427 "ext/java/org/liboga/xml/Lexer.java"
454
+ // line 455 "ext/java/org/liboga/xml/Lexer.java"
427
455
  }
428
456
  }
429
457
 
@@ -476,7 +504,6 @@ case 1:
476
504
  }
477
505
  } while (false);
478
506
 
479
- _trans = _java_lexer_indicies[_trans];
480
507
  case 3:
481
508
  ( this.cs) = _java_lexer_trans_targs[_trans];
482
509
 
@@ -494,11 +521,11 @@ case 3:
494
521
  }
495
522
  break;
496
523
  case 1:
497
- // line 385 "ext/ragel/base_lexer.rl"
524
+ // line 500 "ext/ragel/base_lexer.rl"
498
525
  { mark = p; }
499
526
  break;
500
527
  case 2:
501
- // line 420 "ext/ragel/base_lexer.rl"
528
+ // line 535 "ext/ragel/base_lexer.rl"
502
529
  { mark = p; }
503
530
  break;
504
531
  case 6:
@@ -506,34 +533,104 @@ case 3:
506
533
  {te = p+1;}
507
534
  break;
508
535
  case 7:
509
- // line 116 "ext/ragel/base_lexer.rl"
536
+ // line 92 "ext/ragel/base_lexer.rl"
510
537
  {te = p+1;{
511
- callback(id_on_text, data, encoding, mark, ts);
512
- callback_simple(id_on_proc_ins_end);
513
-
514
- mark = 0;
538
+ callback_simple(id_on_comment_end);
515
539
 
516
- ( this.cs) = 26;
540
+ ( this.cs) = 22;
517
541
  }}
518
542
  break;
519
543
  case 8:
520
- // line 125 "ext/ragel/base_lexer.rl"
521
- {te = p+1;}
544
+ // line 81 "ext/ragel/base_lexer.rl"
545
+ {te = p;p--;{
546
+ callback(id_on_comment_body, data, encoding, ts, te);
547
+
548
+ if ( lines > 0 )
549
+ {
550
+ advance_line(lines);
551
+
552
+ lines = 0;
553
+ }
554
+ }}
522
555
  break;
523
556
  case 9:
524
- // line 125 "ext/ragel/base_lexer.rl"
525
- {te = p;p--;}
557
+ // line 81 "ext/ragel/base_lexer.rl"
558
+ {{p = ((te))-1;}{
559
+ callback(id_on_comment_body, data, encoding, ts, te);
560
+
561
+ if ( lines > 0 )
562
+ {
563
+ advance_line(lines);
564
+
565
+ lines = 0;
566
+ }
567
+ }}
526
568
  break;
527
569
  case 10:
570
+ // line 131 "ext/ragel/base_lexer.rl"
571
+ {te = p+1;{
572
+ callback_simple(id_on_cdata_end);
573
+
574
+ ( this.cs) = 22;
575
+ }}
576
+ break;
577
+ case 11:
578
+ // line 120 "ext/ragel/base_lexer.rl"
579
+ {te = p;p--;{
580
+ callback(id_on_cdata_body, data, encoding, ts, te);
581
+
582
+ if ( lines > 0 )
583
+ {
584
+ advance_line(lines);
585
+
586
+ lines = 0;
587
+ }
588
+ }}
589
+ break;
590
+ case 12:
591
+ // line 120 "ext/ragel/base_lexer.rl"
592
+ {{p = ((te))-1;}{
593
+ callback(id_on_cdata_body, data, encoding, ts, te);
594
+
595
+ if ( lines > 0 )
596
+ {
597
+ advance_line(lines);
598
+
599
+ lines = 0;
600
+ }
601
+ }}
602
+ break;
603
+ case 13:
604
+ // line 174 "ext/ragel/base_lexer.rl"
605
+ {te = p+1;{
606
+ callback_simple(id_on_proc_ins_end);
607
+
608
+ ( this.cs) = 22;
609
+ }}
610
+ break;
611
+ case 14:
528
612
  // line 163 "ext/ragel/base_lexer.rl"
613
+ {te = p;p--;{
614
+ callback(id_on_proc_ins_body, data, encoding, ts, te);
615
+
616
+ if ( lines > 0 )
617
+ {
618
+ advance_line(lines);
619
+
620
+ lines = 0;
621
+ }
622
+ }}
623
+ break;
624
+ case 15:
625
+ // line 216 "ext/ragel/base_lexer.rl"
529
626
  {te = p+1;{
530
627
  callback_simple(id_on_string_squote);
531
628
 
532
629
  {( this.cs) = ( this.stack)[--( this.top)];_goto_targ = 2; if (true) continue _goto;}
533
630
  }}
534
631
  break;
535
- case 11:
536
- // line 137 "ext/ragel/base_lexer.rl"
632
+ case 16:
633
+ // line 190 "ext/ragel/base_lexer.rl"
537
634
  {te = p;p--;{
538
635
  callback(id_on_string_body, data, encoding, ts, te);
539
636
 
@@ -545,16 +642,16 @@ case 3:
545
642
  }
546
643
  }}
547
644
  break;
548
- case 12:
549
- // line 173 "ext/ragel/base_lexer.rl"
645
+ case 17:
646
+ // line 226 "ext/ragel/base_lexer.rl"
550
647
  {te = p+1;{
551
648
  callback_simple(id_on_string_dquote);
552
649
 
553
650
  {( this.cs) = ( this.stack)[--( this.top)];_goto_targ = 2; if (true) continue _goto;}
554
651
  }}
555
652
  break;
556
- case 13:
557
- // line 137 "ext/ragel/base_lexer.rl"
653
+ case 18:
654
+ // line 190 "ext/ragel/base_lexer.rl"
558
655
  {te = p;p--;{
559
656
  callback(id_on_string_body, data, encoding, ts, te);
560
657
 
@@ -566,12 +663,12 @@ case 3:
566
663
  }
567
664
  }}
568
665
  break;
569
- case 14:
570
- // line 210 "ext/ragel/base_lexer.rl"
571
- {te = p+1;{ ( this.cs) = 40; }}
666
+ case 19:
667
+ // line 263 "ext/ragel/base_lexer.rl"
668
+ {te = p+1;{ ( this.cs) = 43; }}
572
669
  break;
573
- case 15:
574
- // line 199 "ext/ragel/base_lexer.rl"
670
+ case 20:
671
+ // line 252 "ext/ragel/base_lexer.rl"
575
672
  {te = p;p--;{
576
673
  callback(id_on_doctype_inline, data, encoding, ts, te);
577
674
 
@@ -583,60 +680,60 @@ case 3:
583
680
  }
584
681
  }}
585
682
  break;
586
- case 16:
587
- // line 216 "ext/ragel/base_lexer.rl"
588
- {( this.act) = 9;}
683
+ case 21:
684
+ // line 269 "ext/ragel/base_lexer.rl"
685
+ {( this.act) = 13;}
589
686
  break;
590
- case 17:
591
- // line 231 "ext/ragel/base_lexer.rl"
592
- {( this.act) = 14;}
687
+ case 22:
688
+ // line 284 "ext/ragel/base_lexer.rl"
689
+ {( this.act) = 18;}
593
690
  break;
594
- case 18:
595
- // line 221 "ext/ragel/base_lexer.rl"
596
- {te = p+1;{ ( this.cs) = 38; }}
691
+ case 23:
692
+ // line 274 "ext/ragel/base_lexer.rl"
693
+ {te = p+1;{ ( this.cs) = 41; }}
597
694
  break;
598
- case 19:
599
- // line 148 "ext/ragel/base_lexer.rl"
695
+ case 24:
696
+ // line 201 "ext/ragel/base_lexer.rl"
600
697
  {te = p+1;{
601
698
  callback_simple(id_on_string_squote);
602
699
 
603
- {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 34; _goto_targ = 2; if (true) continue _goto;}
700
+ {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 37; _goto_targ = 2; if (true) continue _goto;}
604
701
  }}
605
702
  break;
606
- case 20:
607
- // line 154 "ext/ragel/base_lexer.rl"
703
+ case 25:
704
+ // line 207 "ext/ragel/base_lexer.rl"
608
705
  {te = p+1;{
609
706
  callback_simple(id_on_string_dquote);
610
707
 
611
- {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 36; _goto_targ = 2; if (true) continue _goto;}
708
+ {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 39; _goto_targ = 2; if (true) continue _goto;}
612
709
  }}
613
710
  break;
614
- case 21:
615
- // line 229 "ext/ragel/base_lexer.rl"
711
+ case 26:
712
+ // line 282 "ext/ragel/base_lexer.rl"
616
713
  {te = p+1;}
617
714
  break;
618
- case 22:
619
- // line 235 "ext/ragel/base_lexer.rl"
715
+ case 27:
716
+ // line 288 "ext/ragel/base_lexer.rl"
620
717
  {te = p+1;{
621
718
  callback_simple(id_on_doctype_end);
622
- ( this.cs) = 26;
719
+ ( this.cs) = 22;
623
720
  }}
624
721
  break;
625
- case 23:
626
- // line 231 "ext/ragel/base_lexer.rl"
722
+ case 28:
723
+ // line 284 "ext/ragel/base_lexer.rl"
627
724
  {te = p;p--;{
628
725
  callback(id_on_doctype_name, data, encoding, ts, te);
629
726
  }}
630
727
  break;
631
- case 24:
728
+ case 29:
632
729
  // line 1 "NONE"
633
730
  { switch( ( this.act) ) {
634
- case 9:
731
+ case 13:
635
732
  {{p = ((te))-1;}
636
733
  callback(id_on_doctype_type, data, encoding, ts, te);
637
734
  }
638
735
  break;
639
- case 14:
736
+ case 18:
640
737
  {{p = ((te))-1;}
641
738
  callback(id_on_doctype_name, data, encoding, ts, te);
642
739
  }
@@ -644,124 +741,183 @@ case 3:
644
741
  }
645
742
  }
646
743
  break;
647
- case 25:
648
- // line 255 "ext/ragel/base_lexer.rl"
744
+ case 30:
745
+ // line 308 "ext/ragel/base_lexer.rl"
649
746
  {te = p+1;{
747
+ if ( lines > 0 )
748
+ {
749
+ advance_line(lines);
750
+
751
+ lines = 0;
752
+ }
753
+
650
754
  callback_simple(id_on_xml_decl_end);
651
- ( this.cs) = 26;
755
+
756
+ ( this.cs) = 22;
652
757
  }}
653
758
  break;
654
- case 26:
655
- // line 148 "ext/ragel/base_lexer.rl"
759
+ case 31:
760
+ // line 201 "ext/ragel/base_lexer.rl"
656
761
  {te = p+1;{
657
762
  callback_simple(id_on_string_squote);
658
763
 
659
- {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 34; _goto_targ = 2; if (true) continue _goto;}
764
+ {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 37; _goto_targ = 2; if (true) continue _goto;}
660
765
  }}
661
766
  break;
662
- case 27:
663
- // line 154 "ext/ragel/base_lexer.rl"
767
+ case 32:
768
+ // line 207 "ext/ragel/base_lexer.rl"
664
769
  {te = p+1;{
665
770
  callback_simple(id_on_string_dquote);
666
771
 
667
- {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 36; _goto_targ = 2; if (true) continue _goto;}
772
+ {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 39; _goto_targ = 2; if (true) continue _goto;}
668
773
  }}
669
774
  break;
670
- case 28:
671
- // line 268 "ext/ragel/base_lexer.rl"
775
+ case 33:
776
+ // line 336 "ext/ragel/base_lexer.rl"
672
777
  {te = p+1;}
673
778
  break;
674
- case 29:
675
- // line 261 "ext/ragel/base_lexer.rl"
779
+ case 34:
780
+ // line 322 "ext/ragel/base_lexer.rl"
676
781
  {te = p;p--;{
782
+ if ( lines > 0 )
783
+ {
784
+ advance_line(lines);
785
+
786
+ lines = 0;
787
+ }
788
+
677
789
  callback(id_on_attribute, data, encoding, ts, te);
678
790
  }}
679
791
  break;
680
- case 30:
681
- // line 268 "ext/ragel/base_lexer.rl"
792
+ case 35:
793
+ // line 336 "ext/ragel/base_lexer.rl"
682
794
  {te = p;p--;}
683
795
  break;
684
- case 31:
685
- // line 295 "ext/ragel/base_lexer.rl"
796
+ case 36:
797
+ // line 363 "ext/ragel/base_lexer.rl"
686
798
  {te = p+1;{
687
799
  callback(id_on_element_ns, data, encoding, ts, te - 1);
688
800
  }}
689
801
  break;
690
- case 32:
691
- // line 299 "ext/ragel/base_lexer.rl"
802
+ case 37:
803
+ // line 367 "ext/ragel/base_lexer.rl"
692
804
  {te = p;p--;{
693
805
  callback(id_on_element_name, data, encoding, ts, te);
694
- ( this.cs) = 57;
806
+ ( this.cs) = 63;
695
807
  }}
696
808
  break;
697
- case 33:
698
- // line 308 "ext/ragel/base_lexer.rl"
699
- {te = p+1;}
700
- break;
701
- case 34:
702
- // line 310 "ext/ragel/base_lexer.rl"
809
+ case 38:
810
+ // line 387 "ext/ragel/base_lexer.rl"
703
811
  {te = p+1;{
704
- callback_simple(id_advance_line);
812
+ p--;
813
+ ( this.cs) = 62;
705
814
  }}
706
815
  break;
707
- case 35:
708
- // line 315 "ext/ragel/base_lexer.rl"
816
+ case 39:
817
+ // line 373 "ext/ragel/base_lexer.rl"
709
818
  {te = p+1;{
710
- callback(id_on_attribute_ns, data, encoding, ts, te - 1);
819
+ p--;
820
+ ( this.cs) = 63;
821
+ }}
822
+ break;
823
+ case 40:
824
+ // line 394 "ext/ragel/base_lexer.rl"
825
+ {te = p;p--;{
826
+ callback_simple(id_on_string_squote);
827
+
828
+ callback(id_on_string_body, data, encoding, ts, te);
829
+
830
+ callback_simple(id_on_string_squote);
711
831
  }}
712
832
  break;
713
- case 36:
714
- // line 148 "ext/ragel/base_lexer.rl"
833
+ case 41:
834
+ // line 201 "ext/ragel/base_lexer.rl"
715
835
  {te = p+1;{
716
836
  callback_simple(id_on_string_squote);
717
837
 
718
- {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 34; _goto_targ = 2; if (true) continue _goto;}
838
+ {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 37; _goto_targ = 2; if (true) continue _goto;}
719
839
  }}
720
840
  break;
721
- case 37:
722
- // line 154 "ext/ragel/base_lexer.rl"
841
+ case 42:
842
+ // line 207 "ext/ragel/base_lexer.rl"
723
843
  {te = p+1;{
724
844
  callback_simple(id_on_string_dquote);
725
845
 
726
- {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 36; _goto_targ = 2; if (true) continue _goto;}
846
+ {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 39; _goto_targ = 2; if (true) continue _goto;}
727
847
  }}
728
848
  break;
729
- case 38:
730
- // line 328 "ext/ragel/base_lexer.rl"
849
+ case 43:
850
+ // line 373 "ext/ragel/base_lexer.rl"
851
+ {te = p+1;{
852
+ p--;
853
+ ( this.cs) = 63;
854
+ }}
855
+ break;
856
+ case 44:
857
+ // line 415 "ext/ragel/base_lexer.rl"
858
+ {te = p+1;}
859
+ break;
860
+ case 45:
861
+ // line 417 "ext/ragel/base_lexer.rl"
862
+ {te = p+1;{
863
+ callback_simple(id_advance_line);
864
+ }}
865
+ break;
866
+ case 46:
867
+ // line 422 "ext/ragel/base_lexer.rl"
868
+ {te = p+1;{
869
+ callback(id_on_attribute_ns, data, encoding, ts, te - 1);
870
+ }}
871
+ break;
872
+ case 47:
873
+ // line 431 "ext/ragel/base_lexer.rl"
874
+ {te = p+1;{
875
+ if ( html_p )
876
+ {
877
+ ( this.cs) = 60;
878
+ }
879
+ else
880
+ {
881
+ ( this.cs) = 62;
882
+ }
883
+ }}
884
+ break;
885
+ case 48:
886
+ // line 443 "ext/ragel/base_lexer.rl"
731
887
  {te = p+1;{
732
888
  callback_simple(id_on_element_open_end);
733
889
 
734
890
  if ( literal_html_element_p() )
735
891
  {
736
- ( this.cs) = 64;
892
+ ( this.cs) = 70;
737
893
  }
738
894
  else
739
895
  {
740
- ( this.cs) = 26;
896
+ ( this.cs) = 22;
741
897
  }
742
898
  }}
743
899
  break;
744
- case 39:
745
- // line 342 "ext/ragel/base_lexer.rl"
900
+ case 49:
901
+ // line 457 "ext/ragel/base_lexer.rl"
746
902
  {te = p+1;{
747
903
  callback_simple(id_on_element_end);
748
- ( this.cs) = 26;
904
+ ( this.cs) = 22;
749
905
  }}
750
906
  break;
751
- case 40:
752
- // line 310 "ext/ragel/base_lexer.rl"
907
+ case 50:
908
+ // line 417 "ext/ragel/base_lexer.rl"
753
909
  {te = p;p--;{
754
910
  callback_simple(id_advance_line);
755
911
  }}
756
912
  break;
757
- case 41:
758
- // line 319 "ext/ragel/base_lexer.rl"
913
+ case 51:
914
+ // line 426 "ext/ragel/base_lexer.rl"
759
915
  {te = p;p--;{
760
916
  callback(id_on_attribute, data, encoding, ts, te);
761
917
  }}
762
918
  break;
763
- case 42:
764
- // line 371 "ext/ragel/base_lexer.rl"
919
+ case 52:
920
+ // line 486 "ext/ragel/base_lexer.rl"
765
921
  {te = p+1;{
766
922
  callback(id_on_text, data, encoding, ts, te);
767
923
 
@@ -772,11 +928,11 @@ case 3:
772
928
  lines = 0;
773
929
  }
774
930
 
775
- ( this.cs) = 26;
931
+ ( this.cs) = 22;
776
932
  }}
777
933
  break;
778
- case 43:
779
- // line 385 "ext/ragel/base_lexer.rl"
934
+ case 53:
935
+ // line 500 "ext/ragel/base_lexer.rl"
780
936
  {te = p+1;{
781
937
  callback(id_on_text, data, encoding, ts, mark);
782
938
 
@@ -790,11 +946,11 @@ case 3:
790
946
  lines = 0;
791
947
  }
792
948
 
793
- ( this.cs) = 26;
949
+ ( this.cs) = 22;
794
950
  }}
795
951
  break;
796
- case 44:
797
- // line 371 "ext/ragel/base_lexer.rl"
952
+ case 54:
953
+ // line 486 "ext/ragel/base_lexer.rl"
798
954
  {te = p;p--;{
799
955
  callback(id_on_text, data, encoding, ts, te);
800
956
 
@@ -805,15 +961,15 @@ case 3:
805
961
  lines = 0;
806
962
  }
807
963
 
808
- ( this.cs) = 26;
964
+ ( this.cs) = 22;
809
965
  }}
810
966
  break;
811
- case 45:
812
- // line 409 "ext/ragel/base_lexer.rl"
813
- {( this.act) = 33;}
967
+ case 55:
968
+ // line 524 "ext/ragel/base_lexer.rl"
969
+ {( this.act) = 42;}
814
970
  break;
815
- case 46:
816
- // line 420 "ext/ragel/base_lexer.rl"
971
+ case 56:
972
+ // line 535 "ext/ragel/base_lexer.rl"
817
973
  {te = p+1;{
818
974
  callback(id_on_text, data, encoding, ts, mark);
819
975
 
@@ -827,11 +983,11 @@ case 3:
827
983
  lines = 0;
828
984
  }
829
985
 
830
- ( this.cs) = 26;
986
+ ( this.cs) = 22;
831
987
  }}
832
988
  break;
833
- case 47:
834
- // line 409 "ext/ragel/base_lexer.rl"
989
+ case 57:
990
+ // line 524 "ext/ragel/base_lexer.rl"
835
991
  {te = p;p--;{
836
992
  callback(id_on_text, data, encoding, ts, te);
837
993
 
@@ -843,13 +999,13 @@ case 3:
843
999
  }
844
1000
  }}
845
1001
  break;
846
- case 48:
1002
+ case 58:
847
1003
  // line 1 "NONE"
848
1004
  { switch( ( this.act) ) {
849
1005
  case 0:
850
1006
  {{( this.cs) = 0; _goto_targ = 2; if (true) continue _goto;}}
851
1007
  break;
852
- case 33:
1008
+ case 42:
853
1009
  {{p = ((te))-1;}
854
1010
  callback(id_on_text, data, encoding, ts, te);
855
1011
 
@@ -864,102 +1020,102 @@ case 3:
864
1020
  }
865
1021
  }
866
1022
  break;
867
- case 49:
868
- // line 248 "ext/ragel/base_lexer.rl"
869
- {( this.act) = 36;}
1023
+ case 59:
1024
+ // line 301 "ext/ragel/base_lexer.rl"
1025
+ {( this.act) = 45;}
870
1026
  break;
871
- case 50:
872
- // line 106 "ext/ragel/base_lexer.rl"
873
- {( this.act) = 39;}
1027
+ case 60:
1028
+ // line 155 "ext/ragel/base_lexer.rl"
1029
+ {( this.act) = 48;}
874
1030
  break;
875
- case 51:
876
- // line 72 "ext/ragel/base_lexer.rl"
1031
+ case 61:
1032
+ // line 74 "ext/ragel/base_lexer.rl"
877
1033
  {te = p+1;{
878
- callback(id_on_comment, data, encoding, ts + 4, te - 3);
1034
+ callback_simple(id_on_comment_start);
1035
+
1036
+ ( this.cs) = 28;
879
1037
  }}
880
1038
  break;
881
- case 52:
882
- // line 88 "ext/ragel/base_lexer.rl"
1039
+ case 62:
1040
+ // line 113 "ext/ragel/base_lexer.rl"
883
1041
  {te = p+1;{
884
- callback(id_on_cdata, data, encoding, ts + 9, te - 3);
1042
+ callback_simple(id_on_cdata_start);
1043
+
1044
+ ( this.cs) = 31;
885
1045
  }}
886
1046
  break;
887
- case 53:
888
- // line 283 "ext/ragel/base_lexer.rl"
1047
+ case 63:
1048
+ // line 351 "ext/ragel/base_lexer.rl"
889
1049
  {te = p+1;{
890
1050
  callback_simple(id_on_element_start);
891
1051
  p--;
892
- ( this.cs) = 55;
1052
+ ( this.cs) = 58;
893
1053
  }}
894
1054
  break;
895
- case 54:
896
- // line 289 "ext/ragel/base_lexer.rl"
1055
+ case 64:
1056
+ // line 357 "ext/ragel/base_lexer.rl"
897
1057
  {te = p+1;{
898
1058
  callback_simple(id_on_element_end);
899
1059
  }}
900
1060
  break;
901
- case 55:
902
- // line 356 "ext/ragel/base_lexer.rl"
1061
+ case 65:
1062
+ // line 471 "ext/ragel/base_lexer.rl"
903
1063
  {te = p+1;{
904
1064
  p--;
905
- ( this.cs) = 60;
1065
+ ( this.cs) = 66;
906
1066
  }}
907
1067
  break;
908
- case 56:
909
- // line 192 "ext/ragel/base_lexer.rl"
1068
+ case 66:
1069
+ // line 245 "ext/ragel/base_lexer.rl"
910
1070
  {te = p;p--;{
911
1071
  callback_simple(id_on_doctype_start);
912
- ( this.cs) = 40;
1072
+ ( this.cs) = 43;
913
1073
  }}
914
1074
  break;
915
- case 57:
916
- // line 106 "ext/ragel/base_lexer.rl"
1075
+ case 67:
1076
+ // line 155 "ext/ragel/base_lexer.rl"
917
1077
  {te = p;p--;{
918
1078
  callback_simple(id_on_proc_ins_start);
919
1079
  callback(id_on_proc_ins_name, data, encoding, ts + 2, te);
920
1080
 
921
- mark = te;
922
-
923
- ( this.cs) = 32;
1081
+ ( this.cs) = 34;
924
1082
  }}
925
1083
  break;
926
- case 58:
927
- // line 356 "ext/ragel/base_lexer.rl"
1084
+ case 68:
1085
+ // line 471 "ext/ragel/base_lexer.rl"
928
1086
  {te = p;p--;{
929
1087
  p--;
930
- ( this.cs) = 60;
1088
+ ( this.cs) = 66;
931
1089
  }}
932
1090
  break;
933
- case 59:
934
- // line 356 "ext/ragel/base_lexer.rl"
1091
+ case 69:
1092
+ // line 471 "ext/ragel/base_lexer.rl"
935
1093
  {{p = ((te))-1;}{
936
1094
  p--;
937
- ( this.cs) = 60;
1095
+ ( this.cs) = 66;
938
1096
  }}
939
1097
  break;
940
- case 60:
1098
+ case 70:
941
1099
  // line 1 "NONE"
942
1100
  { switch( ( this.act) ) {
943
- case 36:
1101
+ case 45:
944
1102
  {{p = ((te))-1;}
945
1103
  callback_simple(id_on_xml_decl_start);
946
- ( this.cs) = 52;
1104
+ ( this.cs) = 55;
947
1105
  }
948
1106
  break;
949
- case 39:
1107
+ case 48:
950
1108
  {{p = ((te))-1;}
951
1109
  callback_simple(id_on_proc_ins_start);
952
1110
  callback(id_on_proc_ins_name, data, encoding, ts + 2, te);
953
1111
 
954
- mark = te;
955
-
956
- ( this.cs) = 32;
1112
+ ( this.cs) = 34;
957
1113
  }
958
1114
  break;
959
1115
  }
960
1116
  }
961
1117
  break;
962
- // line 963 "ext/java/org/liboga/xml/Lexer.java"
1118
+ // line 1119 "ext/java/org/liboga/xml/Lexer.java"
963
1119
  }
964
1120
  }
965
1121
  }
@@ -977,7 +1133,7 @@ case 2:
977
1133
  // line 1 "NONE"
978
1134
  {( this.act) = 0;}
979
1135
  break;
980
- // line 981 "ext/java/org/liboga/xml/Lexer.java"
1136
+ // line 1137 "ext/java/org/liboga/xml/Lexer.java"
981
1137
  }
982
1138
  }
983
1139
 
@@ -1004,7 +1160,7 @@ case 5:
1004
1160
  break; }
1005
1161
  }
1006
1162
 
1007
- // line 130 "ext/java/org/liboga/xml/Lexer.rl"
1163
+ // line 137 "ext/java/org/liboga/xml/Lexer.rl"
1008
1164
 
1009
1165
  this.lines = lines;
1010
1166
 
@@ -1076,5 +1232,5 @@ case 5:
1076
1232
  }
1077
1233
 
1078
1234
 
1079
- // line 207 "ext/java/org/liboga/xml/Lexer.rl"
1235
+ // line 214 "ext/java/org/liboga/xml/Lexer.rl"
1080
1236