makiri 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +18 -7
- data/CHANGELOG.md +148 -5
- data/README.md +173 -7
- data/Rakefile +103 -7
- data/ext/makiri/bridge/bridge.h +28 -0
- data/ext/makiri/bridge/ruby_string.c +217 -0
- data/ext/makiri/core/mkr_alloc.h +1 -1
- data/ext/makiri/core/mkr_buf.c +35 -1
- data/ext/makiri/core/mkr_buf.h +37 -3
- data/ext/makiri/core/mkr_core.h +1 -1
- data/ext/makiri/core/mkr_hash.h +1 -1
- data/ext/makiri/core/mkr_text.h +8 -8
- data/ext/makiri/extconf.rb +20 -2
- data/ext/makiri/glue/glue.h +53 -11
- data/ext/makiri/glue/ruby_doc.c +165 -35
- data/ext/makiri/glue/ruby_html_css.c +246 -0
- data/ext/makiri/glue/{ruby_mutate.c → ruby_html_mutate.c} +271 -43
- data/ext/makiri/glue/ruby_html_node.c +888 -0
- data/ext/makiri/glue/ruby_html_serialize.c +154 -0
- data/ext/makiri/glue/ruby_node.c +54 -555
- data/ext/makiri/glue/ruby_node_set.c +167 -32
- data/ext/makiri/glue/ruby_xml.c +420 -0
- data/ext/makiri/glue/ruby_xml_node.c +1386 -0
- data/ext/makiri/glue/ruby_xpath.c +60 -27
- data/ext/makiri/glue/ruby_xpath.h +19 -0
- data/ext/makiri/lexbor_compat/compat.h +42 -9
- data/ext/makiri/lexbor_compat/compat_internal.h +1 -1
- data/ext/makiri/lexbor_compat/dom_index.c +2 -2
- data/ext/makiri/lexbor_compat/post_parse.c +100 -10
- data/ext/makiri/lexbor_compat/source_loc.c +13 -9
- data/ext/makiri/lexbor_compat/text_index.c +14 -8
- data/ext/makiri/lexbor_compat/utf8_input.c +85 -26
- data/ext/makiri/makiri.c +139 -6
- data/ext/makiri/makiri.h +43 -2
- data/ext/makiri/xml/mkr_xml.h +126 -0
- data/ext/makiri/xml/mkr_xml_chars.c +225 -0
- data/ext/makiri/xml/mkr_xml_mutate.c +875 -0
- data/ext/makiri/xml/mkr_xml_mutate.h +139 -0
- data/ext/makiri/xml/mkr_xml_node.c +267 -0
- data/ext/makiri/xml/mkr_xml_node.h +119 -0
- data/ext/makiri/xml/mkr_xml_tree.c +1479 -0
- data/ext/makiri/xpath/mkr_xpath.c +59 -32
- data/ext/makiri/xpath/mkr_xpath.h +96 -4
- data/ext/makiri/xpath/mkr_xpath_engine_html.c +17 -0
- data/ext/makiri/xpath/mkr_xpath_engine_xml.c +12 -0
- data/ext/makiri/xpath/{mkr_xpath_eval.c → mkr_xpath_eval_body.h} +202 -175
- data/ext/makiri/xpath/{mkr_xpath_funcs.c → mkr_xpath_funcs_body.h} +110 -86
- data/ext/makiri/xpath/mkr_xpath_internal.h +91 -200
- data/ext/makiri/xpath/mkr_xpath_lex.c +2 -2
- data/ext/makiri/xpath/mkr_xpath_node_access_html.h +138 -0
- data/ext/makiri/xpath/mkr_xpath_node_access_xml.h +142 -0
- data/ext/makiri/xpath/mkr_xpath_parse.c +5 -5
- data/ext/makiri/xpath/mkr_xpath_prelude_html.h +30 -0
- data/ext/makiri/xpath/mkr_xpath_prelude_xml.h +28 -0
- data/ext/makiri/xpath/mkr_xpath_shared.c +593 -0
- data/ext/makiri/xpath/{mkr_xpath_value.c → mkr_xpath_value_body.h} +145 -656
- data/ext/makiri/xpath/mkr_xpath_xml_selftest.c +76 -0
- data/lib/makiri/{attribute.rb → attr.rb} +7 -3
- data/lib/makiri/cdata_section.rb +21 -0
- data/lib/makiri/comment.rb +12 -0
- data/lib/makiri/compat_aliases.rb +30 -0
- data/lib/makiri/document.rb +4 -76
- data/lib/makiri/document_fragment.rb +14 -9
- data/lib/makiri/element.rb +5 -3
- data/lib/makiri/html/document.rb +106 -0
- data/lib/makiri/html/node_methods.rb +19 -0
- data/lib/makiri/html.rb +12 -0
- data/lib/makiri/node.rb +58 -15
- data/lib/makiri/node_set.rb +8 -0
- data/lib/makiri/processing_instruction.rb +12 -0
- data/lib/makiri/text.rb +2 -0
- data/lib/makiri/version.rb +1 -1
- data/lib/makiri/xml/document.rb +24 -0
- data/lib/makiri/xml/node_methods.rb +37 -0
- data/lib/makiri/xml.rb +10 -0
- data/lib/makiri/xpath_context.rb +1 -1
- data/lib/makiri.rb +23 -5
- data/script/build_native_gem.rb +2 -2
- data/script/check_c_safety.rb +32 -0
- data/script/check_c_safety_allowlist.yml +83 -0
- metadata +35 -565
- data/ext/makiri/glue/ruby_css.c +0 -185
- data/ext/makiri/glue/ruby_serialize.c +0 -92
- data/lib/makiri/cdata.rb +0 -6
- data/vendor/lexbor/.github/FUNDING.yml +0 -12
- data/vendor/lexbor/.github/workflows/cmake.yml +0 -37
- data/vendor/lexbor/benchmarks/CMakeLists.txt +0 -22
- data/vendor/lexbor/benchmarks/benchmark.h +0 -101
- data/vendor/lexbor/benchmarks/lexbor/html/CMakeLists.txt +0 -16
- data/vendor/lexbor/benchmarks/lexbor/html/tokenizer/input_validation.c +0 -100
- data/vendor/lexbor/benchmarks/lexbor/html/tokenizer/parse.c +0 -95
- data/vendor/lexbor/benchmarks/lexbor/selectors/CMakeLists.txt +0 -16
- data/vendor/lexbor/benchmarks/lexbor/selectors/files/average.html +0 -41
- data/vendor/lexbor/benchmarks/lexbor/selectors/selectors.c +0 -144
- data/vendor/lexbor/examples/CMakeLists.txt +0 -17
- data/vendor/lexbor/examples/lexbor/css/CMakeLists.txt +0 -25
- data/vendor/lexbor/examples/lexbor/css/StyleSheet.c +0 -70
- data/vendor/lexbor/examples/lexbor/css/base.h +0 -34
- data/vendor/lexbor/examples/lexbor/css/selectors/list_easy_way.c +0 -74
- data/vendor/lexbor/examples/lexbor/css/selectors/list_fast_way.c +0 -149
- data/vendor/lexbor/examples/lexbor/css/syntax/structure_parse_file.c +0 -467
- data/vendor/lexbor/examples/lexbor/css/syntax/tokenizer/from_file.c +0 -87
- data/vendor/lexbor/examples/lexbor/css/syntax/tokenizer/print_raw.c +0 -100
- data/vendor/lexbor/examples/lexbor/encoding/CMakeLists.txt +0 -11
- data/vendor/lexbor/examples/lexbor/encoding/buffer/decode/decode.c +0 -58
- data/vendor/lexbor/examples/lexbor/encoding/buffer/decode/decoder.c +0 -140
- data/vendor/lexbor/examples/lexbor/encoding/buffer/decode/validate.c +0 -65
- data/vendor/lexbor/examples/lexbor/encoding/buffer/encode/encode.c +0 -67
- data/vendor/lexbor/examples/lexbor/encoding/buffer/encode/encoder.c +0 -262
- data/vendor/lexbor/examples/lexbor/encoding/buffer/encode/validate.c +0 -77
- data/vendor/lexbor/examples/lexbor/encoding/buffer/from_to.c +0 -193
- data/vendor/lexbor/examples/lexbor/encoding/data_by_name.c +0 -23
- data/vendor/lexbor/examples/lexbor/encoding/single/decode/decode.c +0 -55
- data/vendor/lexbor/examples/lexbor/encoding/single/decode/decoder.c +0 -115
- data/vendor/lexbor/examples/lexbor/encoding/single/decode/validate.c +0 -59
- data/vendor/lexbor/examples/lexbor/encoding/single/encode/encode.c +0 -65
- data/vendor/lexbor/examples/lexbor/encoding/single/encode/encoder.c +0 -241
- data/vendor/lexbor/examples/lexbor/encoding/single/encode/validate.c +0 -85
- data/vendor/lexbor/examples/lexbor/encoding/single/from_to.c +0 -156
- data/vendor/lexbor/examples/lexbor/html/CMakeLists.txt +0 -21
- data/vendor/lexbor/examples/lexbor/html/base.h +0 -98
- data/vendor/lexbor/examples/lexbor/html/document_parse.c +0 -43
- data/vendor/lexbor/examples/lexbor/html/document_parse_chunk.c +0 -72
- data/vendor/lexbor/examples/lexbor/html/document_title.c +0 -84
- data/vendor/lexbor/examples/lexbor/html/element_attributes.c +0 -134
- data/vendor/lexbor/examples/lexbor/html/element_create.c +0 -84
- data/vendor/lexbor/examples/lexbor/html/element_innerHTML.c +0 -52
- data/vendor/lexbor/examples/lexbor/html/elements_by_attr.c +0 -106
- data/vendor/lexbor/examples/lexbor/html/elements_by_class_name.c +0 -55
- data/vendor/lexbor/examples/lexbor/html/elements_by_tag_name.c +0 -51
- data/vendor/lexbor/examples/lexbor/html/encoding.c +0 -95
- data/vendor/lexbor/examples/lexbor/html/html2sexpr.c +0 -231
- data/vendor/lexbor/examples/lexbor/html/parse.c +0 -69
- data/vendor/lexbor/examples/lexbor/html/parse_chunk.c +0 -77
- data/vendor/lexbor/examples/lexbor/html/tokenizer/callback.c +0 -78
- data/vendor/lexbor/examples/lexbor/html/tokenizer/simple.c +0 -118
- data/vendor/lexbor/examples/lexbor/html/tokenizer/tag_attributes.c +0 -106
- data/vendor/lexbor/examples/lexbor/html/tokenizer/text.c +0 -75
- data/vendor/lexbor/examples/lexbor/punycode/CMakeLists.txt +0 -11
- data/vendor/lexbor/examples/lexbor/punycode/decode.c +0 -102
- data/vendor/lexbor/examples/lexbor/punycode/encode.c +0 -102
- data/vendor/lexbor/examples/lexbor/selectors/CMakeLists.txt +0 -15
- data/vendor/lexbor/examples/lexbor/selectors/easy_way.c +0 -120
- data/vendor/lexbor/examples/lexbor/selectors/normal_way.c +0 -172
- data/vendor/lexbor/examples/lexbor/selectors/unique_nodes.c +0 -142
- data/vendor/lexbor/examples/lexbor/styles/CMakeLists.txt +0 -15
- data/vendor/lexbor/examples/lexbor/styles/attribute_style.c +0 -110
- data/vendor/lexbor/examples/lexbor/styles/base.h +0 -34
- data/vendor/lexbor/examples/lexbor/styles/events_insert.c +0 -199
- data/vendor/lexbor/examples/lexbor/styles/stylesheet.c +0 -141
- data/vendor/lexbor/examples/lexbor/styles/walk.c +0 -170
- data/vendor/lexbor/examples/lexbor/unicode/CMakeLists.txt +0 -17
- data/vendor/lexbor/examples/lexbor/unicode/idna_to_ascii.c +0 -115
- data/vendor/lexbor/examples/lexbor/unicode/normalization_form.c +0 -99
- data/vendor/lexbor/examples/lexbor/unicode/normalization_form_stdin.c +0 -99
- data/vendor/lexbor/examples/lexbor/url/CMakeLists.txt +0 -15
- data/vendor/lexbor/examples/lexbor/url/parse.c +0 -101
- data/vendor/lexbor/examples/lexbor/url/relative.c +0 -112
- data/vendor/lexbor/images/SerpApi-logo.png +0 -0
- data/vendor/lexbor/images/neural-logo.png +0 -0
- data/vendor/lexbor/packaging/Makefile +0 -26
- data/vendor/lexbor/packaging/README.md +0 -17
- data/vendor/lexbor/packaging/deb/Makefile.in +0 -40
- data/vendor/lexbor/packaging/deb/Makefile.module.in +0 -15
- data/vendor/lexbor/packaging/deb/debian_in/changelog +0 -6
- data/vendor/lexbor/packaging/deb/debian_in/control +0 -25
- data/vendor/lexbor/packaging/deb/debian_in/copyright +0 -29
- data/vendor/lexbor/packaging/deb/debian_in/dev.dirs +0 -2
- data/vendor/lexbor/packaging/deb/debian_in/dev.install +0 -3
- data/vendor/lexbor/packaging/deb/debian_in/dirs +0 -1
- data/vendor/lexbor/packaging/deb/debian_in/docs +0 -2
- data/vendor/lexbor/packaging/deb/debian_in/install +0 -1
- data/vendor/lexbor/packaging/deb/debian_in/not-installed +0 -4
- data/vendor/lexbor/packaging/deb/debian_in/rules +0 -15
- data/vendor/lexbor/packaging/deb/debian_in/source/format +0 -1
- data/vendor/lexbor/packaging/deb/debian_main_in/changelog +0 -6
- data/vendor/lexbor/packaging/deb/debian_main_in/control +0 -33
- data/vendor/lexbor/packaging/deb/debian_main_in/copyright +0 -29
- data/vendor/lexbor/packaging/deb/debian_main_in/dev.dirs +0 -3
- data/vendor/lexbor/packaging/deb/debian_main_in/dev.install +0 -5
- data/vendor/lexbor/packaging/deb/debian_main_in/dirs +0 -1
- data/vendor/lexbor/packaging/deb/debian_main_in/docs +0 -2
- data/vendor/lexbor/packaging/deb/debian_main_in/install +0 -1
- data/vendor/lexbor/packaging/deb/debian_main_in/rules +0 -15
- data/vendor/lexbor/packaging/deb/debian_main_in/source/format +0 -1
- data/vendor/lexbor/packaging/rpm/Makefile +0 -14
- data/vendor/lexbor/packaging/rpm/build.sh +0 -105
- data/vendor/lexbor/packaging/rpm/liblexbor-module.spec.in +0 -31
- data/vendor/lexbor/packaging/rpm/liblexbor.spec.in +0 -62
- data/vendor/lexbor/test/CMakeLists.txt +0 -44
- data/vendor/lexbor/test/amalgamation/code/_base.h +0 -33
- data/vendor/lexbor/test/amalgamation/code/html.c +0 -35
- data/vendor/lexbor/test/amalgamation/generate_and_compile.sh +0 -130
- data/vendor/lexbor/test/external/commoncrawl.py +0 -110
- data/vendor/lexbor/test/files/lexbor/css/declarations/display.ton +0 -801
- data/vendor/lexbor/test/files/lexbor/css/declarations/height.ton +0 -367
- data/vendor/lexbor/test/files/lexbor/css/declarations/syntax.ton +0 -189
- data/vendor/lexbor/test/files/lexbor/css/declarations/width.ton +0 -367
- data/vendor/lexbor/test/files/lexbor/css/lexbor.css +0 -205
- data/vendor/lexbor/test/files/lexbor/css/syntax/parser/at.ton +0 -518
- data/vendor/lexbor/test/files/lexbor/css/syntax/parser/other.ton +0 -80
- data/vendor/lexbor/test/files/lexbor/css/syntax/parser/qualified.ton +0 -799
- data/vendor/lexbor/test/files/lexbor/css/syntax/tokenizer/CDO-CDC.ton +0 -226
- data/vendor/lexbor/test/files/lexbor/css/syntax/tokenizer/at.ton +0 -170
- data/vendor/lexbor/test/files/lexbor/css/syntax/tokenizer/broken-utf-8.ton +0 -101
- data/vendor/lexbor/test/files/lexbor/css/syntax/tokenizer/comment.ton +0 -95
- data/vendor/lexbor/test/files/lexbor/css/syntax/tokenizer/hash.ton +0 -181
- data/vendor/lexbor/test/files/lexbor/css/syntax/tokenizer/ident.ton +0 -245
- data/vendor/lexbor/test/files/lexbor/css/syntax/tokenizer/number.ton +0 -694
- data/vendor/lexbor/test/files/lexbor/css/syntax/tokenizer/other.ton +0 -16
- data/vendor/lexbor/test/files/lexbor/css/syntax/tokenizer/reverse-solidus.ton +0 -111
- data/vendor/lexbor/test/files/lexbor/css/syntax/tokenizer/single-tokens.ton +0 -66
- data/vendor/lexbor/test/files/lexbor/css/syntax/tokenizer/string.ton +0 -303
- data/vendor/lexbor/test/files/lexbor/css/syntax/tokenizer/unicode_range.ton +0 -139
- data/vendor/lexbor/test/files/lexbor/css/syntax/tokenizer/url-function.ton +0 -229
- data/vendor/lexbor/test/files/lexbor/css/syntax/tokenizer/whitespace.ton +0 -45
- data/vendor/lexbor/test/files/lexbor/encoding/big5_map_decode.txt +0 -14699
- data/vendor/lexbor/test/files/lexbor/encoding/euc_jp_map_decode.txt +0 -7737
- data/vendor/lexbor/test/files/lexbor/encoding/euc_kr_map_decode.txt +0 -17189
- data/vendor/lexbor/test/files/lexbor/encoding/gb18030_map_decode.txt +0 -27672
- data/vendor/lexbor/test/files/lexbor/encoding/iso_2022_jp_map_decode.txt +0 -7928
- data/vendor/lexbor/test/files/lexbor/encoding/shift_jis_map_decode.txt +0 -5138
- data/vendor/lexbor/test/files/lexbor/html/html5_test/README.md +0 -12
- data/vendor/lexbor/test/files/lexbor/html/html5_test/adoption01.ton +0 -442
- data/vendor/lexbor/test/files/lexbor/html/html5_test/adoption02.ton +0 -53
- data/vendor/lexbor/test/files/lexbor/html/html5_test/attributes.ton +0 -29
- data/vendor/lexbor/test/files/lexbor/html/html5_test/blocks.ton +0 -891
- data/vendor/lexbor/test/files/lexbor/html/html5_test/char_ref.ton +0 -51
- data/vendor/lexbor/test/files/lexbor/html/html5_test/comments01.ton +0 -290
- data/vendor/lexbor/test/files/lexbor/html/html5_test/doctype01.ton +0 -637
- data/vendor/lexbor/test/files/lexbor/html/html5_test/domjs-unsafe.ton +0 -822
- data/vendor/lexbor/test/files/lexbor/html/html5_test/entities01.ton +0 -1262
- data/vendor/lexbor/test/files/lexbor/html/html5_test/entities02.ton +0 -416
- data/vendor/lexbor/test/files/lexbor/html/html5_test/foreign-fragment.ton +0 -859
- data/vendor/lexbor/test/files/lexbor/html/html5_test/html5test-com.ton +0 -414
- data/vendor/lexbor/test/files/lexbor/html/html5_test/inbody01.ton +0 -78
- data/vendor/lexbor/test/files/lexbor/html/html5_test/isindex.ton +0 -67
- data/vendor/lexbor/test/files/lexbor/html/html5_test/main-element.ton +0 -63
- data/vendor/lexbor/test/files/lexbor/html/html5_test/math.ton +0 -140
- data/vendor/lexbor/test/files/lexbor/html/html5_test/menuitem-element.ton +0 -345
- data/vendor/lexbor/test/files/lexbor/html/html5_test/namespace-sensitivity.ton +0 -31
- data/vendor/lexbor/test/files/lexbor/html/html5_test/noscript01.ton +0 -344
- data/vendor/lexbor/test/files/lexbor/html/html5_test/pending-spec-changes-plain-text-unsafe.ton +0 -39
- data/vendor/lexbor/test/files/lexbor/html/html5_test/pending-spec-changes.ton +0 -65
- data/vendor/lexbor/test/files/lexbor/html/html5_test/plain-text-unsafe.ton +0 -657
- data/vendor/lexbor/test/files/lexbor/html/html5_test/quirks01.ton +0 -77
- data/vendor/lexbor/test/files/lexbor/html/html5_test/ruby.ton +0 -411
- data/vendor/lexbor/test/files/lexbor/html/html5_test/scriptdata01.ton +0 -499
- data/vendor/lexbor/test/files/lexbor/html/html5_test/search-element.ton +0 -63
- data/vendor/lexbor/test/files/lexbor/html/html5_test/svg.ton +0 -140
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tables01.ton +0 -421
- data/vendor/lexbor/test/files/lexbor/html/html5_test/template.ton +0 -2199
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests1.ton +0 -2486
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests10.ton +0 -1090
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests11.ton +0 -317
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests12.ton +0 -72
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests14.ton +0 -100
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests15.ton +0 -290
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests16.ton +0 -3471
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests17.ton +0 -244
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests18.ton +0 -752
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests19.ton +0 -1889
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests2.ton +0 -1093
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests20.ton +0 -1158
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests21.ton +0 -416
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests22.ton +0 -192
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests23.ton +0 -148
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests24.ton +0 -107
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests25.ton +0 -390
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests26.ton +0 -546
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests3.ton +0 -407
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests4.ton +0 -96
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests5.ton +0 -299
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests6.ton +0 -908
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests7.ton +0 -597
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests8.ton +0 -219
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests9.ton +0 -585
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tests_innerHTML_1.ton +0 -1164
- data/vendor/lexbor/test/files/lexbor/html/html5_test/tricky01.ton +0 -378
- data/vendor/lexbor/test/files/lexbor/html/html5_test/webkit01.ton +0 -1022
- data/vendor/lexbor/test/files/lexbor/html/html5_test/webkit02.ton +0 -996
- data/vendor/lexbor/test/files/lexbor/html/html5lib_encoding/README.md +0 -12
- data/vendor/lexbor/test/files/lexbor/html/html5lib_encoding/test-yahoo-jp.dat +0 -10
- data/vendor/lexbor/test/files/lexbor/html/html5lib_encoding/tests1.dat +0 -388
- data/vendor/lexbor/test/files/lexbor/html/html5lib_encoding/tests2.dat +0 -115
- data/vendor/lexbor/test/files/lexbor/html/html5lib_tokenizer/README.md +0 -12
- data/vendor/lexbor/test/files/lexbor/html/html5lib_tokenizer/contentModelFlags.test +0 -93
- data/vendor/lexbor/test/files/lexbor/html/html5lib_tokenizer/domjs.test +0 -335
- data/vendor/lexbor/test/files/lexbor/html/html5lib_tokenizer/entities.test +0 -542
- data/vendor/lexbor/test/files/lexbor/html/html5lib_tokenizer/escapeFlag.test +0 -36
- data/vendor/lexbor/test/files/lexbor/html/html5lib_tokenizer/namedEntities.test +0 -42422
- data/vendor/lexbor/test/files/lexbor/html/html5lib_tokenizer/numericEntities.test +0 -1677
- data/vendor/lexbor/test/files/lexbor/html/html5lib_tokenizer/pendingSpecChanges.test +0 -9
- data/vendor/lexbor/test/files/lexbor/html/html5lib_tokenizer/test1.test +0 -353
- data/vendor/lexbor/test/files/lexbor/html/html5lib_tokenizer/test2.test +0 -275
- data/vendor/lexbor/test/files/lexbor/html/html5lib_tokenizer/test3.test +0 -11233
- data/vendor/lexbor/test/files/lexbor/html/html5lib_tokenizer/test4.test +0 -532
- data/vendor/lexbor/test/files/lexbor/html/html5lib_tokenizer/unicodeChars.test +0 -1577
- data/vendor/lexbor/test/files/lexbor/html/html5lib_tokenizer/unicodeCharsProblematic.test +0 -41
- data/vendor/lexbor/test/files/lexbor/html/html5lib_tokenizer/xmlViolation.test +0 -20
- data/vendor/lexbor/test/files/lexbor/html/lexbor.html +0 -150
- data/vendor/lexbor/test/files/lexbor/html/serialize_ext/attributes.ton +0 -167
- data/vendor/lexbor/test/files/lexbor/html/serialize_ext/comment.ton +0 -218
- data/vendor/lexbor/test/files/lexbor/html/serialize_ext/document_type.ton +0 -180
- data/vendor/lexbor/test/files/lexbor/html/serialize_ext/element.ton +0 -392
- data/vendor/lexbor/test/files/lexbor/html/serialize_ext/processing_instruction.ton +0 -45
- data/vendor/lexbor/test/files/lexbor/html/serialize_ext/serialize_ext.ton +0 -277
- data/vendor/lexbor/test/files/lexbor/html/serialize_ext/text.ton +0 -308
- data/vendor/lexbor/test/files/lexbor/html/tokenizer/char_ref.ton +0 -563
- data/vendor/lexbor/test/files/lexbor/html/tokenizer/comment.ton +0 -28
- data/vendor/lexbor/test/files/lexbor/html/tokenizer/doctype.ton +0 -257
- data/vendor/lexbor/test/files/lexbor/html/tokenizer/tag_attr.ton +0 -107
- data/vendor/lexbor/test/files/lexbor/html/tokenizer/tag_name.ton +0 -51
- data/vendor/lexbor/test/files/lexbor/url/changes.ton +0 -1005
- data/vendor/lexbor/test/files/lexbor/url/domain.ton +0 -93
- data/vendor/lexbor/test/files/lexbor/url/file.ton +0 -29
- data/vendor/lexbor/test/files/lexbor/url/fragment.ton +0 -47
- data/vendor/lexbor/test/files/lexbor/url/ipv4.ton +0 -221
- data/vendor/lexbor/test/files/lexbor/url/ipv6.ton +0 -197
- data/vendor/lexbor/test/files/lexbor/url/path.ton +0 -510
- data/vendor/lexbor/test/files/lexbor/url/query.ton +0 -135
- data/vendor/lexbor/test/files/lexbor/url/scheme.ton +0 -139
- data/vendor/lexbor/test/files/lexbor/url/slow_path.ton +0 -460
- data/vendor/lexbor/test/files/lexbor/url/url.ton +0 -78
- data/vendor/lexbor/test/files/lexbor/url/username_password.ton +0 -127
- data/vendor/lexbor/test/fuzzers/lexbor/css/CMakeLists.txt +0 -16
- data/vendor/lexbor/test/fuzzers/lexbor/css/css.dict +0 -307
- data/vendor/lexbor/test/fuzzers/lexbor/css/stylesheet.c +0 -55
- data/vendor/lexbor/test/fuzzers/lexbor/css/syntax/syntax.dict +0 -41
- data/vendor/lexbor/test/fuzzers/lexbor/css/syntax/tokenizer.c +0 -99
- data/vendor/lexbor/test/fuzzers/lexbor/encoding/CMakeLists.txt +0 -16
- data/vendor/lexbor/test/fuzzers/lexbor/encoding/decode.c +0 -29
- data/vendor/lexbor/test/fuzzers/lexbor/html/CMakeLists.txt +0 -16
- data/vendor/lexbor/test/fuzzers/lexbor/html/document_parse.c +0 -23
- data/vendor/lexbor/test/fuzzers/lexbor/punycode/CMakeLists.txt +0 -16
- data/vendor/lexbor/test/fuzzers/lexbor/punycode/base.c +0 -89
- data/vendor/lexbor/test/fuzzers/lexbor/selectors/CMakeLists.txt +0 -16
- data/vendor/lexbor/test/fuzzers/lexbor/selectors/find.c +0 -146
- data/vendor/lexbor/test/fuzzers/lexbor/selectors/selectors.dict +0 -71
- data/vendor/lexbor/test/fuzzers/lexbor/unicode/CMakeLists.txt +0 -16
- data/vendor/lexbor/test/fuzzers/lexbor/unicode/idna_to_ascii.c +0 -40
- data/vendor/lexbor/test/fuzzers/lexbor/unicode/normalization_forms.c +0 -41
- data/vendor/lexbor/test/fuzzers/lexbor/url/CMakeLists.txt +0 -16
- data/vendor/lexbor/test/fuzzers/lexbor/url/modify.c +0 -117
- data/vendor/lexbor/test/fuzzers/lexbor/url/parser.c +0 -132
- data/vendor/lexbor/test/fuzzers/lexbor/url/url.dict +0 -13
- data/vendor/lexbor/test/lexbor/core/CMakeLists.txt +0 -17
- data/vendor/lexbor/test/lexbor/core/array.c +0 -443
- data/vendor/lexbor/test/lexbor/core/array_obj.c +0 -306
- data/vendor/lexbor/test/lexbor/core/avl.c +0 -1588
- data/vendor/lexbor/test/lexbor/core/bst.c +0 -388
- data/vendor/lexbor/test/lexbor/core/bst_map.c +0 -209
- data/vendor/lexbor/test/lexbor/core/dobject.c +0 -322
- data/vendor/lexbor/test/lexbor/core/hash.c +0 -171
- data/vendor/lexbor/test/lexbor/core/in.c +0 -356
- data/vendor/lexbor/test/lexbor/core/mem.c +0 -332
- data/vendor/lexbor/test/lexbor/core/mraw.c +0 -612
- data/vendor/lexbor/test/lexbor/core/str.c +0 -433
- data/vendor/lexbor/test/lexbor/css/CMakeLists.txt +0 -25
- data/vendor/lexbor/test/lexbor/css/declarations.c +0 -571
- data/vendor/lexbor/test/lexbor/css/selectors/selectors.c +0 -894
- data/vendor/lexbor/test/lexbor/css/selectors/specificity.c +0 -177
- data/vendor/lexbor/test/lexbor/css/stylesheet.c +0 -196
- data/vendor/lexbor/test/lexbor/css/syntax/an_plus_b.c +0 -233
- data/vendor/lexbor/test/lexbor/css/syntax/parser.c +0 -1134
- data/vendor/lexbor/test/lexbor/css/syntax/style.c +0 -67
- data/vendor/lexbor/test/lexbor/css/syntax/tokenizer.c +0 -485
- data/vendor/lexbor/test/lexbor/css/syntax/tokenizer_queue.c +0 -92
- data/vendor/lexbor/test/lexbor/dom/CMakeLists.txt +0 -17
- data/vendor/lexbor/test/lexbor/dom/exception.c +0 -210
- data/vendor/lexbor/test/lexbor/dom/node.c +0 -441
- data/vendor/lexbor/test/lexbor/encoding/CMakeLists.txt +0 -42
- data/vendor/lexbor/test/lexbor/encoding/buffer/big5.c +0 -210
- data/vendor/lexbor/test/lexbor/encoding/buffer/encoding.h +0 -243
- data/vendor/lexbor/test/lexbor/encoding/buffer/euc_jp.c +0 -228
- data/vendor/lexbor/test/lexbor/encoding/buffer/euc_kr.c +0 -172
- data/vendor/lexbor/test/lexbor/encoding/buffer/gb18030.c +0 -297
- data/vendor/lexbor/test/lexbor/encoding/buffer/ibm866.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/iso_2022_jp.c +0 -403
- data/vendor/lexbor/test/lexbor/encoding/buffer/iso_8859_10.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/iso_8859_13.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/iso_8859_14.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/iso_8859_15.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/iso_8859_16.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/iso_8859_2.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/iso_8859_3.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/iso_8859_4.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/iso_8859_5.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/iso_8859_6.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/iso_8859_7.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/iso_8859_8.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/koi8_r.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/koi8_u.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/macintosh.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/shift_jis.c +0 -230
- data/vendor/lexbor/test/lexbor/encoding/buffer/utf-16.c +0 -230
- data/vendor/lexbor/test/lexbor/encoding/buffer/utf-8.c +0 -282
- data/vendor/lexbor/test/lexbor/encoding/buffer/windows_1250.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/windows_1251.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/windows_1252.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/windows_1253.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/windows_1254.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/windows_1255.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/windows_1256.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/windows_1257.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/windows_1258.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/windows_874.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/buffer/x_mac_cyrillic.c +0 -123
- data/vendor/lexbor/test/lexbor/encoding/encoding.c +0 -97
- data/vendor/lexbor/test/lexbor/encoding/parser.h +0 -225
- data/vendor/lexbor/test/lexbor/encoding/single/big5.c +0 -203
- data/vendor/lexbor/test/lexbor/encoding/single/encoding.h +0 -227
- data/vendor/lexbor/test/lexbor/encoding/single/euc_jp.c +0 -220
- data/vendor/lexbor/test/lexbor/encoding/single/euc_kr.c +0 -162
- data/vendor/lexbor/test/lexbor/encoding/single/gb18030.c +0 -277
- data/vendor/lexbor/test/lexbor/encoding/single/ibm866.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/iso_2022_jp.c +0 -342
- data/vendor/lexbor/test/lexbor/encoding/single/iso_8859_10.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/iso_8859_13.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/iso_8859_14.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/iso_8859_15.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/iso_8859_16.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/iso_8859_2.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/iso_8859_3.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/iso_8859_4.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/iso_8859_5.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/iso_8859_6.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/iso_8859_7.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/iso_8859_8.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/koi8_r.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/koi8_u.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/macintosh.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/shift_jis.c +0 -203
- data/vendor/lexbor/test/lexbor/encoding/single/utf-16.c +0 -216
- data/vendor/lexbor/test/lexbor/encoding/single/utf-8.c +0 -227
- data/vendor/lexbor/test/lexbor/encoding/single/windows_1250.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/windows_1251.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/windows_1252.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/windows_1253.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/windows_1254.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/windows_1255.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/windows_1256.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/windows_1257.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/windows_1258.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/windows_874.c +0 -114
- data/vendor/lexbor/test/lexbor/encoding/single/x_mac_cyrillic.c +0 -114
- data/vendor/lexbor/test/lexbor/html/CMakeLists.txt +0 -35
- data/vendor/lexbor/test/lexbor/html/attributes.c +0 -105
- data/vendor/lexbor/test/lexbor/html/build-cpp.cpp +0 -68
- data/vendor/lexbor/test/lexbor/html/clone.c +0 -356
- data/vendor/lexbor/test/lexbor/html/dom/document_type.c +0 -125
- data/vendor/lexbor/test/lexbor/html/element_by.c +0 -147
- data/vendor/lexbor/test/lexbor/html/encoding.c +0 -228
- data/vendor/lexbor/test/lexbor/html/encoding_html5lib_tests.c +0 -308
- data/vendor/lexbor/test/lexbor/html/encoding_prescan.c +0 -1686
- data/vendor/lexbor/test/lexbor/html/inner.c +0 -103
- data/vendor/lexbor/test/lexbor/html/other.c +0 -139
- data/vendor/lexbor/test/lexbor/html/parse.c +0 -380
- data/vendor/lexbor/test/lexbor/html/perf.c +0 -161
- data/vendor/lexbor/test/lexbor/html/serialize.c +0 -56
- data/vendor/lexbor/test/lexbor/html/serialize_ext.c +0 -461
- data/vendor/lexbor/test/lexbor/html/tags.c +0 -140
- data/vendor/lexbor/test/lexbor/html/tokenizer/errors.c +0 -34
- data/vendor/lexbor/test/lexbor/html/tokenizer/html5lib_tests.c +0 -1168
- data/vendor/lexbor/test/lexbor/html/tokenizer_helper.h +0 -403
- data/vendor/lexbor/test/lexbor/html/tokenizer_tokens.c +0 -754
- data/vendor/lexbor/test/lexbor/html/tree/errors.c +0 -34
- data/vendor/lexbor/test/lexbor/html/tree/open_elements.c +0 -99
- data/vendor/lexbor/test/lexbor/html/tree_builder.c +0 -536
- data/vendor/lexbor/test/lexbor/ns/CMakeLists.txt +0 -17
- data/vendor/lexbor/test/lexbor/ns/res.c +0 -55
- data/vendor/lexbor/test/lexbor/punycode/CMakeLists.txt +0 -17
- data/vendor/lexbor/test/lexbor/punycode/base.c +0 -240
- data/vendor/lexbor/test/lexbor/selectors/CMakeLists.txt +0 -17
- data/vendor/lexbor/test/lexbor/selectors/selectors.c +0 -911
- data/vendor/lexbor/test/lexbor/style/CMakeLists.txt +0 -17
- data/vendor/lexbor/test/lexbor/style/element_events.c +0 -291
- data/vendor/lexbor/test/lexbor/style/element_style_steps.c +0 -5035
- data/vendor/lexbor/test/lexbor/style/not_html_namespace.c +0 -87
- data/vendor/lexbor/test/lexbor/style/style_tag.c +0 -184
- data/vendor/lexbor/test/lexbor/style/stylesheet.c +0 -51
- data/vendor/lexbor/test/lexbor/style/wo_events.c +0 -351
- data/vendor/lexbor/test/lexbor/tag/CMakeLists.txt +0 -17
- data/vendor/lexbor/test/lexbor/tag/res.c +0 -440
- data/vendor/lexbor/test/lexbor/unicode/CMakeLists.txt +0 -17
- data/vendor/lexbor/test/lexbor/unicode/composition_test.c +0 -1095
- data/vendor/lexbor/test/lexbor/unicode/edges_normalization_forms.c +0 -220
- data/vendor/lexbor/test/lexbor/unicode/idna.c +0 -98
- data/vendor/lexbor/test/lexbor/unicode/idna_codepoints.c +0 -110
- data/vendor/lexbor/test/lexbor/unicode/idna_type.c +0 -31
- data/vendor/lexbor/test/lexbor/unicode/normalization_forms.c +0 -205
- data/vendor/lexbor/test/lexbor/unicode/normalization_forms_code_points.c +0 -214
- data/vendor/lexbor/test/lexbor/unicode/unicode_idna_test_res.h +0 -6423
- data/vendor/lexbor/test/lexbor/unicode/unicode_normalization_test_res.h +0 -120229
- data/vendor/lexbor/test/lexbor/url/CMakeLists.txt +0 -22
- data/vendor/lexbor/test/lexbor/url/errors.c +0 -41
- data/vendor/lexbor/test/lexbor/url/other.c +0 -134
- data/vendor/lexbor/test/lexbor/url/parser.c +0 -872
- data/vendor/lexbor/test/lexbor/url/search_params.c +0 -616
- data/vendor/lexbor/test/lexbor/url/validation.c +0 -185
- data/vendor/lexbor/test/unit/CMakeLists.txt +0 -49
- data/vendor/lexbor/test/unit/kv.c +0 -538
- data/vendor/lexbor/test/unit/kv.h +0 -301
- data/vendor/lexbor/test/unit/kv_rules.c +0 -609
- data/vendor/lexbor/test/unit/kv_state.c +0 -1470
- data/vendor/lexbor/test/unit/test.c +0 -131
- data/vendor/lexbor/test/unit/test.h +0 -410
- data/vendor/lexbor/utils/CMakeLists.txt +0 -11
- data/vendor/lexbor/utils/lexbor/css/grammar.txt +0 -263
- data/vendor/lexbor/utils/lexbor/css/names.py +0 -768
- data/vendor/lexbor/utils/lexbor/css/selectors/pseudo.py +0 -234
- data/vendor/lexbor/utils/lexbor/css/selectors/tmp/const.h +0 -21
- data/vendor/lexbor/utils/lexbor/css/selectors/tmp/res.h +0 -26
- data/vendor/lexbor/utils/lexbor/css/syntax/definitions.py +0 -62
- data/vendor/lexbor/utils/lexbor/css/syntax/non_ascii.pl +0 -77
- data/vendor/lexbor/utils/lexbor/css/syntax/token_res.py +0 -55
- data/vendor/lexbor/utils/lexbor/css/syntax/tokenizer_code_map.py +0 -36
- data/vendor/lexbor/utils/lexbor/css/tmp/const.h +0 -24
- data/vendor/lexbor/utils/lexbor/css/tmp/res.h +0 -26
- data/vendor/lexbor/utils/lexbor/css/tmp/types.h +0 -21
- data/vendor/lexbor/utils/lexbor/css/tmp/value_const.h +0 -21
- data/vendor/lexbor/utils/lexbor/css/tmp/value_res.h +0 -25
- data/vendor/lexbor/utils/lexbor/dom/attr.py +0 -129
- data/vendor/lexbor/utils/lexbor/dom/tmp/const.h +0 -23
- data/vendor/lexbor/utils/lexbor/dom/tmp/res.h +0 -27
- data/vendor/lexbor/utils/lexbor/encoding/CMakeLists.txt +0 -32
- data/vendor/lexbor/utils/lexbor/encoding/big5_map_decode.c +0 -93
- data/vendor/lexbor/utils/lexbor/encoding/buffer-single-byte.py +0 -95
- data/vendor/lexbor/utils/lexbor/encoding/encodings.json +0 -456
- data/vendor/lexbor/utils/lexbor/encoding/euc_jp_map_decode.c +0 -83
- data/vendor/lexbor/utils/lexbor/encoding/euc_kr_map_decode.c +0 -89
- data/vendor/lexbor/utils/lexbor/encoding/gb18030_map_decode.c +0 -170
- data/vendor/lexbor/utils/lexbor/encoding/iso_2022_jp_map_decode.c +0 -120
- data/vendor/lexbor/utils/lexbor/encoding/multi-byte/index-big5.txt +0 -18596
- data/vendor/lexbor/utils/lexbor/encoding/multi-byte/index-euc-kr.txt +0 -17054
- data/vendor/lexbor/utils/lexbor/encoding/multi-byte/index-gb18030.txt +0 -23946
- data/vendor/lexbor/utils/lexbor/encoding/multi-byte/index-iso-2022-jp-katakana.txt +0 -69
- data/vendor/lexbor/utils/lexbor/encoding/multi-byte/index-jis0208.txt +0 -7730
- data/vendor/lexbor/utils/lexbor/encoding/multi-byte/index-jis0212.txt +0 -6073
- data/vendor/lexbor/utils/lexbor/encoding/multi-byte.pl +0 -424
- data/vendor/lexbor/utils/lexbor/encoding/range-byte.py +0 -118
- data/vendor/lexbor/utils/lexbor/encoding/ranges/index-gb18030-ranges.txt +0 -213
- data/vendor/lexbor/utils/lexbor/encoding/res.py +0 -231
- data/vendor/lexbor/utils/lexbor/encoding/shift_jis_map_decode.c +0 -102
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-ibm866.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-iso-8859-10.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-iso-8859-13.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-iso-8859-14.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-iso-8859-15.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-iso-8859-16.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-iso-8859-2.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-iso-8859-3.txt +0 -127
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-iso-8859-4.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-iso-8859-5.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-iso-8859-6.txt +0 -89
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-iso-8859-7.txt +0 -131
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-iso-8859-8.txt +0 -98
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-koi8-r.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-koi8-u.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-macintosh.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-windows-1250.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-windows-1251.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-windows-1252.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-windows-1253.txt +0 -131
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-windows-1254.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-windows-1255.txt +0 -124
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-windows-1256.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-windows-1257.txt +0 -132
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-windows-1258.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-windows-874.txt +0 -126
- data/vendor/lexbor/utils/lexbor/encoding/single-byte/index-x-mac-cyrillic.txt +0 -134
- data/vendor/lexbor/utils/lexbor/encoding/single-byte.py +0 -179
- data/vendor/lexbor/utils/lexbor/encoding/tmp/buffer_single_byte_test.c +0 -123
- data/vendor/lexbor/utils/lexbor/encoding/tmp/const.h +0 -19
- data/vendor/lexbor/utils/lexbor/encoding/tmp/multi.c +0 -20
- data/vendor/lexbor/utils/lexbor/encoding/tmp/multi.h +0 -37
- data/vendor/lexbor/utils/lexbor/encoding/tmp/range.c +0 -17
- data/vendor/lexbor/utils/lexbor/encoding/tmp/range.h +0 -35
- data/vendor/lexbor/utils/lexbor/encoding/tmp/res.c +0 -22
- data/vendor/lexbor/utils/lexbor/encoding/tmp/res.h +0 -34
- data/vendor/lexbor/utils/lexbor/encoding/tmp/single.c +0 -20
- data/vendor/lexbor/utils/lexbor/encoding/tmp/single.h +0 -37
- data/vendor/lexbor/utils/lexbor/encoding/tmp/single_byte_test.c +0 -114
- data/vendor/lexbor/utils/lexbor/grammar/CMakeLists.txt +0 -63
- data/vendor/lexbor/utils/lexbor/grammar/base.h +0 -89
- data/vendor/lexbor/utils/lexbor/grammar/document.h +0 -34
- data/vendor/lexbor/utils/lexbor/grammar/grammar.c +0 -243
- data/vendor/lexbor/utils/lexbor/grammar/json.c +0 -368
- data/vendor/lexbor/utils/lexbor/grammar/json.h +0 -48
- data/vendor/lexbor/utils/lexbor/grammar/node.c +0 -653
- data/vendor/lexbor/utils/lexbor/grammar/node.h +0 -120
- data/vendor/lexbor/utils/lexbor/grammar/parser.c +0 -724
- data/vendor/lexbor/utils/lexbor/grammar/parser.h +0 -75
- data/vendor/lexbor/utils/lexbor/grammar/test.c +0 -1762
- data/vendor/lexbor/utils/lexbor/grammar/test.h +0 -35
- data/vendor/lexbor/utils/lexbor/grammar/token.c +0 -258
- data/vendor/lexbor/utils/lexbor/grammar/token.h +0 -91
- data/vendor/lexbor/utils/lexbor/grammar/tokenizer.c +0 -706
- data/vendor/lexbor/utils/lexbor/grammar/tokenizer.h +0 -73
- data/vendor/lexbor/utils/lexbor/html/convert_html5_tests.py +0 -162
- data/vendor/lexbor/utils/lexbor/html/data/entities.json +0 -2233
- data/vendor/lexbor/utils/lexbor/html/insertion_mode.py +0 -61
- data/vendor/lexbor/utils/lexbor/html/reorder_html5_tests_tokenizer_errors.py +0 -137
- data/vendor/lexbor/utils/lexbor/html/tmp/insertion_mode.c +0 -53
- data/vendor/lexbor/utils/lexbor/html/tmp/insertion_mode.h +0 -18
- data/vendor/lexbor/utils/lexbor/html/tmp/tokenizer_res.h +0 -20
- data/vendor/lexbor/utils/lexbor/html/tokenizer_entities_bst.py +0 -209
- data/vendor/lexbor/utils/lexbor/html/tokenizer_entities_switch.py +0 -162
- data/vendor/lexbor/utils/lexbor/html/tokenizer_parse_error.pl +0 -97
- data/vendor/lexbor/utils/lexbor/lexbor/LXB.py +0 -498
- data/vendor/lexbor/utils/lexbor/lexbor/res.py +0 -130
- data/vendor/lexbor/utils/lexbor/tag_ns/data/interfaces.json +0 -98
- data/vendor/lexbor/utils/lexbor/tag_ns/data/tags.json +0 -371
- data/vendor/lexbor/utils/lexbor/tag_ns/interfaces.py +0 -175
- data/vendor/lexbor/utils/lexbor/tag_ns/tags.py +0 -808
- data/vendor/lexbor/utils/lexbor/tag_ns/tmp/html_attribute_steps_res.h +0 -21
- data/vendor/lexbor/utils/lexbor/tag_ns/tmp/html_element_steps_res.h +0 -21
- data/vendor/lexbor/utils/lexbor/tag_ns/tmp/html_interface_res.h +0 -29
- data/vendor/lexbor/utils/lexbor/tag_ns/tmp/html_open_elements_res.h +0 -21
- data/vendor/lexbor/utils/lexbor/tag_ns/tmp/html_tag_res.h +0 -25
- data/vendor/lexbor/utils/lexbor/tag_ns/tmp/interface.c +0 -36
- data/vendor/lexbor/utils/lexbor/tag_ns/tmp/interface.h +0 -33
- data/vendor/lexbor/utils/lexbor/tag_ns/tmp/ns_const.h +0 -26
- data/vendor/lexbor/utils/lexbor/tag_ns/tmp/ns_res.h +0 -29
- data/vendor/lexbor/utils/lexbor/tag_ns/tmp/open_elements_res.h +0 -21
- data/vendor/lexbor/utils/lexbor/tag_ns/tmp/steps_res.h +0 -23
- data/vendor/lexbor/utils/lexbor/tag_ns/tmp/tag_const.h +0 -26
- data/vendor/lexbor/utils/lexbor/tag_ns/tmp/tag_res.h +0 -26
- data/vendor/lexbor/utils/lexbor/tag_ns/tmp/test/ns_res.c +0 -44
- data/vendor/lexbor/utils/lexbor/tag_ns/tmp/test/tag_res.c +0 -45
- data/vendor/lexbor/utils/lexbor/unicode/build.pl +0 -1323
- data/vendor/lexbor/utils/lexbor/unicode/idna_test.pl +0 -398
- data/vendor/lexbor/utils/lexbor/unicode/normalization_test.pl +0 -157
- data/vendor/lexbor/utils/wasm/gen_constants.py +0 -186
- data/vendor/lexbor/wasm/CMakeLists.txt +0 -18
- data/vendor/lexbor/wasm/lexbor/engine/CMakeLists.txt +0 -21
- data/vendor/lexbor/wasm/lexbor/engine/index.html +0 -406
- data/vendor/lexbor/wasm/lexbor/engine/lexbor.c +0 -1340
- data/vendor/lexbor/wasm/lexbor/html/CMakeLists.txt +0 -11
- data/vendor/lexbor/wasm/lexbor/html/parse.c +0 -58
|
@@ -1,609 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2018 Alexander Borisov
|
|
3
|
-
*
|
|
4
|
-
* Author: Alexander Borisov <borisov@lexbor.com>
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
#include "unit/kv.h"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
unit_kv_token_t *
|
|
11
|
-
unit_kv_rules_begin(unit_kv_t *kv, unit_kv_token_t *token, void *ctx);
|
|
12
|
-
|
|
13
|
-
static unit_kv_value_t *
|
|
14
|
-
unit_kv_rules_value_append(unit_kv_t *kv);
|
|
15
|
-
|
|
16
|
-
static unit_kv_value_t *
|
|
17
|
-
unit_kv_rules_value_append_hash(unit_kv_t *kv, unit_kv_token_t *token);
|
|
18
|
-
|
|
19
|
-
static unit_kv_value_t *
|
|
20
|
-
unit_kv_rules_value_append_array(unit_kv_t *kv, unit_kv_token_t *token);
|
|
21
|
-
|
|
22
|
-
lxb_status_t
|
|
23
|
-
unit_kv_rules_check_parent(unit_kv_t *kv);
|
|
24
|
-
|
|
25
|
-
static unit_kv_token_t *
|
|
26
|
-
unit_kv_rules_hash_begin(unit_kv_t *kv, unit_kv_token_t *token, void *ctx);
|
|
27
|
-
|
|
28
|
-
static unit_kv_token_t *
|
|
29
|
-
unit_kv_rules_hash_name(unit_kv_t *kv, unit_kv_token_t *token, void *ctx);
|
|
30
|
-
|
|
31
|
-
static unit_kv_token_t *
|
|
32
|
-
unit_kv_rules_hash_value(unit_kv_t *kv, unit_kv_token_t *token, void *ctx);
|
|
33
|
-
|
|
34
|
-
static unit_kv_token_t *
|
|
35
|
-
unit_kv_rules_hash_after_value(unit_kv_t *kv, unit_kv_token_t *token, void *ctx);
|
|
36
|
-
|
|
37
|
-
static unit_kv_token_t *
|
|
38
|
-
unit_kv_rules_array_begin(unit_kv_t *kv, unit_kv_token_t *token, void *ctx);
|
|
39
|
-
|
|
40
|
-
static unit_kv_token_t *
|
|
41
|
-
unit_kv_rules_array_after_value(unit_kv_t *kv, unit_kv_token_t *token, void *ctx);
|
|
42
|
-
|
|
43
|
-
static unit_kv_token_t *
|
|
44
|
-
unit_kv_rules_emit_all(unit_kv_t *kv, unit_kv_token_t *token, void *ctx);
|
|
45
|
-
|
|
46
|
-
static lxb_status_t
|
|
47
|
-
unit_kv_rules_check_chars(unit_kv_token_t *token, unit_kv_value_t *value);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
static unit_kv_value_t *
|
|
51
|
-
unit_kv_rules_value_append(unit_kv_t *kv)
|
|
52
|
-
{
|
|
53
|
-
unit_kv_value_t *value = lexbor_dobject_calloc(kv->objs);
|
|
54
|
-
if (value == NULL) {
|
|
55
|
-
return NULL;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
value->kv = kv;
|
|
59
|
-
|
|
60
|
-
if (kv->value == NULL) {
|
|
61
|
-
kv->value = value;
|
|
62
|
-
return value;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
value->parent = kv->value;
|
|
66
|
-
kv->value = value;
|
|
67
|
-
|
|
68
|
-
return value;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
static unit_kv_value_t *
|
|
72
|
-
unit_kv_rules_value_append_hash(unit_kv_t *kv, unit_kv_token_t *token)
|
|
73
|
-
{
|
|
74
|
-
unit_kv_value_t *value = unit_kv_rules_value_append(kv);
|
|
75
|
-
|
|
76
|
-
value->type = UNIT_KV_VALUE_TYPE_HASH;
|
|
77
|
-
value->pos = token->pos;
|
|
78
|
-
|
|
79
|
-
return value;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
static unit_kv_value_t *
|
|
83
|
-
unit_kv_rules_value_append_array(unit_kv_t *kv, unit_kv_token_t *token)
|
|
84
|
-
{
|
|
85
|
-
unit_kv_value_t *value = unit_kv_rules_value_append(kv);
|
|
86
|
-
|
|
87
|
-
value->type = UNIT_KV_VALUE_TYPE_ARRAY;
|
|
88
|
-
value->pos = token->pos;
|
|
89
|
-
|
|
90
|
-
return value;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
lxb_status_t
|
|
94
|
-
unit_kv_rules_check_parent(unit_kv_t *kv)
|
|
95
|
-
{
|
|
96
|
-
if (kv->value->parent == NULL) {
|
|
97
|
-
kv->rules = unit_kv_rules_emit_all;
|
|
98
|
-
return LXB_STATUS_OK;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
kv->value = kv->value->parent;
|
|
102
|
-
|
|
103
|
-
if (kv->value->type == UNIT_KV_VALUE_TYPE_HASH) {
|
|
104
|
-
kv->rules = unit_kv_rules_hash_after_value;
|
|
105
|
-
}
|
|
106
|
-
else if (kv->value->type == UNIT_KV_VALUE_TYPE_ARRAY) {
|
|
107
|
-
kv->rules = unit_kv_rules_array_after_value;
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
return LXB_STATUS_ERROR;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return LXB_STATUS_OK;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
unit_kv_token_t *
|
|
117
|
-
unit_kv_rules_begin(unit_kv_t *kv, unit_kv_token_t *token, void *ctx)
|
|
118
|
-
{
|
|
119
|
-
switch (token->type) {
|
|
120
|
-
case UNIT_KV_TOKEN_TYPE_LEFT_CURLY_BRACKET:
|
|
121
|
-
if (unit_kv_rules_value_append_hash(kv, token) == NULL) {
|
|
122
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
123
|
-
return NULL;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
kv->rules = unit_kv_rules_hash_begin;
|
|
127
|
-
|
|
128
|
-
break;
|
|
129
|
-
|
|
130
|
-
case UNIT_KV_TOKEN_TYPE_LEFT_SQUARE_BRACKET:
|
|
131
|
-
if (unit_kv_rules_value_append_array(kv, token) == NULL) {
|
|
132
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
133
|
-
return NULL;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
kv->rules = unit_kv_rules_array_begin;
|
|
137
|
-
|
|
138
|
-
break;
|
|
139
|
-
|
|
140
|
-
case UNIT_KV_TOKEN_TYPE_EOF:
|
|
141
|
-
break;
|
|
142
|
-
|
|
143
|
-
default:
|
|
144
|
-
kv->status = LXB_STATUS_ERROR_UNEXPECTED_RESULT;
|
|
145
|
-
kv->bad_token = token;
|
|
146
|
-
|
|
147
|
-
return NULL;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return token;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/*
|
|
154
|
-
* Hash
|
|
155
|
-
*/
|
|
156
|
-
static unit_kv_token_t *
|
|
157
|
-
unit_kv_rules_hash_begin(unit_kv_t *kv, unit_kv_token_t *token, void *ctx)
|
|
158
|
-
{
|
|
159
|
-
switch (token->type) {
|
|
160
|
-
case UNIT_KV_TOKEN_TYPE_RIGHT_CURLY_BRACKET:
|
|
161
|
-
if (unit_kv_rules_check_parent(kv) != LXB_STATUS_OK) {
|
|
162
|
-
kv->status = LXB_STATUS_ERROR_UNEXPECTED_RESULT;
|
|
163
|
-
kv->bad_token = token;
|
|
164
|
-
|
|
165
|
-
return NULL;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
break;
|
|
169
|
-
|
|
170
|
-
case UNIT_KV_TOKEN_TYPE_STRING:
|
|
171
|
-
kv->key_name = token->value.str;
|
|
172
|
-
kv->rules = unit_kv_rules_hash_name;
|
|
173
|
-
|
|
174
|
-
break;
|
|
175
|
-
|
|
176
|
-
case UNIT_KV_TOKEN_TYPE_EOF:
|
|
177
|
-
/* fall through */
|
|
178
|
-
|
|
179
|
-
default:
|
|
180
|
-
kv->status = LXB_STATUS_ERROR_UNEXPECTED_RESULT;
|
|
181
|
-
kv->bad_token = token;
|
|
182
|
-
|
|
183
|
-
return NULL;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
return token;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
static unit_kv_token_t *
|
|
190
|
-
unit_kv_rules_hash_name(unit_kv_t *kv, unit_kv_token_t *token, void *ctx)
|
|
191
|
-
{
|
|
192
|
-
switch (token->type) {
|
|
193
|
-
case UNIT_KV_TOKEN_TYPE_COLON:
|
|
194
|
-
kv->rules = unit_kv_rules_hash_value;
|
|
195
|
-
|
|
196
|
-
break;
|
|
197
|
-
|
|
198
|
-
case UNIT_KV_TOKEN_TYPE_EOF:
|
|
199
|
-
/* fall through */
|
|
200
|
-
|
|
201
|
-
default:
|
|
202
|
-
kv->status = LXB_STATUS_ERROR_UNEXPECTED_RESULT;
|
|
203
|
-
kv->bad_token = token;
|
|
204
|
-
|
|
205
|
-
return NULL;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
return token;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
static unit_kv_token_t *
|
|
212
|
-
unit_kv_rules_hash_value(unit_kv_t *kv, unit_kv_token_t *token, void *ctx)
|
|
213
|
-
{
|
|
214
|
-
unit_kv_value_t *value;
|
|
215
|
-
lexbor_bst_map_entry_t *hash_entry;
|
|
216
|
-
|
|
217
|
-
switch (token->type) {
|
|
218
|
-
case UNIT_KV_TOKEN_TYPE_LEFT_CURLY_BRACKET:
|
|
219
|
-
hash_entry = lexbor_bst_map_insert_not_exists(kv->map,
|
|
220
|
-
&kv->value->value.hash_root,
|
|
221
|
-
kv->key_name.data,
|
|
222
|
-
kv->key_name.length);
|
|
223
|
-
if (hash_entry == NULL) {
|
|
224
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
225
|
-
return NULL;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
hash_entry->value = unit_kv_rules_value_append_hash(kv, token);
|
|
229
|
-
if (hash_entry->value == NULL) {
|
|
230
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
231
|
-
return NULL;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
kv->rules = unit_kv_rules_hash_begin;
|
|
235
|
-
|
|
236
|
-
break;
|
|
237
|
-
|
|
238
|
-
case UNIT_KV_TOKEN_TYPE_LEFT_SQUARE_BRACKET:
|
|
239
|
-
hash_entry = lexbor_bst_map_insert_not_exists(kv->map,
|
|
240
|
-
&kv->value->value.hash_root,
|
|
241
|
-
kv->key_name.data,
|
|
242
|
-
kv->key_name.length);
|
|
243
|
-
if (hash_entry == NULL) {
|
|
244
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
245
|
-
return NULL;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
hash_entry->value = unit_kv_rules_value_append_array(kv, token);
|
|
249
|
-
if (hash_entry->value == NULL) {
|
|
250
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
251
|
-
return NULL;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
kv->rules = unit_kv_rules_array_begin;
|
|
255
|
-
|
|
256
|
-
break;
|
|
257
|
-
|
|
258
|
-
case UNIT_KV_TOKEN_TYPE_STRING:
|
|
259
|
-
case UNIT_KV_TOKEN_TYPE_DATA:
|
|
260
|
-
hash_entry = lexbor_bst_map_insert_not_exists(kv->map,
|
|
261
|
-
&kv->value->value.hash_root,
|
|
262
|
-
kv->key_name.data,
|
|
263
|
-
kv->key_name.length);
|
|
264
|
-
if (hash_entry == NULL) {
|
|
265
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
266
|
-
return NULL;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
value = lexbor_dobject_calloc(kv->objs);
|
|
270
|
-
if (value == NULL) {
|
|
271
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
272
|
-
return NULL;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
value->type = UNIT_KV_VALUE_TYPE_STRING;
|
|
276
|
-
value->kv = kv;
|
|
277
|
-
value->pos = token->pos;
|
|
278
|
-
value->value.str = token->value.str;
|
|
279
|
-
|
|
280
|
-
hash_entry->value = value;
|
|
281
|
-
|
|
282
|
-
kv->rules = unit_kv_rules_hash_after_value;
|
|
283
|
-
|
|
284
|
-
break;
|
|
285
|
-
|
|
286
|
-
case UNIT_KV_TOKEN_TYPE_NUMBER:
|
|
287
|
-
hash_entry = lexbor_bst_map_insert_not_exists(kv->map,
|
|
288
|
-
&kv->value->value.hash_root,
|
|
289
|
-
kv->key_name.data,
|
|
290
|
-
kv->key_name.length);
|
|
291
|
-
if (hash_entry == NULL) {
|
|
292
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
293
|
-
return NULL;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
value = lexbor_dobject_calloc(kv->objs);
|
|
297
|
-
if (value == NULL) {
|
|
298
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
299
|
-
return NULL;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
value->type = UNIT_KV_VALUE_TYPE_NUMBER;
|
|
303
|
-
value->kv = kv;
|
|
304
|
-
value->pos = token->pos;
|
|
305
|
-
value->value.num = token->value.num;
|
|
306
|
-
|
|
307
|
-
hash_entry->value = value;
|
|
308
|
-
|
|
309
|
-
kv->rules = unit_kv_rules_hash_after_value;
|
|
310
|
-
|
|
311
|
-
break;
|
|
312
|
-
|
|
313
|
-
case UNIT_KV_TOKEN_TYPE_CHARS:
|
|
314
|
-
value = lexbor_dobject_calloc(kv->objs);
|
|
315
|
-
if (value == NULL) {
|
|
316
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
317
|
-
return NULL;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
if (unit_kv_rules_check_chars(token, value) == LXB_STATUS_ERROR) {
|
|
321
|
-
value->type = UNIT_KV_VALUE_TYPE_CHARS;
|
|
322
|
-
value->value.str = token->value.str;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
hash_entry = lexbor_bst_map_insert_not_exists(kv->map,
|
|
326
|
-
&kv->value->value.hash_root,
|
|
327
|
-
kv->key_name.data,
|
|
328
|
-
kv->key_name.length);
|
|
329
|
-
if (hash_entry == NULL) {
|
|
330
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
331
|
-
return NULL;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
value->kv = kv;
|
|
335
|
-
value->pos = token->pos;
|
|
336
|
-
|
|
337
|
-
hash_entry->value = value;
|
|
338
|
-
|
|
339
|
-
kv->rules = unit_kv_rules_hash_after_value;
|
|
340
|
-
|
|
341
|
-
break;
|
|
342
|
-
|
|
343
|
-
case UNIT_KV_TOKEN_TYPE_EOF:
|
|
344
|
-
/* fall through */
|
|
345
|
-
|
|
346
|
-
default:
|
|
347
|
-
kv->status = LXB_STATUS_ERROR_UNEXPECTED_RESULT;
|
|
348
|
-
kv->bad_token = token;
|
|
349
|
-
|
|
350
|
-
return NULL;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
return token;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
static unit_kv_token_t *
|
|
357
|
-
unit_kv_rules_hash_after_value(unit_kv_t *kv, unit_kv_token_t *token, void *ctx)
|
|
358
|
-
{
|
|
359
|
-
switch (token->type) {
|
|
360
|
-
case UNIT_KV_TOKEN_TYPE_RIGHT_CURLY_BRACKET:
|
|
361
|
-
if (unit_kv_rules_check_parent(kv) != LXB_STATUS_OK) {
|
|
362
|
-
kv->status = LXB_STATUS_ERROR_UNEXPECTED_RESULT;
|
|
363
|
-
kv->bad_token = token;
|
|
364
|
-
|
|
365
|
-
return NULL;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
break;
|
|
369
|
-
|
|
370
|
-
case UNIT_KV_TOKEN_TYPE_COMMA:
|
|
371
|
-
kv->rules = unit_kv_rules_hash_begin;
|
|
372
|
-
|
|
373
|
-
break;
|
|
374
|
-
|
|
375
|
-
case UNIT_KV_TOKEN_TYPE_EOF:
|
|
376
|
-
/* fall through */
|
|
377
|
-
|
|
378
|
-
default:
|
|
379
|
-
kv->status = LXB_STATUS_ERROR_UNEXPECTED_RESULT;
|
|
380
|
-
kv->bad_token = token;
|
|
381
|
-
|
|
382
|
-
return NULL;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
return token;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
/*
|
|
389
|
-
* Array
|
|
390
|
-
*/
|
|
391
|
-
static unit_kv_token_t *
|
|
392
|
-
unit_kv_rules_array_begin(unit_kv_t *kv, unit_kv_token_t *token, void *ctx)
|
|
393
|
-
{
|
|
394
|
-
unit_kv_value_t *value, *array;
|
|
395
|
-
|
|
396
|
-
switch (token->type) {
|
|
397
|
-
case UNIT_KV_TOKEN_TYPE_LEFT_CURLY_BRACKET:
|
|
398
|
-
array = kv->value;
|
|
399
|
-
|
|
400
|
-
value = unit_kv_rules_value_append_hash(kv, token);
|
|
401
|
-
if (value == NULL) {
|
|
402
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
403
|
-
return NULL;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
value = unit_kv_array_append(array, value);
|
|
407
|
-
if (value == NULL) {
|
|
408
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
409
|
-
return NULL;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
kv->rules = unit_kv_rules_hash_begin;
|
|
413
|
-
|
|
414
|
-
break;
|
|
415
|
-
|
|
416
|
-
case UNIT_KV_TOKEN_TYPE_LEFT_SQUARE_BRACKET:
|
|
417
|
-
array = kv->value;
|
|
418
|
-
|
|
419
|
-
value = unit_kv_rules_value_append_array(kv, token);
|
|
420
|
-
if (value == NULL) {
|
|
421
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
422
|
-
return NULL;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
value = unit_kv_array_append(array, value);
|
|
426
|
-
if (value == NULL) {
|
|
427
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
428
|
-
return NULL;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
break;
|
|
432
|
-
|
|
433
|
-
case UNIT_KV_TOKEN_TYPE_RIGHT_SQUARE_BRACKET:
|
|
434
|
-
if (unit_kv_rules_check_parent(kv) != LXB_STATUS_OK) {
|
|
435
|
-
kv->status = LXB_STATUS_ERROR_UNEXPECTED_RESULT;
|
|
436
|
-
kv->bad_token = token;
|
|
437
|
-
|
|
438
|
-
return NULL;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
break;
|
|
442
|
-
|
|
443
|
-
case UNIT_KV_TOKEN_TYPE_STRING:
|
|
444
|
-
case UNIT_KV_TOKEN_TYPE_DATA:
|
|
445
|
-
array = kv->value;
|
|
446
|
-
|
|
447
|
-
value = lexbor_dobject_calloc(kv->objs);
|
|
448
|
-
if (value == NULL) {
|
|
449
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
450
|
-
return NULL;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
value->type = UNIT_KV_VALUE_TYPE_STRING;
|
|
454
|
-
value->kv = kv;
|
|
455
|
-
value->pos = token->pos;
|
|
456
|
-
value->value.str = token->value.str;
|
|
457
|
-
|
|
458
|
-
value = unit_kv_array_append(array, value);
|
|
459
|
-
if (value == NULL) {
|
|
460
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
461
|
-
return NULL;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
kv->rules = unit_kv_rules_array_after_value;
|
|
465
|
-
|
|
466
|
-
break;
|
|
467
|
-
|
|
468
|
-
case UNIT_KV_TOKEN_TYPE_NUMBER:
|
|
469
|
-
array = kv->value;
|
|
470
|
-
|
|
471
|
-
value = lexbor_dobject_calloc(kv->objs);
|
|
472
|
-
if (value == NULL) {
|
|
473
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
474
|
-
return NULL;
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
value->type = UNIT_KV_VALUE_TYPE_NUMBER;
|
|
478
|
-
value->kv = kv;
|
|
479
|
-
value->pos = token->pos;
|
|
480
|
-
value->value.num = token->value.num;
|
|
481
|
-
|
|
482
|
-
value = unit_kv_array_append(array, value);
|
|
483
|
-
if (value == NULL) {
|
|
484
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
485
|
-
return NULL;
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
kv->rules = unit_kv_rules_array_after_value;
|
|
489
|
-
|
|
490
|
-
break;
|
|
491
|
-
|
|
492
|
-
case UNIT_KV_TOKEN_TYPE_CHARS:
|
|
493
|
-
array = kv->value;
|
|
494
|
-
|
|
495
|
-
value = lexbor_dobject_calloc(kv->objs);
|
|
496
|
-
if (value == NULL) {
|
|
497
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
498
|
-
return NULL;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
if (unit_kv_rules_check_chars(token, value) == LXB_STATUS_ERROR) {
|
|
502
|
-
value->type = UNIT_KV_VALUE_TYPE_CHARS;
|
|
503
|
-
value->value.str = token->value.str;
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
value->kv = kv;
|
|
507
|
-
value->pos = token->pos;
|
|
508
|
-
value->value.num = token->value.num;
|
|
509
|
-
|
|
510
|
-
value = unit_kv_array_append(array, value);
|
|
511
|
-
if (value == NULL) {
|
|
512
|
-
kv->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
|
513
|
-
return NULL;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
kv->rules = unit_kv_rules_array_after_value;
|
|
517
|
-
|
|
518
|
-
break;
|
|
519
|
-
|
|
520
|
-
case UNIT_KV_TOKEN_TYPE_EOF:
|
|
521
|
-
/* fall through */
|
|
522
|
-
|
|
523
|
-
default:
|
|
524
|
-
kv->status = LXB_STATUS_ERROR_UNEXPECTED_RESULT;
|
|
525
|
-
kv->bad_token = token;
|
|
526
|
-
|
|
527
|
-
return NULL;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
return token;
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
static unit_kv_token_t *
|
|
534
|
-
unit_kv_rules_array_after_value(unit_kv_t *kv, unit_kv_token_t *token, void *ctx)
|
|
535
|
-
{
|
|
536
|
-
switch (token->type) {
|
|
537
|
-
case UNIT_KV_TOKEN_TYPE_RIGHT_SQUARE_BRACKET:
|
|
538
|
-
if (unit_kv_rules_check_parent(kv) != LXB_STATUS_OK) {
|
|
539
|
-
kv->status = LXB_STATUS_ERROR_UNEXPECTED_RESULT;
|
|
540
|
-
kv->bad_token = token;
|
|
541
|
-
|
|
542
|
-
return NULL;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
break;
|
|
546
|
-
|
|
547
|
-
case UNIT_KV_TOKEN_TYPE_COMMA:
|
|
548
|
-
kv->rules = unit_kv_rules_array_begin;
|
|
549
|
-
|
|
550
|
-
break;
|
|
551
|
-
|
|
552
|
-
case UNIT_KV_TOKEN_TYPE_EOF:
|
|
553
|
-
/* fall through */
|
|
554
|
-
|
|
555
|
-
default:
|
|
556
|
-
kv->status = LXB_STATUS_ERROR_UNEXPECTED_RESULT;
|
|
557
|
-
kv->bad_token = token;
|
|
558
|
-
|
|
559
|
-
return NULL;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
return token;
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
/*
|
|
566
|
-
* Sys
|
|
567
|
-
*/
|
|
568
|
-
static unit_kv_token_t *
|
|
569
|
-
unit_kv_rules_emit_all(unit_kv_t *kv, unit_kv_token_t *token, void *ctx)
|
|
570
|
-
{
|
|
571
|
-
if (token->type == UNIT_KV_TOKEN_TYPE_EOF) {
|
|
572
|
-
return token;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
kv->status = LXB_STATUS_ERROR_UNEXPECTED_RESULT;
|
|
576
|
-
kv->bad_token = token;
|
|
577
|
-
|
|
578
|
-
return NULL;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
static lxb_status_t
|
|
582
|
-
unit_kv_rules_check_chars(unit_kv_token_t *token, unit_kv_value_t *value)
|
|
583
|
-
{
|
|
584
|
-
if (token->value.str.length == 4) {
|
|
585
|
-
if (lexbor_str_data_cmp(token->value.str.data, (lxb_char_t *) "true"))
|
|
586
|
-
{
|
|
587
|
-
value->type = UNIT_KV_VALUE_TYPE_TRUE;
|
|
588
|
-
}
|
|
589
|
-
else if (lexbor_str_data_cmp(token->value.str.data,
|
|
590
|
-
(lxb_char_t *) "null"))
|
|
591
|
-
{
|
|
592
|
-
value->type = UNIT_KV_VALUE_TYPE_NULL;
|
|
593
|
-
}
|
|
594
|
-
else {
|
|
595
|
-
return LXB_STATUS_ERROR;
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
else if (token->value.str.length == 5
|
|
599
|
-
&& lexbor_str_data_cmp(token->value.str.data,
|
|
600
|
-
(lxb_char_t *) "false"))
|
|
601
|
-
{
|
|
602
|
-
value->type = UNIT_KV_VALUE_TYPE_FALSE;
|
|
603
|
-
}
|
|
604
|
-
else {
|
|
605
|
-
return LXB_STATUS_ERROR;
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
return LXB_STATUS_OK;
|
|
609
|
-
}
|