nokogiri 1.11.7 → 1.12.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of nokogiri might be problematic. Click here for more details.

Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE-DEPENDENCIES.md +243 -22
  3. data/LICENSE.md +1 -1
  4. data/README.md +6 -5
  5. data/ext/nokogiri/depend +35 -34
  6. data/ext/nokogiri/extconf.rb +181 -103
  7. data/ext/nokogiri/gumbo.c +584 -0
  8. data/ext/nokogiri/{html_document.c → html4_document.c} +8 -8
  9. data/ext/nokogiri/{html_element_description.c → html4_element_description.c} +20 -18
  10. data/ext/nokogiri/{html_entity_lookup.c → html4_entity_lookup.c} +7 -7
  11. data/ext/nokogiri/{html_sax_parser_context.c → html4_sax_parser_context.c} +5 -5
  12. data/ext/nokogiri/{html_sax_push_parser.c → html4_sax_push_parser.c} +4 -4
  13. data/ext/nokogiri/libxml2_backwards_compat.c +30 -30
  14. data/ext/nokogiri/nokogiri.c +51 -38
  15. data/ext/nokogiri/nokogiri.h +16 -9
  16. data/ext/nokogiri/xml_document.c +13 -13
  17. data/ext/nokogiri/xml_element_content.c +2 -0
  18. data/ext/nokogiri/xml_encoding_handler.c +11 -6
  19. data/ext/nokogiri/xml_namespace.c +2 -0
  20. data/ext/nokogiri/xml_node.c +102 -102
  21. data/ext/nokogiri/xml_node_set.c +20 -20
  22. data/ext/nokogiri/xml_reader.c +2 -0
  23. data/ext/nokogiri/xml_sax_parser.c +6 -6
  24. data/ext/nokogiri/xml_sax_parser_context.c +2 -0
  25. data/ext/nokogiri/xml_schema.c +2 -0
  26. data/ext/nokogiri/xml_xpath_context.c +67 -65
  27. data/ext/nokogiri/xslt_stylesheet.c +2 -1
  28. data/gumbo-parser/CHANGES.md +63 -0
  29. data/gumbo-parser/Makefile +101 -0
  30. data/gumbo-parser/THANKS +27 -0
  31. data/gumbo-parser/src/Makefile +34 -0
  32. data/gumbo-parser/src/README.md +41 -0
  33. data/gumbo-parser/src/ascii.c +75 -0
  34. data/gumbo-parser/src/ascii.h +115 -0
  35. data/gumbo-parser/src/attribute.c +42 -0
  36. data/gumbo-parser/src/attribute.h +17 -0
  37. data/gumbo-parser/src/char_ref.c +22225 -0
  38. data/gumbo-parser/src/char_ref.h +29 -0
  39. data/gumbo-parser/src/char_ref.rl +2154 -0
  40. data/gumbo-parser/src/error.c +626 -0
  41. data/gumbo-parser/src/error.h +148 -0
  42. data/gumbo-parser/src/foreign_attrs.c +104 -0
  43. data/gumbo-parser/src/foreign_attrs.gperf +27 -0
  44. data/gumbo-parser/src/gumbo.h +943 -0
  45. data/gumbo-parser/src/insertion_mode.h +33 -0
  46. data/gumbo-parser/src/macros.h +91 -0
  47. data/gumbo-parser/src/parser.c +4886 -0
  48. data/gumbo-parser/src/parser.h +41 -0
  49. data/gumbo-parser/src/replacement.h +33 -0
  50. data/gumbo-parser/src/string_buffer.c +103 -0
  51. data/gumbo-parser/src/string_buffer.h +68 -0
  52. data/gumbo-parser/src/string_piece.c +48 -0
  53. data/gumbo-parser/src/svg_attrs.c +174 -0
  54. data/gumbo-parser/src/svg_attrs.gperf +77 -0
  55. data/gumbo-parser/src/svg_tags.c +137 -0
  56. data/gumbo-parser/src/svg_tags.gperf +55 -0
  57. data/gumbo-parser/src/tag.c +222 -0
  58. data/gumbo-parser/src/tag_lookup.c +382 -0
  59. data/gumbo-parser/src/tag_lookup.gperf +169 -0
  60. data/gumbo-parser/src/tag_lookup.h +13 -0
  61. data/gumbo-parser/src/token_buffer.c +79 -0
  62. data/gumbo-parser/src/token_buffer.h +71 -0
  63. data/gumbo-parser/src/token_type.h +17 -0
  64. data/gumbo-parser/src/tokenizer.c +3463 -0
  65. data/gumbo-parser/src/tokenizer.h +112 -0
  66. data/gumbo-parser/src/tokenizer_states.h +339 -0
  67. data/gumbo-parser/src/utf8.c +245 -0
  68. data/gumbo-parser/src/utf8.h +164 -0
  69. data/gumbo-parser/src/util.c +68 -0
  70. data/gumbo-parser/src/util.h +30 -0
  71. data/gumbo-parser/src/vector.c +111 -0
  72. data/gumbo-parser/src/vector.h +45 -0
  73. data/lib/nokogiri.rb +31 -29
  74. data/lib/nokogiri/css.rb +14 -14
  75. data/lib/nokogiri/css/parser.rb +1 -1
  76. data/lib/nokogiri/css/parser.y +1 -1
  77. data/lib/nokogiri/css/syntax_error.rb +1 -1
  78. data/lib/nokogiri/extension.rb +2 -2
  79. data/lib/nokogiri/gumbo.rb +14 -0
  80. data/lib/nokogiri/html.rb +31 -27
  81. data/lib/nokogiri/html4.rb +40 -0
  82. data/lib/nokogiri/{html → html4}/builder.rb +2 -2
  83. data/lib/nokogiri/{html → html4}/document.rb +4 -4
  84. data/lib/nokogiri/{html → html4}/document_fragment.rb +3 -3
  85. data/lib/nokogiri/{html → html4}/element_description.rb +1 -1
  86. data/lib/nokogiri/{html → html4}/element_description_defaults.rb +1 -1
  87. data/lib/nokogiri/{html → html4}/entity_lookup.rb +1 -1
  88. data/lib/nokogiri/{html → html4}/sax/parser.rb +11 -14
  89. data/lib/nokogiri/html4/sax/parser_context.rb +19 -0
  90. data/lib/nokogiri/{html → html4}/sax/push_parser.rb +5 -5
  91. data/lib/nokogiri/html5.rb +473 -0
  92. data/lib/nokogiri/html5/document.rb +74 -0
  93. data/lib/nokogiri/html5/document_fragment.rb +80 -0
  94. data/lib/nokogiri/html5/node.rb +93 -0
  95. data/lib/nokogiri/version/constant.rb +1 -1
  96. data/lib/nokogiri/version/info.rb +11 -2
  97. data/lib/nokogiri/xml.rb +35 -36
  98. data/lib/nokogiri/xml/node.rb +6 -5
  99. data/lib/nokogiri/xml/parse_options.rb +2 -0
  100. data/lib/nokogiri/xml/pp.rb +2 -2
  101. data/lib/nokogiri/xml/sax.rb +4 -4
  102. data/lib/nokogiri/xml/sax/document.rb +24 -30
  103. data/lib/nokogiri/xml/xpath.rb +2 -2
  104. data/lib/nokogiri/xslt.rb +16 -16
  105. data/lib/nokogiri/xslt/stylesheet.rb +1 -1
  106. metadata +100 -58
  107. data/lib/nokogiri/html/sax/parser_context.rb +0 -17
@@ -0,0 +1,382 @@
1
+ /* ANSI-C code produced by gperf version 3.1 */
2
+ /* Command-line: gperf -m100 lib/tag_lookup.gperf */
3
+ /* Computed positions: -k'1-2,$' */
4
+ /* Filtered by: mk/gperf-filter.sed */
5
+
6
+ #include "tag_lookup.h"
7
+ #include "macros.h"
8
+ #include "ascii.h"
9
+ #include <string.h>
10
+
11
+ #define TOTAL_KEYWORDS 150
12
+ #define MIN_WORD_LENGTH 1
13
+ #define MAX_WORD_LENGTH 14
14
+ #define MIN_HASH_VALUE 9
15
+ #define MAX_HASH_VALUE 271
16
+ /* maximum key range = 263, duplicates = 0 */
17
+
18
+
19
+
20
+ static inline unsigned int
21
+ hash (register const char *str, register size_t len)
22
+ {
23
+ static const unsigned short asso_values[] =
24
+ {
25
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
26
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
27
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
28
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
29
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 9,
30
+ 7, 6, 4, 4, 3, 4, 3, 3, 272, 272,
31
+ 272, 272, 272, 272, 272, 70, 83, 152, 7, 16,
32
+ 61, 98, 5, 76, 102, 126, 12, 19, 54, 54,
33
+ 31, 97, 3, 4, 9, 33, 136, 113, 86, 15,
34
+ 272, 272, 272, 272, 272, 272, 272, 70, 83, 152,
35
+ 7, 16, 61, 98, 5, 76, 102, 126, 12, 19,
36
+ 54, 54, 31, 97, 3, 4, 9, 33, 136, 113,
37
+ 86, 15, 272, 272, 272, 272, 272, 272, 272, 272,
38
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
39
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
40
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
41
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
42
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
43
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
44
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
45
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
46
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
47
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
48
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
49
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
50
+ 272, 272, 272, 272, 272, 272, 272, 272, 272
51
+ };
52
+ register unsigned int hval = len;
53
+
54
+ switch (hval)
55
+ {
56
+ default:
57
+ hval += asso_values[(unsigned char)str[1]+3];
58
+ /*FALLTHROUGH*/
59
+ case 1:
60
+ hval += asso_values[(unsigned char)str[0]];
61
+ break;
62
+ }
63
+ return hval + asso_values[(unsigned char)str[len - 1]];
64
+ }
65
+
66
+ const TagHashSlot *
67
+ gumbo_tag_lookup (register const char *str, register size_t len)
68
+ {
69
+ static const unsigned char lengthtable[] =
70
+ {
71
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2,
72
+ 2, 2, 2, 6, 2, 6, 2, 4, 0, 7, 6, 3, 0, 3,
73
+ 0, 6, 6, 8, 5, 0, 0, 4, 5, 5, 8, 0, 2, 4,
74
+ 5, 2, 0, 5, 4, 2, 0, 7, 0, 8, 5, 0, 0, 0,
75
+ 0, 0, 0, 5, 3, 4, 5, 1, 4, 0, 4, 1, 2, 8,
76
+ 7, 7, 6, 6, 8, 2, 8, 4, 2, 0, 6, 0, 0, 3,
77
+ 4, 6, 13, 4, 4, 6, 8, 0, 8, 4, 0, 6, 0, 8,
78
+ 4, 5, 0, 2, 2, 9, 2, 4, 0, 8, 4, 2, 4, 8,
79
+ 7, 0, 2, 5, 2, 0, 6, 0, 3, 2, 2, 6, 3, 8,
80
+ 7, 2, 5, 7, 0, 2, 6, 2, 4, 3, 0, 10, 5, 6,
81
+ 3, 1, 2, 0, 6, 0, 5, 5, 0, 3, 0, 3, 3, 1,
82
+ 4, 6, 4, 7, 3, 0, 0, 2, 10, 10, 0, 0, 6, 1,
83
+ 4, 6, 3, 0, 2, 5, 6, 4, 3, 4, 0, 7, 3, 0,
84
+ 0, 0, 4, 0, 0, 5, 0, 0, 0, 6, 0, 14, 8, 1,
85
+ 3, 0, 0, 7, 3, 0, 0, 0, 0, 0, 0, 5, 3, 0,
86
+ 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 7, 6, 0, 0,
87
+ 0, 0, 0, 5, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0,
88
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
89
+ 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
90
+ 0, 0, 5, 0, 0, 3
91
+ };
92
+ static const TagHashSlot wordlist[] =
93
+ {
94
+ {(char*)0,GUMBO_TAG_UNKNOWN},
95
+ {(char*)0,GUMBO_TAG_UNKNOWN},
96
+ {(char*)0,GUMBO_TAG_UNKNOWN},
97
+ {(char*)0,GUMBO_TAG_UNKNOWN},
98
+ {(char*)0,GUMBO_TAG_UNKNOWN},
99
+ {(char*)0,GUMBO_TAG_UNKNOWN},
100
+ {(char*)0,GUMBO_TAG_UNKNOWN},
101
+ {(char*)0,GUMBO_TAG_UNKNOWN},
102
+ {(char*)0,GUMBO_TAG_UNKNOWN},
103
+ {"s", GUMBO_TAG_S},
104
+ {(char*)0,GUMBO_TAG_UNKNOWN},
105
+ {(char*)0,GUMBO_TAG_UNKNOWN},
106
+ {(char*)0,GUMBO_TAG_UNKNOWN},
107
+ {"h6", GUMBO_TAG_H6},
108
+ {"h5", GUMBO_TAG_H5},
109
+ {"h4", GUMBO_TAG_H4},
110
+ {"h3", GUMBO_TAG_H3},
111
+ {"spacer", GUMBO_TAG_SPACER},
112
+ {"h2", GUMBO_TAG_H2},
113
+ {"header", GUMBO_TAG_HEADER},
114
+ {"h1", GUMBO_TAG_H1},
115
+ {"head", GUMBO_TAG_HEAD},
116
+ {(char*)0,GUMBO_TAG_UNKNOWN},
117
+ {"details", GUMBO_TAG_DETAILS},
118
+ {"select", GUMBO_TAG_SELECT},
119
+ {"dir", GUMBO_TAG_DIR},
120
+ {(char*)0,GUMBO_TAG_UNKNOWN},
121
+ {"del", GUMBO_TAG_DEL},
122
+ {(char*)0,GUMBO_TAG_UNKNOWN},
123
+ {"source", GUMBO_TAG_SOURCE},
124
+ {"legend", GUMBO_TAG_LEGEND},
125
+ {"datalist", GUMBO_TAG_DATALIST},
126
+ {"meter", GUMBO_TAG_METER},
127
+ {(char*)0,GUMBO_TAG_UNKNOWN},
128
+ {(char*)0,GUMBO_TAG_UNKNOWN},
129
+ {"math", GUMBO_TAG_MATH},
130
+ {"label", GUMBO_TAG_LABEL},
131
+ {"table", GUMBO_TAG_TABLE},
132
+ {"template", GUMBO_TAG_TEMPLATE},
133
+ {(char*)0,GUMBO_TAG_UNKNOWN},
134
+ {"rp", GUMBO_TAG_RP},
135
+ {"time", GUMBO_TAG_TIME},
136
+ {"title", GUMBO_TAG_TITLE},
137
+ {"hr", GUMBO_TAG_HR},
138
+ {(char*)0,GUMBO_TAG_UNKNOWN},
139
+ {"tbody", GUMBO_TAG_TBODY},
140
+ {"samp", GUMBO_TAG_SAMP},
141
+ {"tr", GUMBO_TAG_TR},
142
+ {(char*)0,GUMBO_TAG_UNKNOWN},
143
+ {"marquee", GUMBO_TAG_MARQUEE},
144
+ {(char*)0,GUMBO_TAG_UNKNOWN},
145
+ {"menuitem", GUMBO_TAG_MENUITEM},
146
+ {"small", GUMBO_TAG_SMALL},
147
+ {(char*)0,GUMBO_TAG_UNKNOWN},
148
+ {(char*)0,GUMBO_TAG_UNKNOWN},
149
+ {(char*)0,GUMBO_TAG_UNKNOWN},
150
+ {(char*)0,GUMBO_TAG_UNKNOWN},
151
+ {(char*)0,GUMBO_TAG_UNKNOWN},
152
+ {(char*)0,GUMBO_TAG_UNKNOWN},
153
+ {"embed", GUMBO_TAG_EMBED},
154
+ {"map", GUMBO_TAG_MAP},
155
+ {"menu", GUMBO_TAG_MENU},
156
+ {"param", GUMBO_TAG_PARAM},
157
+ {"p", GUMBO_TAG_P},
158
+ {"nobr", GUMBO_TAG_NOBR},
159
+ {(char*)0,GUMBO_TAG_UNKNOWN},
160
+ {"span", GUMBO_TAG_SPAN},
161
+ {"u", GUMBO_TAG_U},
162
+ {"em", GUMBO_TAG_EM},
163
+ {"noframes", GUMBO_TAG_NOFRAMES},
164
+ {"section", GUMBO_TAG_SECTION},
165
+ {"noembed", GUMBO_TAG_NOEMBED},
166
+ {"nextid", GUMBO_TAG_NEXTID},
167
+ {"footer", GUMBO_TAG_FOOTER},
168
+ {"noscript", GUMBO_TAG_NOSCRIPT},
169
+ {"dl", GUMBO_TAG_DL},
170
+ {"progress", GUMBO_TAG_PROGRESS},
171
+ {"font", GUMBO_TAG_FONT},
172
+ {"mo", GUMBO_TAG_MO},
173
+ {(char*)0,GUMBO_TAG_UNKNOWN},
174
+ {"script", GUMBO_TAG_SCRIPT},
175
+ {(char*)0,GUMBO_TAG_UNKNOWN},
176
+ {(char*)0,GUMBO_TAG_UNKNOWN},
177
+ {"pre", GUMBO_TAG_PRE},
178
+ {"main", GUMBO_TAG_MAIN},
179
+ {"object", GUMBO_TAG_OBJECT},
180
+ {"foreignobject", GUMBO_TAG_FOREIGNOBJECT},
181
+ {"form", GUMBO_TAG_FORM},
182
+ {"data", GUMBO_TAG_DATA},
183
+ {"applet", GUMBO_TAG_APPLET},
184
+ {"fieldset", GUMBO_TAG_FIELDSET},
185
+ {(char*)0,GUMBO_TAG_UNKNOWN},
186
+ {"textarea", GUMBO_TAG_TEXTAREA},
187
+ {"abbr", GUMBO_TAG_ABBR},
188
+ {(char*)0,GUMBO_TAG_UNKNOWN},
189
+ {"figure", GUMBO_TAG_FIGURE},
190
+ {(char*)0,GUMBO_TAG_UNKNOWN},
191
+ {"optgroup", GUMBO_TAG_OPTGROUP},
192
+ {"meta", GUMBO_TAG_META},
193
+ {"tfoot", GUMBO_TAG_TFOOT},
194
+ {(char*)0,GUMBO_TAG_UNKNOWN},
195
+ {"ul", GUMBO_TAG_UL},
196
+ {"li", GUMBO_TAG_LI},
197
+ {"plaintext", GUMBO_TAG_PLAINTEXT},
198
+ {"rb", GUMBO_TAG_RB},
199
+ {"body", GUMBO_TAG_BODY},
200
+ {(char*)0,GUMBO_TAG_UNKNOWN},
201
+ {"basefont", GUMBO_TAG_BASEFONT},
202
+ {"ruby", GUMBO_TAG_RUBY},
203
+ {"mi", GUMBO_TAG_MI},
204
+ {"base", GUMBO_TAG_BASE},
205
+ {"frameset", GUMBO_TAG_FRAMESET},
206
+ {"summary", GUMBO_TAG_SUMMARY},
207
+ {(char*)0,GUMBO_TAG_UNKNOWN},
208
+ {"dd", GUMBO_TAG_DD},
209
+ {"frame", GUMBO_TAG_FRAME},
210
+ {"td", GUMBO_TAG_TD},
211
+ {(char*)0,GUMBO_TAG_UNKNOWN},
212
+ {"option", GUMBO_TAG_OPTION},
213
+ {(char*)0,GUMBO_TAG_UNKNOWN},
214
+ {"svg", GUMBO_TAG_SVG},
215
+ {"br", GUMBO_TAG_BR},
216
+ {"ol", GUMBO_TAG_OL},
217
+ {"dialog", GUMBO_TAG_DIALOG},
218
+ {"sup", GUMBO_TAG_SUP},
219
+ {"multicol", GUMBO_TAG_MULTICOL},
220
+ {"article", GUMBO_TAG_ARTICLE},
221
+ {"rt", GUMBO_TAG_RT},
222
+ {"image", GUMBO_TAG_IMAGE},
223
+ {"listing", GUMBO_TAG_LISTING},
224
+ {(char*)0,GUMBO_TAG_UNKNOWN},
225
+ {"dt", GUMBO_TAG_DT},
226
+ {"mglyph", GUMBO_TAG_MGLYPH},
227
+ {"tt", GUMBO_TAG_TT},
228
+ {"html", GUMBO_TAG_HTML},
229
+ {"wbr", GUMBO_TAG_WBR},
230
+ {(char*)0,GUMBO_TAG_UNKNOWN},
231
+ {"figcaption", GUMBO_TAG_FIGCAPTION},
232
+ {"style", GUMBO_TAG_STYLE},
233
+ {"strike", GUMBO_TAG_STRIKE},
234
+ {"dfn", GUMBO_TAG_DFN},
235
+ {"a", GUMBO_TAG_A},
236
+ {"th", GUMBO_TAG_TH},
237
+ {(char*)0,GUMBO_TAG_UNKNOWN},
238
+ {"hgroup", GUMBO_TAG_HGROUP},
239
+ {(char*)0,GUMBO_TAG_UNKNOWN},
240
+ {"mtext", GUMBO_TAG_MTEXT},
241
+ {"thead", GUMBO_TAG_THEAD},
242
+ {(char*)0,GUMBO_TAG_UNKNOWN},
243
+ {"var", GUMBO_TAG_VAR},
244
+ {(char*)0,GUMBO_TAG_UNKNOWN},
245
+ {"xmp", GUMBO_TAG_XMP},
246
+ {"kbd", GUMBO_TAG_KBD},
247
+ {"i", GUMBO_TAG_I},
248
+ {"link", GUMBO_TAG_LINK},
249
+ {"output", GUMBO_TAG_OUTPUT},
250
+ {"mark", GUMBO_TAG_MARK},
251
+ {"acronym", GUMBO_TAG_ACRONYM},
252
+ {"div", GUMBO_TAG_DIV},
253
+ {(char*)0,GUMBO_TAG_UNKNOWN},
254
+ {(char*)0,GUMBO_TAG_UNKNOWN},
255
+ {"ms", GUMBO_TAG_MS},
256
+ {"malignmark", GUMBO_TAG_MALIGNMARK},
257
+ {"blockquote", GUMBO_TAG_BLOCKQUOTE},
258
+ {(char*)0,GUMBO_TAG_UNKNOWN},
259
+ {(char*)0,GUMBO_TAG_UNKNOWN},
260
+ {"center", GUMBO_TAG_CENTER},
261
+ {"b", GUMBO_TAG_B},
262
+ {"desc", GUMBO_TAG_DESC},
263
+ {"canvas", GUMBO_TAG_CANVAS},
264
+ {"col", GUMBO_TAG_COL},
265
+ {(char*)0,GUMBO_TAG_UNKNOWN},
266
+ {"mn", GUMBO_TAG_MN},
267
+ {"track", GUMBO_TAG_TRACK},
268
+ {"iframe", GUMBO_TAG_IFRAME},
269
+ {"code", GUMBO_TAG_CODE},
270
+ {"sub", GUMBO_TAG_SUB},
271
+ {"area", GUMBO_TAG_AREA},
272
+ {(char*)0,GUMBO_TAG_UNKNOWN},
273
+ {"address", GUMBO_TAG_ADDRESS},
274
+ {"ins", GUMBO_TAG_INS},
275
+ {(char*)0,GUMBO_TAG_UNKNOWN},
276
+ {(char*)0,GUMBO_TAG_UNKNOWN},
277
+ {(char*)0,GUMBO_TAG_UNKNOWN},
278
+ {"cite", GUMBO_TAG_CITE},
279
+ {(char*)0,GUMBO_TAG_UNKNOWN},
280
+ {(char*)0,GUMBO_TAG_UNKNOWN},
281
+ {"input", GUMBO_TAG_INPUT},
282
+ {(char*)0,GUMBO_TAG_UNKNOWN},
283
+ {(char*)0,GUMBO_TAG_UNKNOWN},
284
+ {(char*)0,GUMBO_TAG_UNKNOWN},
285
+ {"keygen", GUMBO_TAG_KEYGEN},
286
+ {(char*)0,GUMBO_TAG_UNKNOWN},
287
+ {"annotation-xml", GUMBO_TAG_ANNOTATION_XML},
288
+ {"colgroup", GUMBO_TAG_COLGROUP},
289
+ {"q", GUMBO_TAG_Q},
290
+ {"big", GUMBO_TAG_BIG},
291
+ {(char*)0,GUMBO_TAG_UNKNOWN},
292
+ {(char*)0,GUMBO_TAG_UNKNOWN},
293
+ {"bgsound", GUMBO_TAG_BGSOUND},
294
+ {"nav", GUMBO_TAG_NAV},
295
+ {(char*)0,GUMBO_TAG_UNKNOWN},
296
+ {(char*)0,GUMBO_TAG_UNKNOWN},
297
+ {(char*)0,GUMBO_TAG_UNKNOWN},
298
+ {(char*)0,GUMBO_TAG_UNKNOWN},
299
+ {(char*)0,GUMBO_TAG_UNKNOWN},
300
+ {(char*)0,GUMBO_TAG_UNKNOWN},
301
+ {"video", GUMBO_TAG_VIDEO},
302
+ {"img", GUMBO_TAG_IMG},
303
+ {(char*)0,GUMBO_TAG_UNKNOWN},
304
+ {(char*)0,GUMBO_TAG_UNKNOWN},
305
+ {(char*)0,GUMBO_TAG_UNKNOWN},
306
+ {(char*)0,GUMBO_TAG_UNKNOWN},
307
+ {(char*)0,GUMBO_TAG_UNKNOWN},
308
+ {(char*)0,GUMBO_TAG_UNKNOWN},
309
+ {"audio", GUMBO_TAG_AUDIO},
310
+ {(char*)0,GUMBO_TAG_UNKNOWN},
311
+ {(char*)0,GUMBO_TAG_UNKNOWN},
312
+ {(char*)0,GUMBO_TAG_UNKNOWN},
313
+ {(char*)0,GUMBO_TAG_UNKNOWN},
314
+ {"caption", GUMBO_TAG_CAPTION},
315
+ {"strong", GUMBO_TAG_STRONG},
316
+ {(char*)0,GUMBO_TAG_UNKNOWN},
317
+ {(char*)0,GUMBO_TAG_UNKNOWN},
318
+ {(char*)0,GUMBO_TAG_UNKNOWN},
319
+ {(char*)0,GUMBO_TAG_UNKNOWN},
320
+ {(char*)0,GUMBO_TAG_UNKNOWN},
321
+ {"aside", GUMBO_TAG_ASIDE},
322
+ {(char*)0,GUMBO_TAG_UNKNOWN},
323
+ {"button", GUMBO_TAG_BUTTON},
324
+ {(char*)0,GUMBO_TAG_UNKNOWN},
325
+ {(char*)0,GUMBO_TAG_UNKNOWN},
326
+ {(char*)0,GUMBO_TAG_UNKNOWN},
327
+ {(char*)0,GUMBO_TAG_UNKNOWN},
328
+ {(char*)0,GUMBO_TAG_UNKNOWN},
329
+ {(char*)0,GUMBO_TAG_UNKNOWN},
330
+ {(char*)0,GUMBO_TAG_UNKNOWN},
331
+ {(char*)0,GUMBO_TAG_UNKNOWN},
332
+ {"bdo", GUMBO_TAG_BDO},
333
+ {(char*)0,GUMBO_TAG_UNKNOWN},
334
+ {(char*)0,GUMBO_TAG_UNKNOWN},
335
+ {(char*)0,GUMBO_TAG_UNKNOWN},
336
+ {(char*)0,GUMBO_TAG_UNKNOWN},
337
+ {(char*)0,GUMBO_TAG_UNKNOWN},
338
+ {(char*)0,GUMBO_TAG_UNKNOWN},
339
+ {(char*)0,GUMBO_TAG_UNKNOWN},
340
+ {(char*)0,GUMBO_TAG_UNKNOWN},
341
+ {(char*)0,GUMBO_TAG_UNKNOWN},
342
+ {(char*)0,GUMBO_TAG_UNKNOWN},
343
+ {(char*)0,GUMBO_TAG_UNKNOWN},
344
+ {(char*)0,GUMBO_TAG_UNKNOWN},
345
+ {(char*)0,GUMBO_TAG_UNKNOWN},
346
+ {(char*)0,GUMBO_TAG_UNKNOWN},
347
+ {(char*)0,GUMBO_TAG_UNKNOWN},
348
+ {(char*)0,GUMBO_TAG_UNKNOWN},
349
+ {(char*)0,GUMBO_TAG_UNKNOWN},
350
+ {(char*)0,GUMBO_TAG_UNKNOWN},
351
+ {(char*)0,GUMBO_TAG_UNKNOWN},
352
+ {(char*)0,GUMBO_TAG_UNKNOWN},
353
+ {(char*)0,GUMBO_TAG_UNKNOWN},
354
+ {"bdi", GUMBO_TAG_BDI},
355
+ {(char*)0,GUMBO_TAG_UNKNOWN},
356
+ {(char*)0,GUMBO_TAG_UNKNOWN},
357
+ {(char*)0,GUMBO_TAG_UNKNOWN},
358
+ {(char*)0,GUMBO_TAG_UNKNOWN},
359
+ {(char*)0,GUMBO_TAG_UNKNOWN},
360
+ {(char*)0,GUMBO_TAG_UNKNOWN},
361
+ {(char*)0,GUMBO_TAG_UNKNOWN},
362
+ {"blink", GUMBO_TAG_BLINK},
363
+ {(char*)0,GUMBO_TAG_UNKNOWN},
364
+ {(char*)0,GUMBO_TAG_UNKNOWN},
365
+ {"rtc", GUMBO_TAG_RTC}
366
+ };
367
+
368
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
369
+ {
370
+ register unsigned int key = hash (str, len);
371
+
372
+ if (key <= MAX_HASH_VALUE)
373
+ if (len == lengthtable[key])
374
+ {
375
+ register const char *s = wordlist[key].key;
376
+
377
+ if (s && (((unsigned char)*str ^ (unsigned char)*s) & ~32) == 0 && !gumbo_ascii_strncasecmp(str, s, len))
378
+ return &wordlist[key];
379
+ }
380
+ }
381
+ return 0;
382
+ }
@@ -0,0 +1,169 @@
1
+ %{
2
+ #include "tag_lookup.h"
3
+ #include "macros.h"
4
+ #include "ascii.h"
5
+ %}
6
+
7
+ %ignore-case
8
+ %struct-type
9
+ %omit-struct-type
10
+ %compare-lengths
11
+ %readonly-tables
12
+ %null-strings
13
+ %includes
14
+ %define lookup-function-name gumbo_tag_lookup
15
+ %define slot-name key
16
+ %define initializer-suffix ,GUMBO_TAG_UNKNOWN
17
+ TagHashSlot;
18
+
19
+ %%
20
+ html, GUMBO_TAG_HTML
21
+ head, GUMBO_TAG_HEAD
22
+ title, GUMBO_TAG_TITLE
23
+ base, GUMBO_TAG_BASE
24
+ link, GUMBO_TAG_LINK
25
+ meta, GUMBO_TAG_META
26
+ style, GUMBO_TAG_STYLE
27
+ script, GUMBO_TAG_SCRIPT
28
+ noscript, GUMBO_TAG_NOSCRIPT
29
+ template, GUMBO_TAG_TEMPLATE
30
+ body, GUMBO_TAG_BODY
31
+ article, GUMBO_TAG_ARTICLE
32
+ section, GUMBO_TAG_SECTION
33
+ nav, GUMBO_TAG_NAV
34
+ aside, GUMBO_TAG_ASIDE
35
+ h1, GUMBO_TAG_H1
36
+ h2, GUMBO_TAG_H2
37
+ h3, GUMBO_TAG_H3
38
+ h4, GUMBO_TAG_H4
39
+ h5, GUMBO_TAG_H5
40
+ h6, GUMBO_TAG_H6
41
+ hgroup, GUMBO_TAG_HGROUP
42
+ header, GUMBO_TAG_HEADER
43
+ footer, GUMBO_TAG_FOOTER
44
+ address, GUMBO_TAG_ADDRESS
45
+ p, GUMBO_TAG_P
46
+ hr, GUMBO_TAG_HR
47
+ pre, GUMBO_TAG_PRE
48
+ blockquote, GUMBO_TAG_BLOCKQUOTE
49
+ ol, GUMBO_TAG_OL
50
+ ul, GUMBO_TAG_UL
51
+ li, GUMBO_TAG_LI
52
+ dl, GUMBO_TAG_DL
53
+ dt, GUMBO_TAG_DT
54
+ dd, GUMBO_TAG_DD
55
+ figure, GUMBO_TAG_FIGURE
56
+ figcaption, GUMBO_TAG_FIGCAPTION
57
+ main, GUMBO_TAG_MAIN
58
+ div, GUMBO_TAG_DIV
59
+ a, GUMBO_TAG_A
60
+ em, GUMBO_TAG_EM
61
+ strong, GUMBO_TAG_STRONG
62
+ small, GUMBO_TAG_SMALL
63
+ s, GUMBO_TAG_S
64
+ cite, GUMBO_TAG_CITE
65
+ q, GUMBO_TAG_Q
66
+ dfn, GUMBO_TAG_DFN
67
+ abbr, GUMBO_TAG_ABBR
68
+ data, GUMBO_TAG_DATA
69
+ time, GUMBO_TAG_TIME
70
+ code, GUMBO_TAG_CODE
71
+ var, GUMBO_TAG_VAR
72
+ samp, GUMBO_TAG_SAMP
73
+ kbd, GUMBO_TAG_KBD
74
+ sub, GUMBO_TAG_SUB
75
+ sup, GUMBO_TAG_SUP
76
+ i, GUMBO_TAG_I
77
+ b, GUMBO_TAG_B
78
+ u, GUMBO_TAG_U
79
+ mark, GUMBO_TAG_MARK
80
+ ruby, GUMBO_TAG_RUBY
81
+ rt, GUMBO_TAG_RT
82
+ rp, GUMBO_TAG_RP
83
+ bdi, GUMBO_TAG_BDI
84
+ bdo, GUMBO_TAG_BDO
85
+ span, GUMBO_TAG_SPAN
86
+ br, GUMBO_TAG_BR
87
+ wbr, GUMBO_TAG_WBR
88
+ ins, GUMBO_TAG_INS
89
+ del, GUMBO_TAG_DEL
90
+ image, GUMBO_TAG_IMAGE
91
+ img, GUMBO_TAG_IMG
92
+ iframe, GUMBO_TAG_IFRAME
93
+ embed, GUMBO_TAG_EMBED
94
+ object, GUMBO_TAG_OBJECT
95
+ param, GUMBO_TAG_PARAM
96
+ video, GUMBO_TAG_VIDEO
97
+ audio, GUMBO_TAG_AUDIO
98
+ source, GUMBO_TAG_SOURCE
99
+ track, GUMBO_TAG_TRACK
100
+ canvas, GUMBO_TAG_CANVAS
101
+ map, GUMBO_TAG_MAP
102
+ area, GUMBO_TAG_AREA
103
+ math, GUMBO_TAG_MATH
104
+ mi, GUMBO_TAG_MI
105
+ mo, GUMBO_TAG_MO
106
+ mn, GUMBO_TAG_MN
107
+ ms, GUMBO_TAG_MS
108
+ mtext, GUMBO_TAG_MTEXT
109
+ mglyph, GUMBO_TAG_MGLYPH
110
+ malignmark, GUMBO_TAG_MALIGNMARK
111
+ annotation-xml, GUMBO_TAG_ANNOTATION_XML
112
+ svg, GUMBO_TAG_SVG
113
+ foreignobject, GUMBO_TAG_FOREIGNOBJECT
114
+ desc, GUMBO_TAG_DESC
115
+ table, GUMBO_TAG_TABLE
116
+ caption, GUMBO_TAG_CAPTION
117
+ colgroup, GUMBO_TAG_COLGROUP
118
+ col, GUMBO_TAG_COL
119
+ tbody, GUMBO_TAG_TBODY
120
+ thead, GUMBO_TAG_THEAD
121
+ tfoot, GUMBO_TAG_TFOOT
122
+ tr, GUMBO_TAG_TR
123
+ td, GUMBO_TAG_TD
124
+ th, GUMBO_TAG_TH
125
+ form, GUMBO_TAG_FORM
126
+ fieldset, GUMBO_TAG_FIELDSET
127
+ legend, GUMBO_TAG_LEGEND
128
+ label, GUMBO_TAG_LABEL
129
+ input, GUMBO_TAG_INPUT
130
+ button, GUMBO_TAG_BUTTON
131
+ select, GUMBO_TAG_SELECT
132
+ datalist, GUMBO_TAG_DATALIST
133
+ optgroup, GUMBO_TAG_OPTGROUP
134
+ option, GUMBO_TAG_OPTION
135
+ textarea, GUMBO_TAG_TEXTAREA
136
+ keygen, GUMBO_TAG_KEYGEN
137
+ output, GUMBO_TAG_OUTPUT
138
+ progress, GUMBO_TAG_PROGRESS
139
+ meter, GUMBO_TAG_METER
140
+ details, GUMBO_TAG_DETAILS
141
+ summary, GUMBO_TAG_SUMMARY
142
+ menu, GUMBO_TAG_MENU
143
+ menuitem, GUMBO_TAG_MENUITEM
144
+ applet, GUMBO_TAG_APPLET
145
+ acronym, GUMBO_TAG_ACRONYM
146
+ bgsound, GUMBO_TAG_BGSOUND
147
+ dir, GUMBO_TAG_DIR
148
+ frame, GUMBO_TAG_FRAME
149
+ frameset, GUMBO_TAG_FRAMESET
150
+ noframes, GUMBO_TAG_NOFRAMES
151
+ listing, GUMBO_TAG_LISTING
152
+ xmp, GUMBO_TAG_XMP
153
+ nextid, GUMBO_TAG_NEXTID
154
+ noembed, GUMBO_TAG_NOEMBED
155
+ plaintext, GUMBO_TAG_PLAINTEXT
156
+ rb, GUMBO_TAG_RB
157
+ strike, GUMBO_TAG_STRIKE
158
+ basefont, GUMBO_TAG_BASEFONT
159
+ big, GUMBO_TAG_BIG
160
+ blink, GUMBO_TAG_BLINK
161
+ center, GUMBO_TAG_CENTER
162
+ font, GUMBO_TAG_FONT
163
+ marquee, GUMBO_TAG_MARQUEE
164
+ multicol, GUMBO_TAG_MULTICOL
165
+ nobr, GUMBO_TAG_NOBR
166
+ spacer, GUMBO_TAG_SPACER
167
+ tt, GUMBO_TAG_TT
168
+ rtc, GUMBO_TAG_RTC
169
+ dialog, GUMBO_TAG_DIALOG