oga 0.2.0-java → 0.2.1-java

Sign up to get free protection for your applications and to get access to all the features.
data/ext/c/lexer.rl CHANGED
@@ -16,14 +16,14 @@ on `ts` and `te`) so the macro ignores this argument.
16
16
  #define callback_simple(name) \
17
17
  liboga_xml_lexer_callback_simple(self, name);
18
18
 
19
- #define oga_ivar_get(owner, name) \
20
- rb_ivar_get(owner, rb_intern(name))
19
+ #define advance_line(amount) \
20
+ rb_funcall(self, id_advance_line, 1, INT2NUM(amount));
21
21
 
22
- #define oga_ivar_set(owner, name, value) \
23
- rb_ivar_set(owner, rb_intern(name), value)
22
+ #define inside_html_script_p() \
23
+ rb_funcall(self, id_inside_html_script_p, 0) == Qtrue
24
24
 
25
- #define advance_line(amount) \
26
- rb_funcall(self, rb_intern("advance_line"), 1, INT2NUM(amount));
25
+ ID id_advance_line;
26
+ ID id_inside_html_script_p;
27
27
 
28
28
  %%machine c_lexer;
29
29
 
@@ -38,16 +38,15 @@ on `ts` and `te`) so the macro ignores this argument.
38
38
  */
39
39
  void liboga_xml_lexer_callback(
40
40
  VALUE self,
41
- const char *name,
41
+ VALUE name,
42
42
  rb_encoding *encoding,
43
43
  const char *ts,
44
44
  const char *te
45
45
  )
46
46
  {
47
- VALUE value = rb_enc_str_new(ts, te - ts, encoding);
48
- VALUE method = rb_intern(name);
47
+ VALUE value = rb_enc_str_new(ts, te - ts, encoding);
49
48
 
50
- rb_funcall(self, method, 1, value);
49
+ rb_funcall(self, name, 1, value);
51
50
  }
52
51
 
53
52
  /**
@@ -57,11 +56,9 @@ void liboga_xml_lexer_callback(
57
56
  * @example
58
57
  * liboga_xml_lexer_callback_simple(self, "on_cdata_start");
59
58
  */
60
- void liboga_xml_lexer_callback_simple(VALUE self, const char *name)
59
+ void liboga_xml_lexer_callback_simple(VALUE self, VALUE name)
61
60
  {
62
- VALUE method = rb_intern(name);
63
-
64
- rb_funcall(self, method, 0);
61
+ rb_funcall(self, name, 0);
65
62
  }
66
63
 
67
64
  %% write data;
@@ -93,6 +90,31 @@ VALUE oga_xml_lexer_advance(VALUE self, VALUE data_block)
93
90
 
94
91
  int lines = state->lines;
95
92
 
93
+ ID id_advance_line = rb_intern("advance_line");
94
+ ID id_on_attribute = rb_intern("on_attribute");
95
+ ID id_on_attribute_ns = rb_intern("on_attribute_ns");
96
+ ID id_on_cdata = rb_intern("on_cdata");
97
+ ID id_on_comment = rb_intern("on_comment");
98
+ ID id_on_doctype_end = rb_intern("on_doctype_end");
99
+ ID id_on_doctype_inline = rb_intern("on_doctype_inline");
100
+ ID id_on_doctype_name = rb_intern("on_doctype_name");
101
+ ID id_on_doctype_start = rb_intern("on_doctype_start");
102
+ ID id_on_doctype_type = rb_intern("on_doctype_type");
103
+ ID id_on_element_end = rb_intern("on_element_end");
104
+ ID id_on_element_name = rb_intern("on_element_name");
105
+ ID id_on_element_ns = rb_intern("on_element_ns");
106
+ ID id_on_element_open_end = rb_intern("on_element_open_end");
107
+ ID id_on_element_start = rb_intern("on_element_start");
108
+ ID id_on_proc_ins_end = rb_intern("on_proc_ins_end");
109
+ ID id_on_proc_ins_name = rb_intern("on_proc_ins_name");
110
+ ID id_on_proc_ins_start = rb_intern("on_proc_ins_start");
111
+ ID id_on_string_body = rb_intern("on_string_body");
112
+ ID id_on_string_dquote = rb_intern("on_string_dquote");
113
+ ID id_on_string_squote = rb_intern("on_string_squote");
114
+ ID id_on_text = rb_intern("on_text");
115
+ ID id_on_xml_decl_end = rb_intern("on_xml_decl_end");
116
+ ID id_on_xml_decl_start = rb_intern("on_xml_decl_start");
117
+
96
118
  %% write exec;
97
119
 
98
120
  state->lines = lines;
@@ -151,6 +173,9 @@ void Init_liboga_xml_lexer()
151
173
  VALUE mXML = rb_const_get(mOga, rb_intern("XML"));
152
174
  VALUE cLexer = rb_define_class_under(mXML, "Lexer", rb_cObject);
153
175
 
176
+ id_advance_line = rb_intern("advance_line");
177
+ id_inside_html_script_p = rb_intern("inside_html_script?");
178
+
154
179
  rb_define_method(cLexer, "advance_native", oga_xml_lexer_advance, 1);
155
180
  rb_define_method(cLexer, "reset_native", oga_xml_lexer_reset, 0);
156
181
 
@@ -45,14 +45,15 @@ private static byte[] init__java_lexer_actions_0()
45
45
  return new byte [] {
46
46
  0, 1, 0, 1, 2, 1, 3, 1, 4, 1, 5, 1,
47
47
  6, 1, 7, 1, 8, 1, 9, 1, 10, 1, 11, 1,
48
- 14, 1, 15, 1, 16, 1, 17, 1, 18, 1, 19, 1,
48
+ 12, 1, 13, 1, 16, 1, 17, 1, 18, 1, 19, 1,
49
49
  20, 1, 21, 1, 22, 1, 23, 1, 24, 1, 25, 1,
50
50
  26, 1, 27, 1, 28, 1, 29, 1, 30, 1, 31, 1,
51
51
  32, 1, 33, 1, 34, 1, 35, 1, 36, 1, 37, 1,
52
- 38, 1, 39, 1, 42, 1, 43, 1, 44, 1, 45, 1,
53
- 46, 1, 47, 1, 48, 1, 49, 1, 50, 1, 51, 2,
54
- 0, 1, 2, 4, 12, 2, 4, 13, 2, 4, 40, 2,
55
- 4, 41
52
+ 38, 1, 39, 1, 40, 1, 41, 1, 42, 1, 44, 1,
53
+ 45, 1, 48, 1, 49, 1, 50, 1, 51, 1, 52, 1,
54
+ 53, 1, 54, 1, 55, 1, 56, 1, 57, 2, 0, 1,
55
+ 2, 0, 43, 2, 4, 0, 2, 4, 14, 2, 4, 15,
56
+ 2, 4, 46, 2, 4, 47
56
57
  };
57
58
  }
58
59
 
@@ -64,10 +65,11 @@ private static short[] init__java_lexer_key_offsets_0()
64
65
  return new short [] {
65
66
  0, 0, 4, 5, 6, 7, 9, 11, 13, 15, 17, 19,
66
67
  21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 41,
67
- 51, 60, 60, 61, 62, 63, 64, 75, 77, 85, 94, 103,
68
- 104, 105, 106, 107, 108, 109, 125, 133, 142, 151, 160, 169,
69
- 178, 187, 196, 205, 214, 223, 234, 242, 243, 251, 260, 277,
70
- 286, 287, 288, 299
68
+ 51, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
69
+ 81, 83, 91, 100, 109, 110, 111, 112, 113, 114, 115, 116,
70
+ 117, 133, 141, 150, 159, 168, 177, 186, 195, 204, 213, 222,
71
+ 231, 242, 250, 251, 259, 268, 285, 294, 295, 296, 307, 318,
72
+ 319
71
73
  };
72
74
  }
73
75
 
@@ -82,27 +84,28 @@ private static char[] init__java_lexer_trans_keys_0()
82
84
  68, 65, 84, 65, 91, 93, 93, 62, 93, 45, 95, 48,
83
85
  57, 65, 90, 97, 122, 45, 58, 62, 95, 48, 57, 65,
84
86
  90, 97, 122, 45, 95, 120, 48, 57, 65, 90, 97, 122,
85
- 93, 10, 62, 60, 33, 45, 47, 63, 95, 48, 57, 65,
86
- 90, 97, 122, 9, 32, 45, 95, 48, 57, 65, 90, 97,
87
- 122, 45, 95, 109, 48, 57, 65, 90, 97, 122, 45, 95,
88
- 108, 48, 57, 65, 90, 97, 122, 63, 62, 39, 39, 34,
89
- 34, 9, 32, 34, 39, 45, 62, 80, 83, 91, 95, 48,
90
- 57, 65, 90, 97, 122, 45, 95, 48, 57, 65, 90, 97,
91
- 122, 45, 85, 95, 48, 57, 65, 90, 97, 122, 45, 66,
92
- 95, 48, 57, 65, 90, 97, 122, 45, 76, 95, 48, 57,
93
- 65, 90, 97, 122, 45, 73, 95, 48, 57, 65, 90, 97,
94
- 122, 45, 67, 95, 48, 57, 65, 90, 97, 122, 45, 89,
95
- 95, 48, 57, 65, 90, 97, 122, 45, 83, 95, 48, 57,
96
- 65, 90, 97, 122, 45, 84, 95, 48, 57, 65, 90, 97,
97
- 122, 45, 69, 95, 48, 57, 65, 90, 97, 122, 45, 77,
98
- 95, 48, 57, 65, 90, 97, 122, 34, 39, 45, 63, 95,
99
- 48, 57, 65, 90, 97, 122, 45, 95, 48, 57, 65, 90,
100
- 97, 122, 62, 45, 95, 48, 57, 65, 90, 97, 122, 45,
101
- 58, 95, 48, 57, 65, 90, 97, 122, 9, 10, 13, 32,
102
- 34, 39, 45, 47, 61, 62, 95, 48, 57, 65, 90, 97,
103
- 122, 45, 58, 95, 48, 57, 65, 90, 97, 122, 60, 60,
104
- 33, 45, 60, 63, 95, 47, 57, 65, 90, 97, 122, 33,
105
- 45, 60, 63, 95, 47, 57, 65, 90, 97, 122, 0
87
+ 10, 62, 115, 99, 114, 105, 112, 116, 62, 60, 33, 45,
88
+ 47, 63, 95, 48, 57, 65, 90, 97, 122, 9, 32, 45,
89
+ 95, 48, 57, 65, 90, 97, 122, 45, 95, 109, 48, 57,
90
+ 65, 90, 97, 122, 45, 95, 108, 48, 57, 65, 90, 97,
91
+ 122, 63, 62, 39, 39, 34, 34, 93, 93, 9, 32, 34,
92
+ 39, 45, 62, 80, 83, 91, 95, 48, 57, 65, 90, 97,
93
+ 122, 45, 95, 48, 57, 65, 90, 97, 122, 45, 85, 95,
94
+ 48, 57, 65, 90, 97, 122, 45, 66, 95, 48, 57, 65,
95
+ 90, 97, 122, 45, 76, 95, 48, 57, 65, 90, 97, 122,
96
+ 45, 73, 95, 48, 57, 65, 90, 97, 122, 45, 67, 95,
97
+ 48, 57, 65, 90, 97, 122, 45, 89, 95, 48, 57, 65,
98
+ 90, 97, 122, 45, 83, 95, 48, 57, 65, 90, 97, 122,
99
+ 45, 84, 95, 48, 57, 65, 90, 97, 122, 45, 69, 95,
100
+ 48, 57, 65, 90, 97, 122, 45, 77, 95, 48, 57, 65,
101
+ 90, 97, 122, 34, 39, 45, 63, 95, 48, 57, 65, 90,
102
+ 97, 122, 45, 95, 48, 57, 65, 90, 97, 122, 62, 45,
103
+ 95, 48, 57, 65, 90, 97, 122, 45, 58, 95, 48, 57,
104
+ 65, 90, 97, 122, 9, 10, 13, 32, 34, 39, 45, 47,
105
+ 61, 62, 95, 48, 57, 65, 90, 97, 122, 45, 58, 95,
106
+ 48, 57, 65, 90, 97, 122, 60, 60, 33, 45, 60, 63,
107
+ 95, 47, 57, 65, 90, 97, 122, 33, 45, 60, 63, 95,
108
+ 47, 57, 65, 90, 97, 122, 60, 47, 0
106
109
  };
107
110
  }
108
111
 
@@ -114,10 +117,11 @@ private static byte[] init__java_lexer_single_lengths_0()
114
117
  return new byte [] {
115
118
  0, 4, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2,
116
119
  2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4,
117
- 3, 0, 1, 1, 1, 1, 5, 2, 2, 3, 3, 1,
118
- 1, 1, 1, 1, 1, 10, 2, 3, 3, 3, 3, 3,
119
- 3, 3, 3, 3, 3, 5, 2, 1, 2, 3, 11, 3,
120
- 1, 1, 5, 5
120
+ 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5,
121
+ 2, 2, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1,
122
+ 10, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
123
+ 5, 2, 1, 2, 3, 11, 3, 1, 1, 5, 5, 1,
124
+ 1
121
125
  };
122
126
  }
123
127
 
@@ -129,10 +133,11 @@ private static byte[] init__java_lexer_range_lengths_0()
129
133
  return new byte [] {
130
134
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
131
135
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3,
132
- 3, 0, 0, 0, 0, 0, 3, 0, 3, 3, 3, 0,
133
- 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3,
134
- 3, 3, 3, 3, 3, 3, 3, 0, 3, 3, 3, 3,
135
- 0, 0, 3, 3
136
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
137
+ 0, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0,
138
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
139
+ 3, 3, 0, 3, 3, 3, 3, 0, 0, 3, 3, 0,
140
+ 0
136
141
  };
137
142
  }
138
143
 
@@ -144,10 +149,11 @@ private static short[] init__java_lexer_index_offsets_0()
144
149
  return new short [] {
145
150
  0, 0, 5, 7, 9, 11, 14, 17, 20, 23, 26, 29,
146
151
  32, 35, 37, 39, 41, 43, 45, 47, 49, 51, 54, 60,
147
- 68, 75, 76, 78, 80, 82, 84, 93, 96, 102, 109, 116,
148
- 118, 120, 122, 124, 126, 128, 142, 148, 155, 162, 169, 176,
149
- 183, 190, 197, 204, 211, 218, 227, 233, 235, 241, 248, 263,
150
- 270, 272, 274, 283
152
+ 68, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
153
+ 104, 107, 113, 120, 127, 129, 131, 133, 135, 137, 139, 141,
154
+ 143, 157, 163, 170, 177, 184, 191, 198, 205, 212, 219, 226,
155
+ 233, 242, 248, 250, 256, 263, 278, 285, 287, 289, 298, 307,
156
+ 309
151
157
  };
152
158
  }
153
159
 
@@ -163,25 +169,26 @@ private static byte[] init__java_lexer_indicies_0()
163
169
  0, 16, 0, 17, 0, 18, 0, 19, 0, 20, 0, 21,
164
170
  20, 22, 20, 23, 22, 20, 24, 24, 24, 24, 24, 0,
165
171
  24, 25, 26, 24, 24, 24, 24, 0, 27, 27, 28, 27,
166
- 27, 27, 0, 29, 30, 29, 31, 32, 33, 32, 35, 34,
167
- 37, 38, 25, 39, 38, 38, 38, 38, 36, 14, 14, 40,
168
- 27, 27, 27, 27, 27, 41, 27, 27, 43, 27, 27, 27,
169
- 42, 27, 27, 44, 27, 27, 27, 42, 46, 45, 48, 47,
170
- 50, 49, 51, 49, 53, 52, 54, 52, 55, 55, 56, 57,
171
- 58, 59, 60, 61, 62, 58, 58, 58, 58, 32, 58, 58,
172
- 58, 58, 58, 63, 58, 65, 58, 58, 58, 58, 64, 58,
173
- 66, 58, 58, 58, 58, 64, 58, 67, 58, 58, 58, 58,
174
- 64, 58, 68, 58, 58, 58, 58, 64, 58, 69, 58, 58,
175
- 58, 58, 64, 58, 70, 58, 58, 58, 58, 64, 58, 71,
176
- 58, 58, 58, 58, 64, 58, 72, 58, 58, 58, 58, 64,
177
- 58, 73, 58, 58, 58, 58, 64, 58, 69, 58, 58, 58,
178
- 58, 64, 75, 76, 77, 78, 77, 77, 77, 77, 74, 77,
179
- 77, 77, 77, 77, 79, 81, 80, 82, 82, 82, 82, 82,
180
- 32, 82, 84, 82, 82, 82, 82, 83, 85, 31, 86, 85,
181
- 87, 88, 89, 90, 85, 91, 89, 89, 89, 89, 32, 89,
182
- 93, 89, 89, 89, 89, 92, 95, 94, 97, 94, 98, 98,
183
- 97, 98, 98, 98, 98, 98, 94, 99, 99, 97, 99, 99,
184
- 99, 99, 99, 94, 0
172
+ 27, 27, 0, 29, 30, 31, 30, 33, 32, 34, 32, 35,
173
+ 32, 36, 32, 37, 32, 38, 32, 39, 32, 41, 40, 43,
174
+ 44, 25, 45, 44, 44, 44, 44, 42, 14, 14, 46, 27,
175
+ 27, 27, 27, 27, 47, 27, 27, 49, 27, 27, 27, 48,
176
+ 27, 27, 50, 27, 27, 27, 48, 52, 51, 54, 53, 56,
177
+ 55, 57, 55, 59, 58, 60, 58, 62, 61, 63, 61, 64,
178
+ 64, 65, 66, 67, 68, 69, 70, 71, 67, 67, 67, 67,
179
+ 30, 67, 67, 67, 67, 67, 72, 67, 74, 67, 67, 67,
180
+ 67, 73, 67, 75, 67, 67, 67, 67, 73, 67, 76, 67,
181
+ 67, 67, 67, 73, 67, 77, 67, 67, 67, 67, 73, 67,
182
+ 78, 67, 67, 67, 67, 73, 67, 79, 67, 67, 67, 67,
183
+ 73, 67, 80, 67, 67, 67, 67, 73, 67, 81, 67, 67,
184
+ 67, 67, 73, 67, 82, 67, 67, 67, 67, 73, 67, 78,
185
+ 67, 67, 67, 67, 73, 84, 85, 86, 87, 86, 86, 86,
186
+ 86, 83, 86, 86, 86, 86, 86, 88, 90, 89, 91, 91,
187
+ 91, 91, 91, 30, 91, 93, 91, 91, 91, 91, 92, 94,
188
+ 29, 95, 94, 96, 97, 98, 99, 94, 100, 98, 98, 98,
189
+ 98, 30, 98, 102, 98, 98, 98, 98, 101, 104, 103, 106,
190
+ 103, 107, 107, 106, 107, 107, 107, 107, 107, 103, 108, 108,
191
+ 106, 108, 108, 108, 108, 108, 103, 110, 109, 112, 111, 0
185
192
  };
186
193
  }
187
194
 
@@ -191,15 +198,16 @@ private static final byte _java_lexer_indicies[] = init__java_lexer_indicies_0()
191
198
  private static byte[] init__java_lexer_trans_targs_0()
192
199
  {
193
200
  return new byte [] {
194
- 29, 2, 6, 13, 3, 4, 5, 29, 7, 8, 9, 10,
195
- 11, 12, 31, 14, 15, 16, 17, 18, 19, 20, 21, 29,
196
- 23, 22, 29, 32, 33, 26, 41, 58, 0, 58, 29, 30,
197
- 29, 1, 29, 24, 29, 29, 29, 34, 32, 35, 36, 35,
198
- 35, 38, 37, 37, 40, 39, 39, 41, 41, 41, 42, 41,
199
- 43, 48, 25, 41, 41, 44, 45, 46, 47, 42, 49, 50,
200
- 51, 52, 53, 53, 53, 54, 55, 53, 53, 53, 57, 56,
201
- 56, 58, 27, 58, 58, 59, 28, 58, 58, 58, 61, 63,
202
- 60, 62, 60, 60
201
+ 34, 2, 6, 13, 3, 4, 5, 34, 7, 8, 9, 10,
202
+ 11, 12, 36, 14, 15, 16, 17, 18, 19, 20, 21, 34,
203
+ 23, 22, 34, 37, 38, 65, 0, 65, 71, 28, 29, 30,
204
+ 31, 32, 33, 71, 34, 35, 34, 1, 34, 24, 34, 34,
205
+ 34, 39, 37, 40, 41, 40, 40, 43, 42, 42, 45, 44,
206
+ 44, 47, 46, 46, 48, 48, 48, 49, 48, 50, 55, 48,
207
+ 48, 48, 51, 52, 53, 54, 49, 56, 57, 58, 59, 60,
208
+ 60, 60, 61, 62, 60, 60, 60, 64, 63, 63, 65, 25,
209
+ 65, 65, 66, 26, 65, 65, 65, 68, 70, 67, 69, 67,
210
+ 67, 71, 72, 71, 27
203
211
  };
204
212
  }
205
213
 
@@ -209,15 +217,16 @@ private static final byte _java_lexer_trans_targs[] = init__java_lexer_trans_tar
209
217
  private static byte[] init__java_lexer_trans_actions_0()
210
218
  {
211
219
  return new byte [] {
212
- 91, 0, 0, 0, 0, 0, 0, 75, 0, 0, 0, 0,
213
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77,
214
- 0, 0, 81, 107, 0, 0, 23, 55, 0, 65, 83, 7,
215
- 89, 0, 79, 0, 85, 93, 87, 0, 104, 11, 0, 13,
216
- 9, 1, 15, 17, 1, 19, 21, 29, 27, 25, 101, 31,
217
- 0, 0, 0, 35, 33, 0, 0, 0, 0, 98, 0, 0,
218
- 0, 0, 43, 41, 39, 0, 0, 45, 47, 37, 0, 51,
219
- 49, 53, 0, 61, 59, 0, 0, 63, 67, 57, 1, 95,
220
- 73, 95, 71, 69
220
+ 101, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0,
221
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,
222
+ 0, 0, 91, 123, 0, 59, 0, 69, 83, 0, 0, 0,
223
+ 0, 0, 0, 79, 93, 7, 99, 0, 89, 0, 95, 103,
224
+ 97, 0, 120, 11, 0, 13, 9, 1, 15, 17, 1, 19,
225
+ 21, 1, 23, 25, 33, 31, 29, 117, 35, 0, 0, 27,
226
+ 39, 37, 0, 0, 0, 0, 114, 0, 0, 0, 0, 47,
227
+ 45, 43, 0, 0, 49, 51, 41, 0, 55, 53, 57, 0,
228
+ 65, 63, 0, 0, 67, 71, 61, 1, 105, 77, 105, 75,
229
+ 73, 108, 111, 81, 0
221
230
  };
222
231
  }
223
232
 
@@ -229,10 +238,11 @@ private static byte[] init__java_lexer_to_state_actions_0()
229
238
  return new byte [] {
230
239
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
231
240
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
232
- 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3,
233
- 0, 3, 0, 3, 0, 3, 0, 0, 0, 0, 0, 0,
234
- 0, 0, 0, 0, 0, 3, 0, 0, 3, 0, 3, 0,
235
- 3, 0, 0, 0
241
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
242
+ 0, 0, 0, 0, 3, 0, 3, 0, 3, 0, 3, 0,
243
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
244
+ 3, 0, 0, 3, 0, 3, 0, 3, 0, 0, 0, 3,
245
+ 0
236
246
  };
237
247
  }
238
248
 
@@ -244,10 +254,11 @@ private static byte[] init__java_lexer_from_state_actions_0()
244
254
  return new byte [] {
245
255
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
246
256
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
247
- 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 5,
248
- 0, 5, 0, 5, 0, 5, 0, 0, 0, 0, 0, 0,
249
- 0, 0, 0, 0, 0, 5, 0, 0, 5, 0, 5, 0,
250
- 5, 0, 0, 0
257
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0,
258
+ 0, 0, 0, 0, 5, 0, 5, 0, 5, 0, 5, 0,
259
+ 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
260
+ 5, 0, 0, 5, 0, 5, 0, 5, 0, 0, 0, 5,
261
+ 0
251
262
  };
252
263
  }
253
264
 
@@ -259,29 +270,32 @@ private static short[] init__java_lexer_eof_trans_0()
259
270
  return new short [] {
260
271
  0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
261
272
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
262
- 1, 0, 0, 0, 0, 0, 37, 41, 42, 43, 43, 0,
263
- 48, 0, 52, 0, 55, 0, 64, 65, 65, 65, 65, 65,
264
- 65, 65, 65, 65, 65, 0, 80, 81, 0, 84, 0, 93,
265
- 0, 97, 97, 97
273
+ 1, 0, 0, 33, 33, 33, 33, 33, 33, 33, 0, 43,
274
+ 47, 48, 49, 49, 0, 54, 0, 58, 0, 61, 0, 64,
275
+ 0, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
276
+ 0, 89, 90, 0, 93, 0, 102, 0, 106, 106, 106, 0,
277
+ 112
266
278
  };
267
279
  }
268
280
 
269
281
  private static final short _java_lexer_eof_trans[] = init__java_lexer_eof_trans_0();
270
282
 
271
283
 
272
- static final int java_lexer_start = 29;
273
- static final int java_lexer_first_final = 29;
284
+ static final int java_lexer_start = 34;
285
+ static final int java_lexer_first_final = 34;
274
286
  static final int java_lexer_error = 0;
275
287
 
276
- static final int java_lexer_en_proc_ins_body = 35;
277
- static final int java_lexer_en_string_squote = 37;
278
- static final int java_lexer_en_string_dquote = 39;
279
- static final int java_lexer_en_doctype = 41;
280
- static final int java_lexer_en_xml_decl = 53;
281
- static final int java_lexer_en_element_name = 56;
282
- static final int java_lexer_en_element_head = 58;
283
- static final int java_lexer_en_text = 60;
284
- static final int java_lexer_en_main = 29;
288
+ static final int java_lexer_en_proc_ins_body = 40;
289
+ static final int java_lexer_en_string_squote = 42;
290
+ static final int java_lexer_en_string_dquote = 44;
291
+ static final int java_lexer_en_doctype_inline = 46;
292
+ static final int java_lexer_en_doctype = 48;
293
+ static final int java_lexer_en_xml_decl = 60;
294
+ static final int java_lexer_en_element_name = 63;
295
+ static final int java_lexer_en_element_head = 65;
296
+ static final int java_lexer_en_text = 67;
297
+ static final int java_lexer_en_script_text = 71;
298
+ static final int java_lexer_en_main = 34;
285
299
 
286
300
 
287
301
  // line 39 "ext/java/org/liboga/xml/Lexer.rl"
@@ -350,8 +364,33 @@ static final int java_lexer_en_main = 29;
350
364
  int pe = data.length;
351
365
  int eof = data.length;
352
366
 
367
+ String id_advance_line = "advance_line";
368
+ String id_on_attribute = "on_attribute";
369
+ String id_on_attribute_ns = "on_attribute_ns";
370
+ String id_on_cdata = "on_cdata";
371
+ String id_on_comment = "on_comment";
372
+ String id_on_doctype_end = "on_doctype_end";
373
+ String id_on_doctype_inline = "on_doctype_inline";
374
+ String id_on_doctype_name = "on_doctype_name";
375
+ String id_on_doctype_start = "on_doctype_start";
376
+ String id_on_doctype_type = "on_doctype_type";
377
+ String id_on_element_end = "on_element_end";
378
+ String id_on_element_name = "on_element_name";
379
+ String id_on_element_ns = "on_element_ns";
380
+ String id_on_element_open_end = "on_element_open_end";
381
+ String id_on_element_start = "on_element_start";
382
+ String id_on_proc_ins_end = "on_proc_ins_end";
383
+ String id_on_proc_ins_name = "on_proc_ins_name";
384
+ String id_on_proc_ins_start = "on_proc_ins_start";
385
+ String id_on_string_body = "on_string_body";
386
+ String id_on_string_dquote = "on_string_dquote";
387
+ String id_on_string_squote = "on_string_squote";
388
+ String id_on_text = "on_text";
389
+ String id_on_xml_decl_end = "on_xml_decl_end";
390
+ String id_on_xml_decl_start = "on_xml_decl_start";
391
+
353
392
 
354
- // line 355 "ext/java/org/liboga/xml/Lexer.java"
393
+ // line 394 "ext/java/org/liboga/xml/Lexer.java"
355
394
  {
356
395
  int _klen;
357
396
  int _trans = 0;
@@ -380,7 +419,7 @@ case 1:
380
419
  // line 1 "NONE"
381
420
  {ts = p;}
382
421
  break;
383
- // line 384 "ext/java/org/liboga/xml/Lexer.java"
422
+ // line 423 "ext/java/org/liboga/xml/Lexer.java"
384
423
  }
385
424
  }
386
425
 
@@ -445,13 +484,13 @@ case 3:
445
484
  switch ( _java_lexer_actions[_acts++] )
446
485
  {
447
486
  case 0:
448
- // line 40 "ext/ragel/base_lexer.rl"
487
+ // line 51 "ext/ragel/base_lexer.rl"
449
488
  {
450
489
  if ( data[p] == '\n' ) lines++;
451
490
  }
452
491
  break;
453
492
  case 1:
454
- // line 353 "ext/ragel/base_lexer.rl"
493
+ // line 387 "ext/ragel/base_lexer.rl"
455
494
  { mark = p; }
456
495
  break;
457
496
  case 4:
@@ -459,36 +498,36 @@ case 3:
459
498
  {te = p+1;}
460
499
  break;
461
500
  case 5:
462
- // line 105 "ext/ragel/base_lexer.rl"
501
+ // line 116 "ext/ragel/base_lexer.rl"
463
502
  {te = p+1;{
464
- callback("on_text", data, encoding, mark, ts);
465
- callback_simple("on_proc_ins_end");
503
+ callback(id_on_text, data, encoding, mark, ts);
504
+ callback_simple(id_on_proc_ins_end);
466
505
 
467
506
  mark = 0;
468
507
 
469
- ( this.cs) = 29;
508
+ ( this.cs) = 34;
470
509
  }}
471
510
  break;
472
511
  case 6:
473
- // line 114 "ext/ragel/base_lexer.rl"
512
+ // line 125 "ext/ragel/base_lexer.rl"
474
513
  {te = p+1;}
475
514
  break;
476
515
  case 7:
477
- // line 114 "ext/ragel/base_lexer.rl"
516
+ // line 125 "ext/ragel/base_lexer.rl"
478
517
  {te = p;p--;}
479
518
  break;
480
519
  case 8:
481
- // line 152 "ext/ragel/base_lexer.rl"
520
+ // line 163 "ext/ragel/base_lexer.rl"
482
521
  {te = p+1;{
483
- callback_simple("on_string_squote");
522
+ callback_simple(id_on_string_squote);
484
523
 
485
524
  {( this.cs) = ( this.stack)[--( this.top)];_goto_targ = 2; if (true) continue _goto;}
486
525
  }}
487
526
  break;
488
527
  case 9:
489
- // line 126 "ext/ragel/base_lexer.rl"
528
+ // line 137 "ext/ragel/base_lexer.rl"
490
529
  {te = p;p--;{
491
- callback("on_string_body", data, encoding, ts, te);
530
+ callback(id_on_string_body, data, encoding, ts, te);
492
531
 
493
532
  if ( lines > 0 )
494
533
  {
@@ -499,17 +538,17 @@ case 3:
499
538
  }}
500
539
  break;
501
540
  case 10:
502
- // line 162 "ext/ragel/base_lexer.rl"
541
+ // line 173 "ext/ragel/base_lexer.rl"
503
542
  {te = p+1;{
504
- callback_simple("on_string_dquote");
543
+ callback_simple(id_on_string_dquote);
505
544
 
506
545
  {( this.cs) = ( this.stack)[--( this.top)];_goto_targ = 2; if (true) continue _goto;}
507
546
  }}
508
547
  break;
509
548
  case 11:
510
- // line 126 "ext/ragel/base_lexer.rl"
549
+ // line 137 "ext/ragel/base_lexer.rl"
511
550
  {te = p;p--;{
512
- callback("on_string_body", data, encoding, ts, te);
551
+ callback(id_on_string_body, data, encoding, ts, te);
513
552
 
514
553
  if ( lines > 0 )
515
554
  {
@@ -520,174 +559,199 @@ case 3:
520
559
  }}
521
560
  break;
522
561
  case 12:
523
- // line 189 "ext/ragel/base_lexer.rl"
524
- {( this.act) = 7;}
562
+ // line 210 "ext/ragel/base_lexer.rl"
563
+ {te = p+1;{ ( this.cs) = 48; }}
525
564
  break;
526
565
  case 13:
527
- // line 207 "ext/ragel/base_lexer.rl"
528
- {( this.act) = 12;}
566
+ // line 199 "ext/ragel/base_lexer.rl"
567
+ {te = p;p--;{
568
+ callback(id_on_doctype_inline, data, encoding, ts, te);
569
+
570
+ if ( lines > 0 )
571
+ {
572
+ advance_line(lines);
573
+
574
+ lines = 0;
575
+ }
576
+ }}
529
577
  break;
530
578
  case 14:
531
- // line 195 "ext/ragel/base_lexer.rl"
532
- {te = p+1;{
533
- callback("on_doctype_inline", data, encoding, ts + 1, te - 1);
534
- }}
579
+ // line 216 "ext/ragel/base_lexer.rl"
580
+ {( this.act) = 9;}
535
581
  break;
536
582
  case 15:
537
- // line 137 "ext/ragel/base_lexer.rl"
583
+ // line 231 "ext/ragel/base_lexer.rl"
584
+ {( this.act) = 14;}
585
+ break;
586
+ case 16:
587
+ // line 221 "ext/ragel/base_lexer.rl"
588
+ {te = p+1;{ ( this.cs) = 46; }}
589
+ break;
590
+ case 17:
591
+ // line 148 "ext/ragel/base_lexer.rl"
538
592
  {te = p+1;{
539
- callback_simple("on_string_squote");
593
+ callback_simple(id_on_string_squote);
540
594
 
541
- {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 37; _goto_targ = 2; if (true) continue _goto;}
595
+ {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 42; _goto_targ = 2; if (true) continue _goto;}
542
596
  }}
543
597
  break;
544
- case 16:
545
- // line 143 "ext/ragel/base_lexer.rl"
598
+ case 18:
599
+ // line 154 "ext/ragel/base_lexer.rl"
546
600
  {te = p+1;{
547
- callback_simple("on_string_dquote");
601
+ callback_simple(id_on_string_dquote);
548
602
 
549
- {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 39; _goto_targ = 2; if (true) continue _goto;}
603
+ {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 44; _goto_targ = 2; if (true) continue _goto;}
550
604
  }}
551
605
  break;
552
- case 17:
553
- // line 205 "ext/ragel/base_lexer.rl"
606
+ case 19:
607
+ // line 229 "ext/ragel/base_lexer.rl"
554
608
  {te = p+1;}
555
609
  break;
556
- case 18:
557
- // line 211 "ext/ragel/base_lexer.rl"
610
+ case 20:
611
+ // line 235 "ext/ragel/base_lexer.rl"
558
612
  {te = p+1;{
559
- callback_simple("on_doctype_end");
560
- ( this.cs) = 29;
613
+ callback_simple(id_on_doctype_end);
614
+ ( this.cs) = 34;
561
615
  }}
562
616
  break;
563
- case 19:
564
- // line 207 "ext/ragel/base_lexer.rl"
617
+ case 21:
618
+ // line 231 "ext/ragel/base_lexer.rl"
565
619
  {te = p;p--;{
566
- callback("on_doctype_name", data, encoding, ts, te);
620
+ callback(id_on_doctype_name, data, encoding, ts, te);
567
621
  }}
568
622
  break;
569
- case 20:
623
+ case 22:
570
624
  // line 1 "NONE"
571
625
  { switch( ( this.act) ) {
572
- case 7:
626
+ case 9:
573
627
  {{p = ((te))-1;}
574
- callback("on_doctype_type", data, encoding, ts, te);
628
+ callback(id_on_doctype_type, data, encoding, ts, te);
575
629
  }
576
630
  break;
577
- case 12:
631
+ case 14:
578
632
  {{p = ((te))-1;}
579
- callback("on_doctype_name", data, encoding, ts, te);
633
+ callback(id_on_doctype_name, data, encoding, ts, te);
580
634
  }
581
635
  break;
582
636
  }
583
637
  }
584
638
  break;
585
- case 21:
586
- // line 231 "ext/ragel/base_lexer.rl"
639
+ case 23:
640
+ // line 255 "ext/ragel/base_lexer.rl"
587
641
  {te = p+1;{
588
- callback_simple("on_xml_decl_end");
589
- ( this.cs) = 29;
642
+ callback_simple(id_on_xml_decl_end);
643
+ ( this.cs) = 34;
590
644
  }}
591
645
  break;
592
- case 22:
593
- // line 137 "ext/ragel/base_lexer.rl"
646
+ case 24:
647
+ // line 148 "ext/ragel/base_lexer.rl"
594
648
  {te = p+1;{
595
- callback_simple("on_string_squote");
649
+ callback_simple(id_on_string_squote);
596
650
 
597
- {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 37; _goto_targ = 2; if (true) continue _goto;}
651
+ {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 42; _goto_targ = 2; if (true) continue _goto;}
598
652
  }}
599
653
  break;
600
- case 23:
601
- // line 143 "ext/ragel/base_lexer.rl"
654
+ case 25:
655
+ // line 154 "ext/ragel/base_lexer.rl"
602
656
  {te = p+1;{
603
- callback_simple("on_string_dquote");
657
+ callback_simple(id_on_string_dquote);
604
658
 
605
- {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 39; _goto_targ = 2; if (true) continue _goto;}
659
+ {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 44; _goto_targ = 2; if (true) continue _goto;}
606
660
  }}
607
661
  break;
608
- case 24:
609
- // line 244 "ext/ragel/base_lexer.rl"
662
+ case 26:
663
+ // line 268 "ext/ragel/base_lexer.rl"
610
664
  {te = p+1;}
611
665
  break;
612
- case 25:
613
- // line 237 "ext/ragel/base_lexer.rl"
666
+ case 27:
667
+ // line 261 "ext/ragel/base_lexer.rl"
614
668
  {te = p;p--;{
615
- callback("on_attribute", data, encoding, ts, te);
669
+ callback(id_on_attribute, data, encoding, ts, te);
616
670
  }}
617
671
  break;
618
- case 26:
619
- // line 244 "ext/ragel/base_lexer.rl"
672
+ case 28:
673
+ // line 268 "ext/ragel/base_lexer.rl"
620
674
  {te = p;p--;}
621
675
  break;
622
- case 27:
623
- // line 271 "ext/ragel/base_lexer.rl"
676
+ case 29:
677
+ // line 295 "ext/ragel/base_lexer.rl"
624
678
  {te = p+1;{
625
- callback("on_element_ns", data, encoding, ts, te - 1);
679
+ callback(id_on_element_ns, data, encoding, ts, te - 1);
626
680
  }}
627
681
  break;
628
- case 28:
629
- // line 275 "ext/ragel/base_lexer.rl"
682
+ case 30:
683
+ // line 299 "ext/ragel/base_lexer.rl"
630
684
  {te = p;p--;{
631
- callback("on_element_name", data, encoding, ts, te);
632
- ( this.cs) = 58;
685
+ callback(id_on_element_name, data, encoding, ts, te);
686
+ ( this.cs) = 65;
633
687
  }}
634
688
  break;
635
- case 29:
636
- // line 284 "ext/ragel/base_lexer.rl"
689
+ case 31:
690
+ // line 308 "ext/ragel/base_lexer.rl"
637
691
  {te = p+1;}
638
692
  break;
639
- case 30:
640
- // line 286 "ext/ragel/base_lexer.rl"
693
+ case 32:
694
+ // line 310 "ext/ragel/base_lexer.rl"
641
695
  {te = p+1;{
642
- callback_simple("advance_line");
696
+ callback_simple(id_advance_line);
643
697
  }}
644
698
  break;
645
- case 31:
646
- // line 291 "ext/ragel/base_lexer.rl"
699
+ case 33:
700
+ // line 315 "ext/ragel/base_lexer.rl"
647
701
  {te = p+1;{
648
- callback("on_attribute_ns", data, encoding, ts, te - 1);
702
+ callback(id_on_attribute_ns, data, encoding, ts, te - 1);
649
703
  }}
650
704
  break;
651
- case 32:
652
- // line 137 "ext/ragel/base_lexer.rl"
705
+ case 34:
706
+ // line 148 "ext/ragel/base_lexer.rl"
653
707
  {te = p+1;{
654
- callback_simple("on_string_squote");
708
+ callback_simple(id_on_string_squote);
655
709
 
656
- {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 37; _goto_targ = 2; if (true) continue _goto;}
710
+ {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 42; _goto_targ = 2; if (true) continue _goto;}
657
711
  }}
658
712
  break;
659
- case 33:
660
- // line 143 "ext/ragel/base_lexer.rl"
713
+ case 35:
714
+ // line 154 "ext/ragel/base_lexer.rl"
661
715
  {te = p+1;{
662
- callback_simple("on_string_dquote");
716
+ callback_simple(id_on_string_dquote);
663
717
 
664
- {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 39; _goto_targ = 2; if (true) continue _goto;}
718
+ {( this.stack)[( this.top)++] = ( this.cs); ( this.cs) = 44; _goto_targ = 2; if (true) continue _goto;}
665
719
  }}
666
720
  break;
667
- case 34:
668
- // line 304 "ext/ragel/base_lexer.rl"
721
+ case 36:
722
+ // line 328 "ext/ragel/base_lexer.rl"
669
723
  {te = p+1;{
670
- callback_simple("on_element_open_end");
671
- ( this.cs) = 29;
724
+ callback_simple(id_on_element_open_end);
725
+
726
+ if ( inside_html_script_p() )
727
+ {
728
+ mark = ts + 1;
729
+
730
+ ( this.cs) = 71;
731
+ }
732
+ else
733
+ {
734
+ ( this.cs) = 34;
735
+ }
672
736
  }}
673
737
  break;
674
- case 35:
675
- // line 310 "ext/ragel/base_lexer.rl"
738
+ case 37:
739
+ // line 344 "ext/ragel/base_lexer.rl"
676
740
  {te = p+1;{
677
- callback_simple("on_element_end");
678
- ( this.cs) = 29;
741
+ callback_simple(id_on_element_end);
742
+ ( this.cs) = 34;
679
743
  }}
680
744
  break;
681
- case 36:
682
- // line 295 "ext/ragel/base_lexer.rl"
745
+ case 38:
746
+ // line 319 "ext/ragel/base_lexer.rl"
683
747
  {te = p;p--;{
684
- callback("on_attribute", data, encoding, ts, te);
748
+ callback(id_on_attribute, data, encoding, ts, te);
685
749
  }}
686
750
  break;
687
- case 37:
688
- // line 339 "ext/ragel/base_lexer.rl"
751
+ case 39:
752
+ // line 373 "ext/ragel/base_lexer.rl"
689
753
  {te = p+1;{
690
- callback("on_text", data, encoding, ts, te);
754
+ callback(id_on_text, data, encoding, ts, te);
691
755
 
692
756
  if ( lines > 0 )
693
757
  {
@@ -696,13 +760,13 @@ case 3:
696
760
  lines = 0;
697
761
  }
698
762
 
699
- ( this.cs) = 29;
763
+ ( this.cs) = 34;
700
764
  }}
701
765
  break;
702
- case 38:
703
- // line 353 "ext/ragel/base_lexer.rl"
766
+ case 40:
767
+ // line 387 "ext/ragel/base_lexer.rl"
704
768
  {te = p+1;{
705
- callback("on_text", data, encoding, ts, mark);
769
+ callback(id_on_text, data, encoding, ts, mark);
706
770
 
707
771
  p = mark - 1;
708
772
  mark = 0;
@@ -714,13 +778,13 @@ case 3:
714
778
  lines = 0;
715
779
  }
716
780
 
717
- ( this.cs) = 29;
781
+ ( this.cs) = 34;
718
782
  }}
719
783
  break;
720
- case 39:
721
- // line 339 "ext/ragel/base_lexer.rl"
784
+ case 41:
785
+ // line 373 "ext/ragel/base_lexer.rl"
722
786
  {te = p;p--;{
723
- callback("on_text", data, encoding, ts, te);
787
+ callback(id_on_text, data, encoding, ts, te);
724
788
 
725
789
  if ( lines > 0 )
726
790
  {
@@ -729,105 +793,136 @@ case 3:
729
793
  lines = 0;
730
794
  }
731
795
 
732
- ( this.cs) = 29;
796
+ ( this.cs) = 34;
733
797
  }}
734
798
  break;
735
- case 40:
736
- // line 224 "ext/ragel/base_lexer.rl"
737
- {( this.act) = 32;}
799
+ case 42:
800
+ // line 408 "ext/ragel/base_lexer.rl"
801
+ {te = p+1;{
802
+ callback(id_on_text, data, encoding, mark, ts);
803
+
804
+ mark = 0;
805
+
806
+ if ( lines > 0 )
807
+ {
808
+ advance_line(lines);
809
+
810
+ lines = 0;
811
+ }
812
+
813
+ callback_simple(id_on_element_end);
814
+
815
+ ( this.cs) = 34;
816
+ }}
738
817
  break;
739
- case 41:
740
- // line 95 "ext/ragel/base_lexer.rl"
741
- {( this.act) = 35;}
818
+ case 43:
819
+ // line 425 "ext/ragel/base_lexer.rl"
820
+ {te = p+1;}
742
821
  break;
743
- case 42:
744
- // line 61 "ext/ragel/base_lexer.rl"
822
+ case 44:
823
+ // line 425 "ext/ragel/base_lexer.rl"
824
+ {te = p;p--;}
825
+ break;
826
+ case 45:
827
+ // line 425 "ext/ragel/base_lexer.rl"
828
+ {{p = ((te))-1;}}
829
+ break;
830
+ case 46:
831
+ // line 248 "ext/ragel/base_lexer.rl"
832
+ {( this.act) = 36;}
833
+ break;
834
+ case 47:
835
+ // line 106 "ext/ragel/base_lexer.rl"
836
+ {( this.act) = 39;}
837
+ break;
838
+ case 48:
839
+ // line 72 "ext/ragel/base_lexer.rl"
745
840
  {te = p+1;{
746
- callback("on_comment", data, encoding, ts + 4, te - 3);
841
+ callback(id_on_comment, data, encoding, ts + 4, te - 3);
747
842
  }}
748
843
  break;
749
- case 43:
750
- // line 77 "ext/ragel/base_lexer.rl"
844
+ case 49:
845
+ // line 88 "ext/ragel/base_lexer.rl"
751
846
  {te = p+1;{
752
- callback("on_cdata", data, encoding, ts + 9, te - 3);
847
+ callback(id_on_cdata, data, encoding, ts + 9, te - 3);
753
848
  }}
754
849
  break;
755
- case 44:
756
- // line 259 "ext/ragel/base_lexer.rl"
850
+ case 50:
851
+ // line 283 "ext/ragel/base_lexer.rl"
757
852
  {te = p+1;{
758
- callback_simple("on_element_start");
853
+ callback_simple(id_on_element_start);
759
854
  p--;
760
- ( this.cs) = 56;
855
+ ( this.cs) = 63;
761
856
  }}
762
857
  break;
763
- case 45:
764
- // line 265 "ext/ragel/base_lexer.rl"
858
+ case 51:
859
+ // line 289 "ext/ragel/base_lexer.rl"
765
860
  {te = p+1;{
766
- callback_simple("on_element_end");
861
+ callback_simple(id_on_element_end);
767
862
  }}
768
863
  break;
769
- case 46:
770
- // line 324 "ext/ragel/base_lexer.rl"
864
+ case 52:
865
+ // line 358 "ext/ragel/base_lexer.rl"
771
866
  {te = p+1;{
772
867
  p--;
773
- ( this.cs) = 60;
868
+ ( this.cs) = 67;
774
869
  }}
775
870
  break;
776
- case 47:
777
- // line 181 "ext/ragel/base_lexer.rl"
871
+ case 53:
872
+ // line 192 "ext/ragel/base_lexer.rl"
778
873
  {te = p;p--;{
779
- callback_simple("on_doctype_start");
780
- ( this.cs) = 41;
874
+ callback_simple(id_on_doctype_start);
875
+ ( this.cs) = 48;
781
876
  }}
782
877
  break;
783
- case 48:
784
- // line 95 "ext/ragel/base_lexer.rl"
878
+ case 54:
879
+ // line 106 "ext/ragel/base_lexer.rl"
785
880
  {te = p;p--;{
786
- callback_simple("on_proc_ins_start");
787
- callback("on_proc_ins_name", data, encoding, ts + 2, te);
881
+ callback_simple(id_on_proc_ins_start);
882
+ callback(id_on_proc_ins_name, data, encoding, ts + 2, te);
788
883
 
789
884
  mark = te;
790
885
 
791
- ( this.cs) = 35;
886
+ ( this.cs) = 40;
792
887
  }}
793
888
  break;
794
- case 49:
795
- // line 324 "ext/ragel/base_lexer.rl"
889
+ case 55:
890
+ // line 358 "ext/ragel/base_lexer.rl"
796
891
  {te = p;p--;{
797
892
  p--;
798
- ( this.cs) = 60;
893
+ ( this.cs) = 67;
799
894
  }}
800
895
  break;
801
- case 50:
802
- // line 324 "ext/ragel/base_lexer.rl"
896
+ case 56:
897
+ // line 358 "ext/ragel/base_lexer.rl"
803
898
  {{p = ((te))-1;}{
804
899
  p--;
805
- ( this.cs) = 60;
900
+ ( this.cs) = 67;
806
901
  }}
807
902
  break;
808
- case 51:
903
+ case 57:
809
904
  // line 1 "NONE"
810
905
  { switch( ( this.act) ) {
811
- case 32:
906
+ case 36:
812
907
  {{p = ((te))-1;}
813
- callback_simple("on_xml_decl_start");
814
- ( this.cs) = 53;
908
+ callback_simple(id_on_xml_decl_start);
909
+ ( this.cs) = 60;
815
910
  }
816
911
  break;
817
- case 35:
912
+ case 39:
818
913
  {{p = ((te))-1;}
819
- callback_simple("on_proc_ins_start");
820
- callback("on_proc_ins_name", data, encoding, ts + 2, te);
914
+ callback_simple(id_on_proc_ins_start);
915
+ callback(id_on_proc_ins_name, data, encoding, ts + 2, te);
821
916
 
822
917
  mark = te;
823
918
 
824
- ( this.cs) = 35;
919
+ ( this.cs) = 40;
825
920
  }
826
921
  break;
827
922
  }
828
923
  }
829
924
  break;
830
- // line 831 "ext/java/org/liboga/xml/Lexer.java"
925
+ // line 926 "ext/java/org/liboga/xml/Lexer.java"
831
926
  }
832
927
  }
833
928
  }
@@ -841,7 +936,7 @@ case 2:
841
936
  // line 1 "NONE"
842
937
  {ts = -1;}
843
938
  break;
844
- // line 845 "ext/java/org/liboga/xml/Lexer.java"
939
+ // line 940 "ext/java/org/liboga/xml/Lexer.java"
845
940
  }
846
941
  }
847
942
 
@@ -868,7 +963,7 @@ case 5:
868
963
  break; }
869
964
  }
870
965
 
871
- // line 105 "ext/java/org/liboga/xml/Lexer.rl"
966
+ // line 130 "ext/java/org/liboga/xml/Lexer.rl"
872
967
 
873
968
  this.lines = lines;
874
969
 
@@ -927,8 +1022,19 @@ case 5:
927
1022
 
928
1023
  this.callMethod(context, "advance_line", lines);
929
1024
  }
1025
+
1026
+ /**
1027
+ * Returns true if we're in an HTML script tag. See
1028
+ * Oga::XML::Lexer#inside_html_script? for more information.
1029
+ */
1030
+ public Boolean inside_html_script_p()
1031
+ {
1032
+ ThreadContext context = this.runtime.getCurrentContext();
1033
+
1034
+ return this.callMethod(context, "inside_html_script?").isTrue();
1035
+ }
930
1036
  }
931
1037
 
932
1038
 
933
- // line 172 "ext/java/org/liboga/xml/Lexer.rl"
1039
+ // line 208 "ext/java/org/liboga/xml/Lexer.rl"
934
1040