adamh-hpricot 0.6.171 → 0.6.210

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,10 +20,10 @@ VALUE hpricot_css(VALUE, VALUE, VALUE, VALUE, VALUE);
20
20
  #define NO_WAY_SERIOUSLY "*** This should not happen, please send a bug report with the HTML you're parsing to why@whytheluckystiff.net. So sorry!"
21
21
 
22
22
  static VALUE sym_xmldecl, sym_doctype, sym_procins, sym_stag, sym_etag, sym_emptytag, sym_comment,
23
- sym_cdata, sym_text, sym_EMPTY;
23
+ sym_cdata, sym_text, sym_EMPTY, sym_CDATA;
24
24
  static VALUE mHpricot, rb_eHpricotParseError;
25
25
  static VALUE cBaseEle, cBogusETag, cCData, cComment, cDoc, cDocType, cElem, cETag, cText,
26
- cXMLDecl, cProcIns;
26
+ cXMLDecl, cProcIns, symAllow, symDeny;
27
27
  static ID s_ElementContent;
28
28
  static ID s_downcase, s_new, s_parent, s_read, s_to_str;
29
29
  static ID iv_parent;
@@ -31,7 +31,7 @@ static VALUE reProcInsParse;
31
31
 
32
32
  typedef struct {
33
33
  int name;
34
- VALUE tag, attr, etag, raw;
34
+ VALUE tag, attr, etag, raw, EC;
35
35
  VALUE parent, children;
36
36
  } hpricot_ele;
37
37
 
@@ -216,6 +216,7 @@ hpricot_ele_clear_raw(VALUE self)
216
216
  he->tag = tag; \
217
217
  he->attr = attr; \
218
218
  he->raw = Qnil; \
219
+ he->EC = ec; \
219
220
  he->etag = he->parent = he->children = Qnil; \
220
221
  if (raw != NULL && (sym == sym_emptytag || sym == sym_stag || sym == sym_etag || sym == sym_doctype)) { \
221
222
  he->raw = rb_str_new(raw, rawlen); \
@@ -229,7 +230,7 @@ hpricot_ele_alloc(VALUE klass)
229
230
  VALUE ele;
230
231
  hpricot_ele *he = ALLOC(hpricot_ele);
231
232
  he->name = 0;
232
- he->tag = he->attr = he->raw = Qnil;
233
+ he->tag = he->attr = he->raw = he->EC = Qnil;
233
234
  he->etag = he->parent = he->children = Qnil;
234
235
  ele = Data_Wrap_Struct(klass, hpricot_ele_mark, hpricot_ele_free, he);
235
236
  return ele;
@@ -239,7 +240,7 @@ hpricot_ele_alloc(VALUE klass)
239
240
  // the swift, compact parser logic. most of the complicated stuff is done
240
241
  // in the lexer. this step just pairs up the start and end tags.
241
242
  //
242
- VALUE
243
+ void
243
244
  rb_hpricot_token(hpricot_state *S, VALUE sym, VALUE tag, VALUE attr, char *raw, int rawlen, int taint)
244
245
  {
245
246
  VALUE ele, ec = Qnil;
@@ -248,6 +249,16 @@ rb_hpricot_token(hpricot_state *S, VALUE sym, VALUE tag, VALUE attr, char *raw,
248
249
  // in html mode, fix up start tags incorrectly formed as empty tags
249
250
  //
250
251
  if (!S->xml) {
252
+ hpricot_ele *last;
253
+ Data_Get_Struct(S->focus, hpricot_ele, last);
254
+ if (last->EC == sym_CDATA &&
255
+ (sym != sym_procins && sym != sym_comment && sym != sym_cdata && sym != sym_text) &&
256
+ !(sym == sym_etag && rb_str_hash(tag) == last->name))
257
+ {
258
+ sym = sym_text;
259
+ tag = rb_str_new(raw, rawlen);
260
+ }
261
+
251
262
  if (sym == sym_emptytag || sym == sym_stag || sym == sym_etag) {
252
263
  ec = rb_hash_aref(S->EC, tag);
253
264
  if (NIL_P(ec)) {
@@ -267,6 +278,37 @@ rb_hpricot_token(hpricot_state *S, VALUE sym, VALUE tag, VALUE attr, char *raw,
267
278
  if (sym == sym_emptytag || sym == sym_stag) {
268
279
  H_ELE(cElem);
269
280
  he->name = rb_str_hash(tag);
281
+
282
+ if (!S->xml) {
283
+ VALUE match = Qnil, e = S->focus;
284
+ while (e != S->doc)
285
+ {
286
+ hpricot_ele *hee;
287
+ Data_Get_Struct(e, hpricot_ele, hee);
288
+
289
+ if (TYPE(hee->EC) == T_HASH)
290
+ {
291
+ VALUE has = rb_hash_lookup(hee->EC, INT2NUM(he->name));
292
+ if (has != Qnil) {
293
+ if (has == Qtrue) {
294
+ if (match == Qnil)
295
+ match = e;
296
+ } else if (has == symAllow) {
297
+ match = S->focus;
298
+ } else if (has == symDeny) {
299
+ match = Qnil;
300
+ }
301
+ }
302
+ }
303
+
304
+ e = hee->parent;
305
+ }
306
+
307
+ if (match == Qnil)
308
+ match = S->focus;
309
+ S->focus = match;
310
+ }
311
+
270
312
  rb_hpricot_add(S->focus, ele);
271
313
 
272
314
  //
@@ -293,6 +335,8 @@ rb_hpricot_token(hpricot_state *S, VALUE sym, VALUE tag, VALUE attr, char *raw,
293
335
  // another optimization will be to improve this very simple
294
336
  // O(n) tag search, where n is the depth of the focused tag.
295
337
  //
338
+ // (see also: the search above for fixups)
339
+ //
296
340
  name = rb_str_hash(tag);
297
341
  while (e != S->doc)
298
342
  {
@@ -399,6 +443,7 @@ VALUE hpricot_scan(int argc, VALUE *argv, VALUE self)
399
443
  S->strict = OPT(opts, xhtml_strict);
400
444
  S->fixup = OPT(opts, fixup_tags);
401
445
  if (S->strict) S->fixup = 1;
446
+ rb_ivar_set(S->doc, rb_intern("@options"), opts);
402
447
 
403
448
  S->EC = rb_const_get(mHpricot, s_ElementContent);
404
449
  }
@@ -413,14 +458,14 @@ VALUE hpricot_scan(int argc, VALUE *argv, VALUE self)
413
458
  buf = ALLOC_N(char, buffer_size);
414
459
 
415
460
 
416
- #line 417 "hpricot_scan.c"
461
+ #line 462 "hpricot_scan.c"
417
462
  {
418
463
  cs = hpricot_scan_start;
419
464
  ts = 0;
420
465
  te = 0;
421
466
  act = 0;
422
467
  }
423
- #line 449 "hpricot_scan.rl"
468
+ #line 494 "hpricot_scan.rl"
424
469
 
425
470
  while ( !done ) {
426
471
  VALUE str;
@@ -438,7 +483,7 @@ VALUE hpricot_scan(int argc, VALUE *argv, VALUE self)
438
483
  mark_aval_diff = mark_aval - buf;
439
484
 
440
485
  buffer_size += BUFSIZE;
441
- buf = REALLOC_N(buf, char, buffer_size);
486
+ REALLOC_N(buf, char, buffer_size);
442
487
 
443
488
  space = buffer_size - have;
444
489
 
@@ -452,16 +497,17 @@ VALUE hpricot_scan(int argc, VALUE *argv, VALUE self)
452
497
 
453
498
  if ( rb_respond_to( port, s_read ) )
454
499
  {
455
- str = rb_funcall( port, s_read, 1, INT2FIX(space) );
500
+ str = rb_funcall(port, s_read, 1, INT2FIX(space));
501
+ len = RSTRING_LEN(str);
502
+ memcpy(p, StringValuePtr(str), len);
456
503
  }
457
504
  else
458
505
  {
459
- str = rb_str_substr( port, nread, space );
506
+ len = RSTRING_LEN(port) - nread;
507
+ if (len > space) len = space;
508
+ memcpy(p, StringValuePtr(port) + nread, len);
460
509
  }
461
510
 
462
- StringValue(str);
463
- memcpy( p, RSTRING_PTR(str), RSTRING_LEN(str) );
464
- len = RSTRING_LEN(str);
465
511
  nread += len;
466
512
 
467
513
  /* If this is the last buffer, tack on an EOF. */
@@ -472,7 +518,7 @@ VALUE hpricot_scan(int argc, VALUE *argv, VALUE self)
472
518
 
473
519
  pe = p + len;
474
520
 
475
- #line 476 "hpricot_scan.c"
521
+ #line 522 "hpricot_scan.c"
476
522
  {
477
523
  if ( p == pe )
478
524
  goto _test_eof;
@@ -639,7 +685,7 @@ st204:
639
685
  case 204:
640
686
  #line 1 "hpricot_scan.rl"
641
687
  {ts = p;}
642
- #line 643 "hpricot_scan.c"
688
+ #line 689 "hpricot_scan.c"
643
689
  switch( (*p) ) {
644
690
  case 10: goto tr412;
645
691
  case 60: goto tr413;
@@ -667,7 +713,7 @@ st205:
667
713
  if ( ++p == pe )
668
714
  goto _test_eof205;
669
715
  case 205:
670
- #line 671 "hpricot_scan.c"
716
+ #line 717 "hpricot_scan.c"
671
717
  switch( (*p) ) {
672
718
  case 33: goto st0;
673
719
  case 47: goto st59;
@@ -775,7 +821,7 @@ st10:
775
821
  if ( ++p == pe )
776
822
  goto _test_eof10;
777
823
  case 10:
778
- #line 779 "hpricot_scan.c"
824
+ #line 825 "hpricot_scan.c"
779
825
  switch( (*p) ) {
780
826
  case 32: goto tr13;
781
827
  case 62: goto tr15;
@@ -806,7 +852,7 @@ st11:
806
852
  if ( ++p == pe )
807
853
  goto _test_eof11;
808
854
  case 11:
809
- #line 810 "hpricot_scan.c"
855
+ #line 856 "hpricot_scan.c"
810
856
  switch( (*p) ) {
811
857
  case 32: goto st11;
812
858
  case 62: goto tr18;
@@ -903,7 +949,7 @@ st20:
903
949
  if ( ++p == pe )
904
950
  goto _test_eof20;
905
951
  case 20:
906
- #line 907 "hpricot_scan.c"
952
+ #line 953 "hpricot_scan.c"
907
953
  switch( (*p) ) {
908
954
  case 9: goto st20;
909
955
  case 34: goto tr33;
@@ -936,7 +982,7 @@ st21:
936
982
  if ( ++p == pe )
937
983
  goto _test_eof21;
938
984
  case 21:
939
- #line 940 "hpricot_scan.c"
985
+ #line 986 "hpricot_scan.c"
940
986
  switch( (*p) ) {
941
987
  case 32: goto st22;
942
988
  case 62: goto tr18;
@@ -974,7 +1020,7 @@ st24:
974
1020
  if ( ++p == pe )
975
1021
  goto _test_eof24;
976
1022
  case 24:
977
- #line 978 "hpricot_scan.c"
1023
+ #line 1024 "hpricot_scan.c"
978
1024
  if ( (*p) == 34 )
979
1025
  goto tr41;
980
1026
  goto st24;
@@ -992,7 +1038,7 @@ st25:
992
1038
  if ( ++p == pe )
993
1039
  goto _test_eof25;
994
1040
  case 25:
995
- #line 996 "hpricot_scan.c"
1041
+ #line 1042 "hpricot_scan.c"
996
1042
  switch( (*p) ) {
997
1043
  case 32: goto st25;
998
1044
  case 62: goto tr18;
@@ -1009,7 +1055,7 @@ st26:
1009
1055
  if ( ++p == pe )
1010
1056
  goto _test_eof26;
1011
1057
  case 26:
1012
- #line 1013 "hpricot_scan.c"
1058
+ #line 1059 "hpricot_scan.c"
1013
1059
  if ( (*p) == 93 )
1014
1060
  goto st27;
1015
1061
  goto st26;
@@ -1039,7 +1085,7 @@ st29:
1039
1085
  if ( ++p == pe )
1040
1086
  goto _test_eof29;
1041
1087
  case 29:
1042
- #line 1043 "hpricot_scan.c"
1088
+ #line 1089 "hpricot_scan.c"
1043
1089
  if ( (*p) == 39 )
1044
1090
  goto tr41;
1045
1091
  goto st29;
@@ -1076,7 +1122,7 @@ st31:
1076
1122
  if ( ++p == pe )
1077
1123
  goto _test_eof31;
1078
1124
  case 31:
1079
- #line 1080 "hpricot_scan.c"
1125
+ #line 1126 "hpricot_scan.c"
1080
1126
  switch( (*p) ) {
1081
1127
  case 9: goto st31;
1082
1128
  case 39: goto tr49;
@@ -1126,7 +1172,7 @@ st32:
1126
1172
  if ( ++p == pe )
1127
1173
  goto _test_eof32;
1128
1174
  case 32:
1129
- #line 1130 "hpricot_scan.c"
1175
+ #line 1176 "hpricot_scan.c"
1130
1176
  switch( (*p) ) {
1131
1177
  case 9: goto st33;
1132
1178
  case 32: goto st33;
@@ -1193,7 +1239,7 @@ st34:
1193
1239
  if ( ++p == pe )
1194
1240
  goto _test_eof34;
1195
1241
  case 34:
1196
- #line 1197 "hpricot_scan.c"
1242
+ #line 1243 "hpricot_scan.c"
1197
1243
  switch( (*p) ) {
1198
1244
  case 9: goto tr52;
1199
1245
  case 32: goto tr52;
@@ -1226,7 +1272,7 @@ st35:
1226
1272
  if ( ++p == pe )
1227
1273
  goto _test_eof35;
1228
1274
  case 35:
1229
- #line 1230 "hpricot_scan.c"
1275
+ #line 1276 "hpricot_scan.c"
1230
1276
  switch( (*p) ) {
1231
1277
  case 9: goto st35;
1232
1278
  case 32: goto st35;
@@ -1259,7 +1305,7 @@ st36:
1259
1305
  if ( ++p == pe )
1260
1306
  goto _test_eof36;
1261
1307
  case 36:
1262
- #line 1263 "hpricot_scan.c"
1308
+ #line 1309 "hpricot_scan.c"
1263
1309
  switch( (*p) ) {
1264
1310
  case 32: goto st36;
1265
1311
  case 34: goto st37;
@@ -1287,7 +1333,7 @@ st38:
1287
1333
  if ( ++p == pe )
1288
1334
  goto _test_eof38;
1289
1335
  case 38:
1290
- #line 1291 "hpricot_scan.c"
1336
+ #line 1337 "hpricot_scan.c"
1291
1337
  switch( (*p) ) {
1292
1338
  case 34: goto tr70;
1293
1339
  case 39: goto tr71;
@@ -1311,7 +1357,7 @@ st39:
1311
1357
  if ( ++p == pe )
1312
1358
  goto _test_eof39;
1313
1359
  case 39:
1314
- #line 1315 "hpricot_scan.c"
1360
+ #line 1361 "hpricot_scan.c"
1315
1361
  switch( (*p) ) {
1316
1362
  case 32: goto st39;
1317
1363
  case 39: goto tr41;
@@ -1339,7 +1385,7 @@ st206:
1339
1385
  if ( ++p == pe )
1340
1386
  goto _test_eof206;
1341
1387
  case 206:
1342
- #line 1343 "hpricot_scan.c"
1388
+ #line 1389 "hpricot_scan.c"
1343
1389
  if ( (*p) == 39 )
1344
1390
  goto tr41;
1345
1391
  goto st29;
@@ -1351,7 +1397,7 @@ st40:
1351
1397
  if ( ++p == pe )
1352
1398
  goto _test_eof40;
1353
1399
  case 40:
1354
- #line 1355 "hpricot_scan.c"
1400
+ #line 1401 "hpricot_scan.c"
1355
1401
  switch( (*p) ) {
1356
1402
  case 39: goto tr73;
1357
1403
  case 93: goto st42;
@@ -1365,7 +1411,7 @@ st41:
1365
1411
  if ( ++p == pe )
1366
1412
  goto _test_eof41;
1367
1413
  case 41:
1368
- #line 1369 "hpricot_scan.c"
1414
+ #line 1415 "hpricot_scan.c"
1369
1415
  switch( (*p) ) {
1370
1416
  case 32: goto st41;
1371
1417
  case 62: goto tr76;
@@ -1384,7 +1430,7 @@ st207:
1384
1430
  if ( ++p == pe )
1385
1431
  goto _test_eof207;
1386
1432
  case 207:
1387
- #line 1388 "hpricot_scan.c"
1433
+ #line 1434 "hpricot_scan.c"
1388
1434
  if ( (*p) == 93 )
1389
1435
  goto st27;
1390
1436
  goto st26;
@@ -1414,7 +1460,7 @@ st43:
1414
1460
  if ( ++p == pe )
1415
1461
  goto _test_eof43;
1416
1462
  case 43:
1417
- #line 1418 "hpricot_scan.c"
1463
+ #line 1464 "hpricot_scan.c"
1418
1464
  switch( (*p) ) {
1419
1465
  case 32: goto st43;
1420
1466
  case 34: goto tr41;
@@ -1434,7 +1480,7 @@ st208:
1434
1480
  if ( ++p == pe )
1435
1481
  goto _test_eof208;
1436
1482
  case 208:
1437
- #line 1438 "hpricot_scan.c"
1483
+ #line 1484 "hpricot_scan.c"
1438
1484
  if ( (*p) == 34 )
1439
1485
  goto tr41;
1440
1486
  goto st24;
@@ -1467,7 +1513,7 @@ st46:
1467
1513
  if ( ++p == pe )
1468
1514
  goto _test_eof46;
1469
1515
  case 46:
1470
- #line 1471 "hpricot_scan.c"
1516
+ #line 1517 "hpricot_scan.c"
1471
1517
  switch( (*p) ) {
1472
1518
  case 32: goto tr81;
1473
1519
  case 39: goto tr38;
@@ -1485,7 +1531,7 @@ st47:
1485
1531
  if ( ++p == pe )
1486
1532
  goto _test_eof47;
1487
1533
  case 47:
1488
- #line 1489 "hpricot_scan.c"
1534
+ #line 1535 "hpricot_scan.c"
1489
1535
  switch( (*p) ) {
1490
1536
  case 9: goto st47;
1491
1537
  case 39: goto tr82;
@@ -1606,7 +1652,7 @@ st60:
1606
1652
  if ( ++p == pe )
1607
1653
  goto _test_eof60;
1608
1654
  case 60:
1609
- #line 1610 "hpricot_scan.c"
1655
+ #line 1656 "hpricot_scan.c"
1610
1656
  switch( (*p) ) {
1611
1657
  case 32: goto tr95;
1612
1658
  case 62: goto tr97;
@@ -1636,7 +1682,7 @@ st61:
1636
1682
  if ( ++p == pe )
1637
1683
  goto _test_eof61;
1638
1684
  case 61:
1639
- #line 1640 "hpricot_scan.c"
1685
+ #line 1686 "hpricot_scan.c"
1640
1686
  switch( (*p) ) {
1641
1687
  case 32: goto st61;
1642
1688
  case 62: goto tr99;
@@ -1652,7 +1698,7 @@ st62:
1652
1698
  if ( ++p == pe )
1653
1699
  goto _test_eof62;
1654
1700
  case 62:
1655
- #line 1656 "hpricot_scan.c"
1701
+ #line 1702 "hpricot_scan.c"
1656
1702
  switch( (*p) ) {
1657
1703
  case 32: goto tr100;
1658
1704
  case 47: goto tr102;
@@ -1680,7 +1726,7 @@ st63:
1680
1726
  if ( ++p == pe )
1681
1727
  goto _test_eof63;
1682
1728
  case 63:
1683
- #line 1684 "hpricot_scan.c"
1729
+ #line 1730 "hpricot_scan.c"
1684
1730
  switch( (*p) ) {
1685
1731
  case 32: goto st63;
1686
1732
  case 47: goto st66;
@@ -1730,7 +1776,7 @@ st64:
1730
1776
  if ( ++p == pe )
1731
1777
  goto _test_eof64;
1732
1778
  case 64:
1733
- #line 1734 "hpricot_scan.c"
1779
+ #line 1780 "hpricot_scan.c"
1734
1780
  switch( (*p) ) {
1735
1781
  case 32: goto tr108;
1736
1782
  case 47: goto tr110;
@@ -1775,7 +1821,7 @@ st65:
1775
1821
  if ( ++p == pe )
1776
1822
  goto _test_eof65;
1777
1823
  case 65:
1778
- #line 1779 "hpricot_scan.c"
1824
+ #line 1825 "hpricot_scan.c"
1779
1825
  switch( (*p) ) {
1780
1826
  case 32: goto st65;
1781
1827
  case 47: goto tr115;
@@ -1818,7 +1864,7 @@ st66:
1818
1864
  if ( ++p == pe )
1819
1865
  goto _test_eof66;
1820
1866
  case 66:
1821
- #line 1822 "hpricot_scan.c"
1867
+ #line 1868 "hpricot_scan.c"
1822
1868
  if ( (*p) == 62 )
1823
1869
  goto tr118;
1824
1870
  goto tr39;
@@ -1830,7 +1876,7 @@ st67:
1830
1876
  if ( ++p == pe )
1831
1877
  goto _test_eof67;
1832
1878
  case 67:
1833
- #line 1834 "hpricot_scan.c"
1879
+ #line 1880 "hpricot_scan.c"
1834
1880
  switch( (*p) ) {
1835
1881
  case 13: goto tr120;
1836
1882
  case 32: goto tr120;
@@ -1854,7 +1900,7 @@ st68:
1854
1900
  if ( ++p == pe )
1855
1901
  goto _test_eof68;
1856
1902
  case 68:
1857
- #line 1858 "hpricot_scan.c"
1903
+ #line 1904 "hpricot_scan.c"
1858
1904
  switch( (*p) ) {
1859
1905
  case 13: goto tr126;
1860
1906
  case 32: goto tr126;
@@ -1889,7 +1935,7 @@ st69:
1889
1935
  if ( ++p == pe )
1890
1936
  goto _test_eof69;
1891
1937
  case 69:
1892
- #line 1893 "hpricot_scan.c"
1938
+ #line 1939 "hpricot_scan.c"
1893
1939
  switch( (*p) ) {
1894
1940
  case 32: goto st69;
1895
1941
  case 47: goto tr115;
@@ -1930,7 +1976,7 @@ st70:
1930
1976
  if ( ++p == pe )
1931
1977
  goto _test_eof70;
1932
1978
  case 70:
1933
- #line 1934 "hpricot_scan.c"
1979
+ #line 1980 "hpricot_scan.c"
1934
1980
  switch( (*p) ) {
1935
1981
  case 13: goto tr126;
1936
1982
  case 32: goto tr126;
@@ -1991,7 +2037,7 @@ st71:
1991
2037
  if ( ++p == pe )
1992
2038
  goto _test_eof71;
1993
2039
  case 71:
1994
- #line 1995 "hpricot_scan.c"
2040
+ #line 2041 "hpricot_scan.c"
1995
2041
  switch( (*p) ) {
1996
2042
  case 13: goto tr134;
1997
2043
  case 32: goto tr134;
@@ -2037,7 +2083,7 @@ st72:
2037
2083
  if ( ++p == pe )
2038
2084
  goto _test_eof72;
2039
2085
  case 72:
2040
- #line 2041 "hpricot_scan.c"
2086
+ #line 2087 "hpricot_scan.c"
2041
2087
  switch( (*p) ) {
2042
2088
  case 13: goto tr140;
2043
2089
  case 32: goto tr140;
@@ -2136,7 +2182,7 @@ st73:
2136
2182
  if ( ++p == pe )
2137
2183
  goto _test_eof73;
2138
2184
  case 73:
2139
- #line 2140 "hpricot_scan.c"
2185
+ #line 2186 "hpricot_scan.c"
2140
2186
  switch( (*p) ) {
2141
2187
  case 13: goto tr126;
2142
2188
  case 32: goto tr126;
@@ -2162,7 +2208,7 @@ st74:
2162
2208
  if ( ++p == pe )
2163
2209
  goto _test_eof74;
2164
2210
  case 74:
2165
- #line 2166 "hpricot_scan.c"
2211
+ #line 2212 "hpricot_scan.c"
2166
2212
  switch( (*p) ) {
2167
2213
  case 13: goto tr143;
2168
2214
  case 32: goto tr143;
@@ -2195,7 +2241,7 @@ st75:
2195
2241
  if ( ++p == pe )
2196
2242
  goto _test_eof75;
2197
2243
  case 75:
2198
- #line 2199 "hpricot_scan.c"
2244
+ #line 2245 "hpricot_scan.c"
2199
2245
  switch( (*p) ) {
2200
2246
  case 13: goto tr148;
2201
2247
  case 32: goto tr148;
@@ -2239,7 +2285,7 @@ st76:
2239
2285
  if ( ++p == pe )
2240
2286
  goto _test_eof76;
2241
2287
  case 76:
2242
- #line 2243 "hpricot_scan.c"
2288
+ #line 2289 "hpricot_scan.c"
2243
2289
  switch( (*p) ) {
2244
2290
  case 13: goto tr143;
2245
2291
  case 32: goto tr143;
@@ -2293,7 +2339,7 @@ st78:
2293
2339
  if ( ++p == pe )
2294
2340
  goto _test_eof78;
2295
2341
  case 78:
2296
- #line 2297 "hpricot_scan.c"
2342
+ #line 2343 "hpricot_scan.c"
2297
2343
  switch( (*p) ) {
2298
2344
  case 13: goto tr161;
2299
2345
  case 32: goto tr161;
@@ -2343,7 +2389,7 @@ st79:
2343
2389
  if ( ++p == pe )
2344
2390
  goto _test_eof79;
2345
2391
  case 79:
2346
- #line 2347 "hpricot_scan.c"
2392
+ #line 2393 "hpricot_scan.c"
2347
2393
  switch( (*p) ) {
2348
2394
  case 32: goto st79;
2349
2395
  case 34: goto tr169;
@@ -2373,7 +2419,7 @@ st80:
2373
2419
  if ( ++p == pe )
2374
2420
  goto _test_eof80;
2375
2421
  case 80:
2376
- #line 2377 "hpricot_scan.c"
2422
+ #line 2423 "hpricot_scan.c"
2377
2423
  switch( (*p) ) {
2378
2424
  case 34: goto tr169;
2379
2425
  case 92: goto st81;
@@ -2387,7 +2433,7 @@ st81:
2387
2433
  if ( ++p == pe )
2388
2434
  goto _test_eof81;
2389
2435
  case 81:
2390
- #line 2391 "hpricot_scan.c"
2436
+ #line 2437 "hpricot_scan.c"
2391
2437
  switch( (*p) ) {
2392
2438
  case 34: goto tr174;
2393
2439
  case 92: goto st81;
@@ -2429,7 +2475,7 @@ st82:
2429
2475
  if ( ++p == pe )
2430
2476
  goto _test_eof82;
2431
2477
  case 82:
2432
- #line 2433 "hpricot_scan.c"
2478
+ #line 2479 "hpricot_scan.c"
2433
2479
  switch( (*p) ) {
2434
2480
  case 32: goto tr175;
2435
2481
  case 34: goto tr169;
@@ -2476,7 +2522,7 @@ st83:
2476
2522
  if ( ++p == pe )
2477
2523
  goto _test_eof83;
2478
2524
  case 83:
2479
- #line 2480 "hpricot_scan.c"
2525
+ #line 2526 "hpricot_scan.c"
2480
2526
  switch( (*p) ) {
2481
2527
  case 32: goto st83;
2482
2528
  case 34: goto tr169;
@@ -2525,7 +2571,7 @@ st84:
2525
2571
  if ( ++p == pe )
2526
2572
  goto _test_eof84;
2527
2573
  case 84:
2528
- #line 2529 "hpricot_scan.c"
2574
+ #line 2575 "hpricot_scan.c"
2529
2575
  switch( (*p) ) {
2530
2576
  case 34: goto tr169;
2531
2577
  case 62: goto tr182;
@@ -2657,7 +2703,7 @@ st209:
2657
2703
  if ( ++p == pe )
2658
2704
  goto _test_eof209;
2659
2705
  case 209:
2660
- #line 2661 "hpricot_scan.c"
2706
+ #line 2707 "hpricot_scan.c"
2661
2707
  switch( (*p) ) {
2662
2708
  case 34: goto tr169;
2663
2709
  case 92: goto st81;
@@ -2671,7 +2717,7 @@ st85:
2671
2717
  if ( ++p == pe )
2672
2718
  goto _test_eof85;
2673
2719
  case 85:
2674
- #line 2675 "hpricot_scan.c"
2720
+ #line 2721 "hpricot_scan.c"
2675
2721
  switch( (*p) ) {
2676
2722
  case 13: goto tr183;
2677
2723
  case 32: goto tr183;
@@ -2696,7 +2742,7 @@ st86:
2696
2742
  if ( ++p == pe )
2697
2743
  goto _test_eof86;
2698
2744
  case 86:
2699
- #line 2700 "hpricot_scan.c"
2745
+ #line 2746 "hpricot_scan.c"
2700
2746
  switch( (*p) ) {
2701
2747
  case 13: goto tr188;
2702
2748
  case 32: goto tr188;
@@ -2730,7 +2776,7 @@ st87:
2730
2776
  if ( ++p == pe )
2731
2777
  goto _test_eof87;
2732
2778
  case 87:
2733
- #line 2734 "hpricot_scan.c"
2779
+ #line 2780 "hpricot_scan.c"
2734
2780
  switch( (*p) ) {
2735
2781
  case 13: goto tr188;
2736
2782
  case 32: goto tr188;
@@ -2775,7 +2821,7 @@ st88:
2775
2821
  if ( ++p == pe )
2776
2822
  goto _test_eof88;
2777
2823
  case 88:
2778
- #line 2779 "hpricot_scan.c"
2824
+ #line 2825 "hpricot_scan.c"
2779
2825
  switch( (*p) ) {
2780
2826
  case 13: goto tr191;
2781
2827
  case 32: goto tr191;
@@ -2811,7 +2857,7 @@ st89:
2811
2857
  if ( ++p == pe )
2812
2858
  goto _test_eof89;
2813
2859
  case 89:
2814
- #line 2815 "hpricot_scan.c"
2860
+ #line 2861 "hpricot_scan.c"
2815
2861
  switch( (*p) ) {
2816
2862
  case 13: goto tr153;
2817
2863
  case 32: goto tr153;
@@ -2868,7 +2914,7 @@ st90:
2868
2914
  if ( ++p == pe )
2869
2915
  goto _test_eof90;
2870
2916
  case 90:
2871
- #line 2872 "hpricot_scan.c"
2917
+ #line 2918 "hpricot_scan.c"
2872
2918
  switch( (*p) ) {
2873
2919
  case 13: goto tr161;
2874
2920
  case 32: goto tr161;
@@ -2931,7 +2977,7 @@ st91:
2931
2977
  if ( ++p == pe )
2932
2978
  goto _test_eof91;
2933
2979
  case 91:
2934
- #line 2935 "hpricot_scan.c"
2980
+ #line 2981 "hpricot_scan.c"
2935
2981
  switch( (*p) ) {
2936
2982
  case 13: goto tr200;
2937
2983
  case 32: goto tr200;
@@ -2979,7 +3025,7 @@ st92:
2979
3025
  if ( ++p == pe )
2980
3026
  goto _test_eof92;
2981
3027
  case 92:
2982
- #line 2983 "hpricot_scan.c"
3028
+ #line 3029 "hpricot_scan.c"
2983
3029
  switch( (*p) ) {
2984
3030
  case 13: goto tr206;
2985
3031
  case 32: goto tr206;
@@ -3080,7 +3126,7 @@ st93:
3080
3126
  if ( ++p == pe )
3081
3127
  goto _test_eof93;
3082
3128
  case 93:
3083
- #line 3084 "hpricot_scan.c"
3129
+ #line 3130 "hpricot_scan.c"
3084
3130
  switch( (*p) ) {
3085
3131
  case 13: goto tr161;
3086
3132
  case 32: goto tr161;
@@ -3104,7 +3150,7 @@ st94:
3104
3150
  if ( ++p == pe )
3105
3151
  goto _test_eof94;
3106
3152
  case 94:
3107
- #line 3108 "hpricot_scan.c"
3153
+ #line 3154 "hpricot_scan.c"
3108
3154
  switch( (*p) ) {
3109
3155
  case 13: goto tr161;
3110
3156
  case 32: goto tr161;
@@ -3132,7 +3178,7 @@ st95:
3132
3178
  if ( ++p == pe )
3133
3179
  goto _test_eof95;
3134
3180
  case 95:
3135
- #line 3136 "hpricot_scan.c"
3181
+ #line 3182 "hpricot_scan.c"
3136
3182
  switch( (*p) ) {
3137
3183
  case 13: goto tr191;
3138
3184
  case 32: goto tr191;
@@ -3177,7 +3223,7 @@ st97:
3177
3223
  if ( ++p == pe )
3178
3224
  goto _test_eof97;
3179
3225
  case 97:
3180
- #line 3181 "hpricot_scan.c"
3226
+ #line 3227 "hpricot_scan.c"
3181
3227
  switch( (*p) ) {
3182
3228
  case 13: goto tr220;
3183
3229
  case 32: goto tr220;
@@ -3222,7 +3268,7 @@ st98:
3222
3268
  if ( ++p == pe )
3223
3269
  goto _test_eof98;
3224
3270
  case 98:
3225
- #line 3226 "hpricot_scan.c"
3271
+ #line 3272 "hpricot_scan.c"
3226
3272
  switch( (*p) ) {
3227
3273
  case 32: goto st98;
3228
3274
  case 34: goto tr228;
@@ -3253,7 +3299,7 @@ st99:
3253
3299
  if ( ++p == pe )
3254
3300
  goto _test_eof99;
3255
3301
  case 99:
3256
- #line 3257 "hpricot_scan.c"
3302
+ #line 3303 "hpricot_scan.c"
3257
3303
  switch( (*p) ) {
3258
3304
  case 34: goto tr228;
3259
3305
  case 39: goto tr174;
@@ -3300,7 +3346,7 @@ st100:
3300
3346
  if ( ++p == pe )
3301
3347
  goto _test_eof100;
3302
3348
  case 100:
3303
- #line 3304 "hpricot_scan.c"
3349
+ #line 3350 "hpricot_scan.c"
3304
3350
  switch( (*p) ) {
3305
3351
  case 32: goto st100;
3306
3352
  case 39: goto tr169;
@@ -3330,7 +3376,7 @@ st101:
3330
3376
  if ( ++p == pe )
3331
3377
  goto _test_eof101;
3332
3378
  case 101:
3333
- #line 3334 "hpricot_scan.c"
3379
+ #line 3380 "hpricot_scan.c"
3334
3380
  switch( (*p) ) {
3335
3381
  case 39: goto tr169;
3336
3382
  case 92: goto st102;
@@ -3344,7 +3390,7 @@ st102:
3344
3390
  if ( ++p == pe )
3345
3391
  goto _test_eof102;
3346
3392
  case 102:
3347
- #line 3348 "hpricot_scan.c"
3393
+ #line 3394 "hpricot_scan.c"
3348
3394
  switch( (*p) ) {
3349
3395
  case 39: goto tr228;
3350
3396
  case 92: goto st102;
@@ -3386,7 +3432,7 @@ st103:
3386
3432
  if ( ++p == pe )
3387
3433
  goto _test_eof103;
3388
3434
  case 103:
3389
- #line 3390 "hpricot_scan.c"
3435
+ #line 3436 "hpricot_scan.c"
3390
3436
  switch( (*p) ) {
3391
3437
  case 32: goto tr239;
3392
3438
  case 39: goto tr169;
@@ -3433,7 +3479,7 @@ st104:
3433
3479
  if ( ++p == pe )
3434
3480
  goto _test_eof104;
3435
3481
  case 104:
3436
- #line 3437 "hpricot_scan.c"
3482
+ #line 3483 "hpricot_scan.c"
3437
3483
  switch( (*p) ) {
3438
3484
  case 32: goto st104;
3439
3485
  case 39: goto tr169;
@@ -3482,7 +3528,7 @@ st105:
3482
3528
  if ( ++p == pe )
3483
3529
  goto _test_eof105;
3484
3530
  case 105:
3485
- #line 3486 "hpricot_scan.c"
3531
+ #line 3532 "hpricot_scan.c"
3486
3532
  switch( (*p) ) {
3487
3533
  case 39: goto tr169;
3488
3534
  case 62: goto tr246;
@@ -3614,7 +3660,7 @@ st210:
3614
3660
  if ( ++p == pe )
3615
3661
  goto _test_eof210;
3616
3662
  case 210:
3617
- #line 3618 "hpricot_scan.c"
3663
+ #line 3664 "hpricot_scan.c"
3618
3664
  switch( (*p) ) {
3619
3665
  case 39: goto tr169;
3620
3666
  case 92: goto st102;
@@ -3628,7 +3674,7 @@ st106:
3628
3674
  if ( ++p == pe )
3629
3675
  goto _test_eof106;
3630
3676
  case 106:
3631
- #line 3632 "hpricot_scan.c"
3677
+ #line 3678 "hpricot_scan.c"
3632
3678
  switch( (*p) ) {
3633
3679
  case 13: goto tr248;
3634
3680
  case 32: goto tr248;
@@ -3653,7 +3699,7 @@ st107:
3653
3699
  if ( ++p == pe )
3654
3700
  goto _test_eof107;
3655
3701
  case 107:
3656
- #line 3657 "hpricot_scan.c"
3702
+ #line 3703 "hpricot_scan.c"
3657
3703
  switch( (*p) ) {
3658
3704
  case 13: goto tr255;
3659
3705
  case 32: goto tr255;
@@ -3705,7 +3751,7 @@ st108:
3705
3751
  if ( ++p == pe )
3706
3752
  goto _test_eof108;
3707
3753
  case 108:
3708
- #line 3709 "hpricot_scan.c"
3754
+ #line 3755 "hpricot_scan.c"
3709
3755
  switch( (*p) ) {
3710
3756
  case 13: goto tr255;
3711
3757
  case 32: goto tr255;
@@ -3768,7 +3814,7 @@ st109:
3768
3814
  if ( ++p == pe )
3769
3815
  goto _test_eof109;
3770
3816
  case 109:
3771
- #line 3772 "hpricot_scan.c"
3817
+ #line 3818 "hpricot_scan.c"
3772
3818
  switch( (*p) ) {
3773
3819
  case 13: goto tr263;
3774
3820
  case 32: goto tr263;
@@ -3816,7 +3862,7 @@ st110:
3816
3862
  if ( ++p == pe )
3817
3863
  goto _test_eof110;
3818
3864
  case 110:
3819
- #line 3820 "hpricot_scan.c"
3865
+ #line 3866 "hpricot_scan.c"
3820
3866
  switch( (*p) ) {
3821
3867
  case 13: goto tr269;
3822
3868
  case 32: goto tr269;
@@ -3917,7 +3963,7 @@ st111:
3917
3963
  if ( ++p == pe )
3918
3964
  goto _test_eof111;
3919
3965
  case 111:
3920
- #line 3921 "hpricot_scan.c"
3966
+ #line 3967 "hpricot_scan.c"
3921
3967
  switch( (*p) ) {
3922
3968
  case 13: goto tr255;
3923
3969
  case 32: goto tr255;
@@ -3941,7 +3987,7 @@ st112:
3941
3987
  if ( ++p == pe )
3942
3988
  goto _test_eof112;
3943
3989
  case 112:
3944
- #line 3945 "hpricot_scan.c"
3990
+ #line 3991 "hpricot_scan.c"
3945
3991
  switch( (*p) ) {
3946
3992
  case 13: goto tr255;
3947
3993
  case 32: goto tr255;
@@ -3969,7 +4015,7 @@ st113:
3969
4015
  if ( ++p == pe )
3970
4016
  goto _test_eof113;
3971
4017
  case 113:
3972
- #line 3973 "hpricot_scan.c"
4018
+ #line 4019 "hpricot_scan.c"
3973
4019
  switch( (*p) ) {
3974
4020
  case 13: goto tr272;
3975
4021
  case 32: goto tr272;
@@ -4003,7 +4049,7 @@ st114:
4003
4049
  if ( ++p == pe )
4004
4050
  goto _test_eof114;
4005
4051
  case 114:
4006
- #line 4007 "hpricot_scan.c"
4052
+ #line 4053 "hpricot_scan.c"
4007
4053
  switch( (*p) ) {
4008
4054
  case 13: goto tr277;
4009
4055
  case 32: goto tr277;
@@ -4048,7 +4094,7 @@ st115:
4048
4094
  if ( ++p == pe )
4049
4095
  goto _test_eof115;
4050
4096
  case 115:
4051
- #line 4052 "hpricot_scan.c"
4097
+ #line 4098 "hpricot_scan.c"
4052
4098
  switch( (*p) ) {
4053
4099
  case 13: goto tr272;
4054
4100
  case 32: goto tr272;
@@ -4120,7 +4166,7 @@ st117:
4120
4166
  if ( ++p == pe )
4121
4167
  goto _test_eof117;
4122
4168
  case 117:
4123
- #line 4124 "hpricot_scan.c"
4169
+ #line 4170 "hpricot_scan.c"
4124
4170
  switch( (*p) ) {
4125
4171
  case 13: goto tr220;
4126
4172
  case 32: goto tr220;
@@ -4184,7 +4230,7 @@ st118:
4184
4230
  if ( ++p == pe )
4185
4231
  goto _test_eof118;
4186
4232
  case 118:
4187
- #line 4188 "hpricot_scan.c"
4233
+ #line 4234 "hpricot_scan.c"
4188
4234
  switch( (*p) ) {
4189
4235
  case 13: goto tr285;
4190
4236
  case 32: goto tr285;
@@ -4237,7 +4283,7 @@ st119:
4237
4283
  if ( ++p == pe )
4238
4284
  goto _test_eof119;
4239
4285
  case 119:
4240
- #line 4241 "hpricot_scan.c"
4286
+ #line 4287 "hpricot_scan.c"
4241
4287
  switch( (*p) ) {
4242
4288
  case 32: goto st119;
4243
4289
  case 34: goto tr228;
@@ -4297,7 +4343,7 @@ st120:
4297
4343
  if ( ++p == pe )
4298
4344
  goto _test_eof120;
4299
4345
  case 120:
4300
- #line 4301 "hpricot_scan.c"
4346
+ #line 4347 "hpricot_scan.c"
4301
4347
  switch( (*p) ) {
4302
4348
  case 32: goto tr293;
4303
4349
  case 34: goto tr228;
@@ -4347,7 +4393,7 @@ st121:
4347
4393
  if ( ++p == pe )
4348
4394
  goto _test_eof121;
4349
4395
  case 121:
4350
- #line 4351 "hpricot_scan.c"
4396
+ #line 4397 "hpricot_scan.c"
4351
4397
  switch( (*p) ) {
4352
4398
  case 34: goto tr228;
4353
4399
  case 39: goto tr174;
@@ -4480,7 +4526,7 @@ st211:
4480
4526
  if ( ++p == pe )
4481
4527
  goto _test_eof211;
4482
4528
  case 211:
4483
- #line 4484 "hpricot_scan.c"
4529
+ #line 4530 "hpricot_scan.c"
4484
4530
  switch( (*p) ) {
4485
4531
  case 34: goto tr228;
4486
4532
  case 39: goto tr174;
@@ -4495,7 +4541,7 @@ st122:
4495
4541
  if ( ++p == pe )
4496
4542
  goto _test_eof122;
4497
4543
  case 122:
4498
- #line 4499 "hpricot_scan.c"
4544
+ #line 4545 "hpricot_scan.c"
4499
4545
  switch( (*p) ) {
4500
4546
  case 34: goto tr299;
4501
4547
  case 39: goto tr299;
@@ -4510,7 +4556,7 @@ st123:
4510
4556
  if ( ++p == pe )
4511
4557
  goto _test_eof123;
4512
4558
  case 123:
4513
- #line 4514 "hpricot_scan.c"
4559
+ #line 4560 "hpricot_scan.c"
4514
4560
  switch( (*p) ) {
4515
4561
  case 13: goto tr300;
4516
4562
  case 32: goto tr300;
@@ -4535,7 +4581,7 @@ st124:
4535
4581
  if ( ++p == pe )
4536
4582
  goto _test_eof124;
4537
4583
  case 124:
4538
- #line 4539 "hpricot_scan.c"
4584
+ #line 4585 "hpricot_scan.c"
4539
4585
  switch( (*p) ) {
4540
4586
  case 13: goto tr305;
4541
4587
  case 32: goto tr305;
@@ -4569,7 +4615,7 @@ st125:
4569
4615
  if ( ++p == pe )
4570
4616
  goto _test_eof125;
4571
4617
  case 125:
4572
- #line 4573 "hpricot_scan.c"
4618
+ #line 4619 "hpricot_scan.c"
4573
4619
  switch( (*p) ) {
4574
4620
  case 13: goto tr305;
4575
4621
  case 32: goto tr305;
@@ -4614,7 +4660,7 @@ st126:
4614
4660
  if ( ++p == pe )
4615
4661
  goto _test_eof126;
4616
4662
  case 126:
4617
- #line 4618 "hpricot_scan.c"
4663
+ #line 4664 "hpricot_scan.c"
4618
4664
  switch( (*p) ) {
4619
4665
  case 13: goto tr308;
4620
4666
  case 32: goto tr308;
@@ -4650,7 +4696,7 @@ st127:
4650
4696
  if ( ++p == pe )
4651
4697
  goto _test_eof127;
4652
4698
  case 127:
4653
- #line 4654 "hpricot_scan.c"
4699
+ #line 4700 "hpricot_scan.c"
4654
4700
  switch( (*p) ) {
4655
4701
  case 13: goto tr211;
4656
4702
  case 32: goto tr211;
@@ -4751,7 +4797,7 @@ st128:
4751
4797
  if ( ++p == pe )
4752
4798
  goto _test_eof128;
4753
4799
  case 128:
4754
- #line 4755 "hpricot_scan.c"
4800
+ #line 4801 "hpricot_scan.c"
4755
4801
  switch( (*p) ) {
4756
4802
  case 13: goto tr220;
4757
4803
  case 32: goto tr220;
@@ -4776,7 +4822,7 @@ st129:
4776
4822
  if ( ++p == pe )
4777
4823
  goto _test_eof129;
4778
4824
  case 129:
4779
- #line 4780 "hpricot_scan.c"
4825
+ #line 4826 "hpricot_scan.c"
4780
4826
  switch( (*p) ) {
4781
4827
  case 13: goto tr220;
4782
4828
  case 32: goto tr220;
@@ -4801,7 +4847,7 @@ st130:
4801
4847
  if ( ++p == pe )
4802
4848
  goto _test_eof130;
4803
4849
  case 130:
4804
- #line 4805 "hpricot_scan.c"
4850
+ #line 4851 "hpricot_scan.c"
4805
4851
  switch( (*p) ) {
4806
4852
  case 13: goto tr211;
4807
4853
  case 32: goto tr211;
@@ -4837,7 +4883,7 @@ st131:
4837
4883
  if ( ++p == pe )
4838
4884
  goto _test_eof131;
4839
4885
  case 131:
4840
- #line 4841 "hpricot_scan.c"
4886
+ #line 4887 "hpricot_scan.c"
4841
4887
  switch( (*p) ) {
4842
4888
  case 32: goto tr315;
4843
4889
  case 34: goto tr316;
@@ -4868,7 +4914,7 @@ st132:
4868
4914
  if ( ++p == pe )
4869
4915
  goto _test_eof132;
4870
4916
  case 132:
4871
- #line 4872 "hpricot_scan.c"
4917
+ #line 4918 "hpricot_scan.c"
4872
4918
  switch( (*p) ) {
4873
4919
  case 32: goto tr315;
4874
4920
  case 34: goto tr322;
@@ -4903,7 +4949,7 @@ st133:
4903
4949
  if ( ++p == pe )
4904
4950
  goto _test_eof133;
4905
4951
  case 133:
4906
- #line 4907 "hpricot_scan.c"
4952
+ #line 4953 "hpricot_scan.c"
4907
4953
  switch( (*p) ) {
4908
4954
  case 13: goto tr308;
4909
4955
  case 32: goto tr308;
@@ -4940,7 +4986,7 @@ st134:
4940
4986
  if ( ++p == pe )
4941
4987
  goto _test_eof134;
4942
4988
  case 134:
4943
- #line 4944 "hpricot_scan.c"
4989
+ #line 4990 "hpricot_scan.c"
4944
4990
  switch( (*p) ) {
4945
4991
  case 13: goto tr323;
4946
4992
  case 32: goto tr323;
@@ -4977,7 +5023,7 @@ st135:
4977
5023
  if ( ++p == pe )
4978
5024
  goto _test_eof135;
4979
5025
  case 135:
4980
- #line 4981 "hpricot_scan.c"
5026
+ #line 5027 "hpricot_scan.c"
4981
5027
  switch( (*p) ) {
4982
5028
  case 13: goto tr326;
4983
5029
  case 32: goto tr326;
@@ -5022,7 +5068,7 @@ st137:
5022
5068
  if ( ++p == pe )
5023
5069
  goto _test_eof137;
5024
5070
  case 137:
5025
- #line 5026 "hpricot_scan.c"
5071
+ #line 5072 "hpricot_scan.c"
5026
5072
  switch( (*p) ) {
5027
5073
  case 32: goto tr330;
5028
5074
  case 39: goto tr331;
@@ -5052,7 +5098,7 @@ st138:
5052
5098
  if ( ++p == pe )
5053
5099
  goto _test_eof138;
5054
5100
  case 138:
5055
- #line 5056 "hpricot_scan.c"
5101
+ #line 5102 "hpricot_scan.c"
5056
5102
  switch( (*p) ) {
5057
5103
  case 13: goto tr277;
5058
5104
  case 32: goto tr277;
@@ -5077,7 +5123,7 @@ st139:
5077
5123
  if ( ++p == pe )
5078
5124
  goto _test_eof139;
5079
5125
  case 139:
5080
- #line 5081 "hpricot_scan.c"
5126
+ #line 5127 "hpricot_scan.c"
5081
5127
  switch( (*p) ) {
5082
5128
  case 32: goto tr336;
5083
5129
  case 34: goto tr331;
@@ -5154,7 +5200,7 @@ st144:
5154
5200
  if ( ++p == pe )
5155
5201
  goto _test_eof144;
5156
5202
  case 144:
5157
- #line 5158 "hpricot_scan.c"
5203
+ #line 5204 "hpricot_scan.c"
5158
5204
  switch( (*p) ) {
5159
5205
  case 13: goto tr148;
5160
5206
  case 32: goto tr148;
@@ -5193,7 +5239,7 @@ st146:
5193
5239
  if ( ++p == pe )
5194
5240
  goto _test_eof146;
5195
5241
  case 146:
5196
- #line 5197 "hpricot_scan.c"
5242
+ #line 5243 "hpricot_scan.c"
5197
5243
  switch( (*p) ) {
5198
5244
  case 32: goto st212;
5199
5245
  case 63: goto st146;
@@ -5231,7 +5277,7 @@ st147:
5231
5277
  if ( ++p == pe )
5232
5278
  goto _test_eof147;
5233
5279
  case 147:
5234
- #line 5235 "hpricot_scan.c"
5280
+ #line 5281 "hpricot_scan.c"
5235
5281
  switch( (*p) ) {
5236
5282
  case 32: goto st212;
5237
5283
  case 63: goto st146;
@@ -5310,7 +5356,7 @@ st213:
5310
5356
  if ( ++p == pe )
5311
5357
  goto _test_eof213;
5312
5358
  case 213:
5313
- #line 5314 "hpricot_scan.c"
5359
+ #line 5360 "hpricot_scan.c"
5314
5360
  switch( (*p) ) {
5315
5361
  case 32: goto tr348;
5316
5362
  case 118: goto st150;
@@ -5409,7 +5455,7 @@ st159:
5409
5455
  if ( ++p == pe )
5410
5456
  goto _test_eof159;
5411
5457
  case 159:
5412
- #line 5413 "hpricot_scan.c"
5458
+ #line 5459 "hpricot_scan.c"
5413
5459
  switch( (*p) ) {
5414
5460
  case 34: goto tr360;
5415
5461
  case 95: goto st159;
@@ -5434,7 +5480,7 @@ st160:
5434
5480
  if ( ++p == pe )
5435
5481
  goto _test_eof160;
5436
5482
  case 160:
5437
- #line 5438 "hpricot_scan.c"
5483
+ #line 5484 "hpricot_scan.c"
5438
5484
  switch( (*p) ) {
5439
5485
  case 32: goto st161;
5440
5486
  case 62: goto tr363;
@@ -5554,7 +5600,7 @@ st173:
5554
5600
  if ( ++p == pe )
5555
5601
  goto _test_eof173;
5556
5602
  case 173:
5557
- #line 5558 "hpricot_scan.c"
5603
+ #line 5604 "hpricot_scan.c"
5558
5604
  switch( (*p) ) {
5559
5605
  case 34: goto tr378;
5560
5606
  case 95: goto st173;
@@ -5579,7 +5625,7 @@ st174:
5579
5625
  if ( ++p == pe )
5580
5626
  goto _test_eof174;
5581
5627
  case 174:
5582
- #line 5583 "hpricot_scan.c"
5628
+ #line 5629 "hpricot_scan.c"
5583
5629
  switch( (*p) ) {
5584
5630
  case 32: goto st175;
5585
5631
  case 62: goto tr363;
@@ -5704,7 +5750,7 @@ st188:
5704
5750
  if ( ++p == pe )
5705
5751
  goto _test_eof188;
5706
5752
  case 188:
5707
- #line 5708 "hpricot_scan.c"
5753
+ #line 5754 "hpricot_scan.c"
5708
5754
  if ( (*p) == 111 )
5709
5755
  goto st189;
5710
5756
  goto tr349;
@@ -5723,7 +5769,7 @@ st190:
5723
5769
  if ( ++p == pe )
5724
5770
  goto _test_eof190;
5725
5771
  case 190:
5726
- #line 5727 "hpricot_scan.c"
5772
+ #line 5773 "hpricot_scan.c"
5727
5773
  switch( (*p) ) {
5728
5774
  case 32: goto st190;
5729
5775
  case 62: goto tr363;
@@ -5740,7 +5786,7 @@ st191:
5740
5786
  if ( ++p == pe )
5741
5787
  goto _test_eof191;
5742
5788
  case 191:
5743
- #line 5744 "hpricot_scan.c"
5789
+ #line 5790 "hpricot_scan.c"
5744
5790
  if ( (*p) == 101 )
5745
5791
  goto st192;
5746
5792
  goto tr349;
@@ -5768,7 +5814,7 @@ st194:
5768
5814
  if ( ++p == pe )
5769
5815
  goto _test_eof194;
5770
5816
  case 194:
5771
- #line 5772 "hpricot_scan.c"
5817
+ #line 5818 "hpricot_scan.c"
5772
5818
  if ( (*p) == 111 )
5773
5819
  goto st195;
5774
5820
  goto tr349;
@@ -5787,7 +5833,7 @@ st196:
5787
5833
  if ( ++p == pe )
5788
5834
  goto _test_eof196;
5789
5835
  case 196:
5790
- #line 5791 "hpricot_scan.c"
5836
+ #line 5837 "hpricot_scan.c"
5791
5837
  if ( (*p) == 101 )
5792
5838
  goto st197;
5793
5839
  goto tr349;
@@ -5816,7 +5862,7 @@ st199:
5816
5862
  if ( ++p == pe )
5817
5863
  goto _test_eof199;
5818
5864
  case 199:
5819
- #line 5820 "hpricot_scan.c"
5865
+ #line 5866 "hpricot_scan.c"
5820
5866
  switch( (*p) ) {
5821
5867
  case 39: goto tr378;
5822
5868
  case 95: goto st199;
@@ -5859,7 +5905,7 @@ st201:
5859
5905
  if ( ++p == pe )
5860
5906
  goto _test_eof201;
5861
5907
  case 201:
5862
- #line 5863 "hpricot_scan.c"
5908
+ #line 5909 "hpricot_scan.c"
5863
5909
  switch( (*p) ) {
5864
5910
  case 39: goto tr360;
5865
5911
  case 95: goto st201;
@@ -5908,7 +5954,7 @@ st214:
5908
5954
  case 214:
5909
5955
  #line 1 "hpricot_scan.rl"
5910
5956
  {ts = p;}
5911
- #line 5912 "hpricot_scan.c"
5957
+ #line 5958 "hpricot_scan.c"
5912
5958
  switch( (*p) ) {
5913
5959
  case 10: goto tr423;
5914
5960
  case 45: goto tr424;
@@ -5922,7 +5968,7 @@ st215:
5922
5968
  if ( ++p == pe )
5923
5969
  goto _test_eof215;
5924
5970
  case 215:
5925
- #line 5926 "hpricot_scan.c"
5971
+ #line 5972 "hpricot_scan.c"
5926
5972
  if ( (*p) == 45 )
5927
5973
  goto st202;
5928
5974
  goto tr425;
@@ -5965,7 +6011,7 @@ st216:
5965
6011
  case 216:
5966
6012
  #line 1 "hpricot_scan.rl"
5967
6013
  {ts = p;}
5968
- #line 5969 "hpricot_scan.c"
6014
+ #line 6015 "hpricot_scan.c"
5969
6015
  switch( (*p) ) {
5970
6016
  case 10: goto tr428;
5971
6017
  case 93: goto tr429;
@@ -5979,7 +6025,7 @@ st217:
5979
6025
  if ( ++p == pe )
5980
6026
  goto _test_eof217;
5981
6027
  case 217:
5982
- #line 5983 "hpricot_scan.c"
6028
+ #line 6029 "hpricot_scan.c"
5983
6029
  if ( (*p) == 93 )
5984
6030
  goto st203;
5985
6031
  goto tr430;
@@ -6018,7 +6064,7 @@ st218:
6018
6064
  case 218:
6019
6065
  #line 1 "hpricot_scan.rl"
6020
6066
  {ts = p;}
6021
- #line 6022 "hpricot_scan.c"
6067
+ #line 6068 "hpricot_scan.c"
6022
6068
  switch( (*p) ) {
6023
6069
  case 10: goto tr433;
6024
6070
  case 62: goto tr434;
@@ -6478,7 +6524,7 @@ case 219:
6478
6524
  }
6479
6525
 
6480
6526
  }
6481
- #line 500 "hpricot_scan.rl"
6527
+ #line 546 "hpricot_scan.rl"
6482
6528
 
6483
6529
  if ( cs == hpricot_scan_error ) {
6484
6530
  free(buf);
@@ -6609,6 +6655,8 @@ void Init_hpricot_scan()
6609
6655
  rb_define_method(cProcIns, "content=", hpricot_ele_set_attr, 1);
6610
6656
 
6611
6657
  s_ElementContent = rb_intern("ElementContent");
6658
+ symAllow = ID2SYM(rb_intern("allow"));
6659
+ symDeny = ID2SYM(rb_intern("deny"));
6612
6660
  s_downcase = rb_intern("downcase");
6613
6661
  s_new = rb_intern("new");
6614
6662
  s_parent = rb_intern("parent");
@@ -6625,6 +6673,7 @@ void Init_hpricot_scan()
6625
6673
  sym_cdata = ID2SYM(rb_intern("cdata"));
6626
6674
  sym_text = ID2SYM(rb_intern("text"));
6627
6675
  sym_EMPTY = ID2SYM(rb_intern("EMPTY"));
6676
+ sym_CDATA = ID2SYM(rb_intern("CDATA"));
6628
6677
 
6629
6678
  rb_const_set(mHpricot, rb_intern("ProcInsParse"),
6630
6679
  reProcInsParse = rb_eval_string("/\\A<\\?(\\S+)\\s+(.+)/m"));