leptris 1.9.201.0-arm-linux → 1.9.201.2-arm-linux
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/CHANGELOG.md +23 -0
- data/Rakefile +52 -12
- data/ext/leptris/native/extconf.rb +85 -0
- data/ext/leptris/native/native.c +1 -1
- data/lib/leptris/version.rb +1 -1
- data/lib/leptris/xml/ffi.rb +13 -0
- data/lib/leptris/xml/native.so +0 -0
- data/vendor-src/libleptris/CHANGELOG.md +8080 -0
- data/vendor-src/libleptris/CLAUDE.md +150 -0
- data/vendor-src/libleptris/CMakeLists.txt +379 -0
- data/vendor-src/libleptris/CMakePresets.json +61 -0
- data/vendor-src/libleptris/CODE_OF_CONDUCT.md +132 -0
- data/vendor-src/libleptris/CONTEXT.md +49 -0
- data/vendor-src/libleptris/LICENSE.md +33 -0
- data/vendor-src/libleptris/README.adoc +1197 -0
- data/vendor-src/libleptris/TODO.assemble/README.md +16 -0
- data/vendor-src/libleptris/TODO.bindings/01-mutation-construction.md +18 -0
- data/vendor-src/libleptris/TODO.bindings/02-incremental-iterparse.md +15 -0
- data/vendor-src/libleptris/TODO.bindings/03-compiled-xpath.md +15 -0
- data/vendor-src/libleptris/TODO.bindings/04-pull-stax-api.md +14 -0
- data/vendor-src/libleptris/TODO.bindings/05-per-parse-options.md +17 -0
- data/vendor-src/libleptris/TODO.bindings/06-serialize-encoding-guarantees.md +14 -0
- data/vendor-src/libleptris/TODO.bindings/README.md +36 -0
- data/vendor-src/libleptris/TODO.concurrency/01-thread-safe-errors.md +19 -0
- data/vendor-src/libleptris/TODO.concurrency/02-export-surface-gate.md +24 -0
- data/vendor-src/libleptris/TODO.concurrency/03-mixed-nodeset-batch.md +14 -0
- data/vendor-src/libleptris/TODO.concurrency/04-canonical-status-message.md +13 -0
- data/vendor-src/libleptris/TODO.concurrency/05-windows-dll-name.md +10 -0
- data/vendor-src/libleptris/TODO.concurrency/06-exslt-pack.md +26 -0
- data/vendor-src/libleptris/TODO.concurrency/07-ns-set-pairs.md +11 -0
- data/vendor-src/libleptris/TODO.concurrency/08-threading-contract.md +45 -0
- data/vendor-src/libleptris/TODO.engine/01-file-sources.md +11 -0
- data/vendor-src/libleptris/TODO.engine/02-compiled-contexts.md +10 -0
- data/vendor-src/libleptris/TODO.engine/03-rust-publish.md +9 -0
- data/vendor-src/libleptris/TODO.engine/04-ruby-release-input.md +8 -0
- data/vendor-src/libleptris/TODO.engine/05-todo-md-refresh.md +7 -0
- data/vendor-src/libleptris/TODO.engine/README.md +16 -0
- data/vendor-src/libleptris/TODO.hygiene/README.md +15 -0
- data/vendor-src/libleptris/TODO.max-perf/00-INDEX.md +22 -0
- data/vendor-src/libleptris/TODO.max-perf/1-simd-html-scanner.md +15 -0
- data/vendor-src/libleptris/TODO.max-perf/10-moxml-plan-followups.md +9 -0
- data/vendor-src/libleptris/TODO.max-perf/2-compiled-dispatch-tokenizer.md +8 -0
- data/vendor-src/libleptris/TODO.max-perf/3-iterparse-fixed-cost.md +5 -0
- data/vendor-src/libleptris/TODO.max-perf/4-compact-node-micro-opts.md +17 -0
- data/vendor-src/libleptris/TODO.max-perf/5-xslt-bench-profiling-rounds.md +13 -0
- data/vendor-src/libleptris/TODO.max-perf/6-language-tails.md +9 -0
- data/vendor-src/libleptris/TODO.max-perf/7-validate-bindings.md +6 -0
- data/vendor-src/libleptris/TODO.max-perf/8-native-xml-diff-consumer.md +5 -0
- data/vendor-src/libleptris/TODO.max-perf/9-prebuilt-gem-matrix.md +14 -0
- data/vendor-src/libleptris/TODO.md +33 -0
- data/vendor-src/libleptris/TODO.transform/README.md +39 -0
- data/vendor-src/libleptris/TODO.validate/README.md +32 -0
- data/vendor-src/libleptris/TODO.xpath2/README.md +91 -0
- data/vendor-src/libleptris/TODO.xslt-full/01-xpath-fn-sequences.md +27 -0
- data/vendor-src/libleptris/TODO.xslt-full/02-xpath-fn-regex.md +13 -0
- data/vendor-src/libleptris/TODO.xslt-full/03-xpath-fn-math.md +10 -0
- data/vendor-src/libleptris/TODO.xslt-full/04-xpath-fn-strings-qname-uri.md +97 -0
- data/vendor-src/libleptris/TODO.xslt-full/05-xpath-fn-dates.md +30 -0
- data/vendor-src/libleptris/TODO.xslt-full/06-xpath-grammar-3x.md +83 -0
- data/vendor-src/libleptris/TODO.xslt-full/07-xpath-function-items.md +124 -0
- data/vendor-src/libleptris/TODO.xslt-full/08-xpath-maps-arrays.md +79 -0
- data/vendor-src/libleptris/TODO.xslt-full/09-xslt-noop-fillins.md +35 -0
- data/vendor-src/libleptris/TODO.xslt-full/10-xslt-tunnel-params.md +9 -0
- data/vendor-src/libleptris/TODO.xslt-full/11-xquery-core.md +119 -0
- data/vendor-src/libleptris/TODO.xslt-full/12-xquery-31.md +65 -0
- data/vendor-src/libleptris/TODO.xslt-full/13-perf-inprocess.md +425 -0
- data/vendor-src/libleptris/TODO.xslt-full/14-html-mode.md +803 -0
- data/vendor-src/libleptris/TODO.xslt-full/15-binding-entries.md +19 -0
- data/vendor-src/libleptris/TODO.xslt-full/16-schematron.md +156 -0
- data/vendor-src/libleptris/TODO.xslt-full/17-xml-diff.md +52 -0
- data/vendor-src/libleptris/TODO.xslt-full/18-compact-nodes.md +278 -0
- data/vendor-src/libleptris/TODO.xslt-full/README.md +26 -0
- data/vendor-src/libleptris/TODO.xslt-full/REMAINING.md +163 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/00-triage.md +171 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/01-fragment-nodes.md +19 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/02-root-node-semantics.md +34 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/03-crashes.md +15 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/04-namespaces.md +14 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/05-number-attrset-sort.md +13 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/06-document-chains.md +10 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/07-charef-serializer.md +9 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/08-perf-gate.md +8 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/09-release.md +14 -0
- data/vendor-src/libleptris/VALIDATION.md +151 -0
- data/vendor-src/libleptris/benchmarks/CMakeLists.txt +259 -0
- data/vendor-src/libleptris/benchmarks/README.adoc +228 -0
- data/vendor-src/libleptris/benchmarks/README.md +212 -0
- data/vendor-src/libleptris/benchmarks/common/benchmark.c +252 -0
- data/vendor-src/libleptris/benchmarks/common/benchmark.h +77 -0
- data/vendor-src/libleptris/benchmarks/common/test_data.c +415 -0
- data/vendor-src/libleptris/benchmarks/common/test_data.h +18 -0
- data/vendor-src/libleptris/benchmarks/comprehensive/CMakeLists.txt +184 -0
- data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_decomp.cpp +110 -0
- data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_first_access.cpp +261 -0
- data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_many_attrs.cpp +150 -0
- data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_memory.cpp +185 -0
- data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_parse.cpp +270 -0
- data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_parse_ops.cpp +392 -0
- data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_sax.c +106 -0
- data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_write.cpp +351 -0
- data/vendor-src/libleptris/benchmarks/data/attrs.xml +303 -0
- data/vendor-src/libleptris/benchmarks/data/cdata_test.xml +13 -0
- data/vendor-src/libleptris/benchmarks/data/comment_test.xml +15 -0
- data/vendor-src/libleptris/benchmarks/data/deep.xml +205 -0
- data/vendor-src/libleptris/benchmarks/data/generate_attrs.rb +22 -0
- data/vendor-src/libleptris/benchmarks/data/generate_deep.rb +25 -0
- data/vendor-src/libleptris/benchmarks/data/generate_large.rb +33 -0
- data/vendor-src/libleptris/benchmarks/data/generate_wide.rb +18 -0
- data/vendor-src/libleptris/benchmarks/data/large.xml +21003 -0
- data/vendor-src/libleptris/benchmarks/data/large_workflow.xml +4003 -0
- data/vendor-src/libleptris/benchmarks/data/medium.xml +67 -0
- data/vendor-src/libleptris/benchmarks/data/medium_workflow.xml +353 -0
- data/vendor-src/libleptris/benchmarks/data/pi_test.xml +9 -0
- data/vendor-src/libleptris/benchmarks/data/small.xml +10 -0
- data/vendor-src/libleptris/benchmarks/data/small_workflow.xml +36 -0
- data/vendor-src/libleptris/benchmarks/data/wide.xml +5003 -0
- data/vendor-src/libleptris/benchmarks/dom/bench_document_lifecycle.c +69 -0
- data/vendor-src/libleptris/benchmarks/dom/bench_leptris.c +184 -0
- data/vendor-src/libleptris/benchmarks/dom/bench_libxml2.c +176 -0
- data/vendor-src/libleptris/benchmarks/dom/bench_text_borrowed.c +74 -0
- data/vendor-src/libleptris/benchmarks/dom/dom_benchmark_v2.cpp +314 -0
- data/vendor-src/libleptris/benchmarks/fixtures/large.xml +4003 -0
- data/vendor-src/libleptris/benchmarks/fixtures/large_catalog.xml +50003 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2/eve.xml +6 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2/slashdot.rdf +66 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2/wap.xml +27 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/4rects.xml +11 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/a-valid.xml +10 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/a-wf.xml +9 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/bike.xml +41 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/circle.xml +11 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/defs.xml +14 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/desc.xml +14 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/ellipse.xml +10 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/flower2.xml +44 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/gradient.xml +16 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/group01.xml +15 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/group02.xml +13 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/group03.xml +13 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/image-valid.xml +11 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/image-wf.xml +11 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/lin-gradient.xml +16 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/marker.xml +28 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/mask.xml +13 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/mathswitch.xml +32 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/parentns.xml +12 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/path01.xml +5 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/path02.xml +10 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/patternfill.xml +12 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/polyline.xml +9 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/private.xml +19 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/rad-gradient.xml +17 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/rectangle.xml +10 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/richdesc.xml +12 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/script.xml +13 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/structure01.xml +10 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/style.xml +11 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/switch.xml +21 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/symbol-use.xml +28 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/template.xml +9 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/text01.xml +12 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/text02.xml +17 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/text03.xml +8 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/toap01.xml +10 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/toap02.xml +33 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/transform.xml +26 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/trivial.xml +6 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/twin-gradients.xml +19 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/v-template.xml +9 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/viewport-nest.xml +13 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/viewport-transform.xml +46 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/viewport.xml +11 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/wf-template.xml +7 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_xsdtest.xml +5286 -0
- data/vendor-src/libleptris/benchmarks/fixtures/medium.xml +403 -0
- data/vendor-src/libleptris/benchmarks/fixtures/medium_catalog.xml +3003 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/empty.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/large.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/latintest_latin1.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/latintest_utf8.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/multiline.xml +3 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/small.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/truncation.xml +19 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_be.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_be_bom.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_be_clean.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_be_nodecl.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_le.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_le_bom.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_le_clean.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_le_nodecl.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_be.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_be_bom.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_be_clean.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_be_nodecl.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_le.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_le_bom.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_le_clean.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_le_nodecl.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf8.xml +87 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf8_bom.xml +87 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf8_clean.xml +84 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf8_nodecl.xml +86 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml//321/202/320/265/321/201/321/202.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/empty.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/large.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/latintest_latin1.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/latintest_utf8.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/multiline.xml +3 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/small.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/truncation.xml +19 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_be.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_be_bom.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_be_clean.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_be_nodecl.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_le.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_le_bom.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_le_clean.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_le_nodecl.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_be.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_be_bom.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_be_clean.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_be_nodecl.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_le.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_le_bom.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_le_clean.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_le_nodecl.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf8.xml +87 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf8_bom.xml +87 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf8_clean.xml +84 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf8_nodecl.xml +86 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests//321/202/320/265/321/201/321/202.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/small.xml +38 -0
- data/vendor-src/libleptris/benchmarks/html/bench_html_parse.c +111 -0
- data/vendor-src/libleptris/benchmarks/html/gen_nokogiri_reference.rb +112 -0
- data/vendor-src/libleptris/benchmarks/html/nokogiri_html_parse.rb +64 -0
- data/vendor-src/libleptris/benchmarks/matrix/README.md +71 -0
- data/vendor-src/libleptris/benchmarks/matrix/bench2html.rb +316 -0
- data/vendor-src/libleptris/benchmarks/matrix/bench_matrix.cpp +724 -0
- data/vendor-src/libleptris/benchmarks/modification/bench_leptris_modify.c +211 -0
- data/vendor-src/libleptris/benchmarks/modification/bench_node_creation.c +130 -0
- data/vendor-src/libleptris/benchmarks/results/BENCHMARK_REPORT.md +226 -0
- data/vendor-src/libleptris/benchmarks/results/baseline_report.md +219 -0
- data/vendor-src/libleptris/benchmarks/results/benchmark_20251223_134550.json +13 -0
- data/vendor-src/libleptris/benchmarks/results/benchmark_20260129_225844.json +13 -0
- data/vendor-src/libleptris/benchmarks/results/leptris_dom_output.txt +24 -0
- data/vendor-src/libleptris/benchmarks/results/leptris_modify.json +36 -0
- data/vendor-src/libleptris/benchmarks/results/leptris_modify_optimized.json +36 -0
- data/vendor-src/libleptris/benchmarks/results/leptris_modify_session1.json +36 -0
- data/vendor-src/libleptris/benchmarks/results/leptris_modify_session2.json +36 -0
- data/vendor-src/libleptris/benchmarks/results/leptris_serialize.json +34 -0
- data/vendor-src/libleptris/benchmarks/results/leptris_xpath_output.txt +24 -0
- data/vendor-src/libleptris/benchmarks/results/libxml2_dom_output.txt +24 -0
- data/vendor-src/libleptris/benchmarks/results/libxml2_xpath_output.txt +24 -0
- data/vendor-src/libleptris/benchmarks/results/phase16_session2.json +21 -0
- data/vendor-src/libleptris/benchmarks/results/phase17.5_session1.json +30 -0
- data/vendor-src/libleptris/benchmarks/results/phase17_session1.json +30 -0
- data/vendor-src/libleptris/benchmarks/results/pugixml_dom_output.txt +51 -0
- data/vendor-src/libleptris/benchmarks/results/xpath_axes_leptris.json +318 -0
- data/vendor-src/libleptris/benchmarks/results/xpath_axes_libxml2.json +318 -0
- data/vendor-src/libleptris/benchmarks/results/xpath_functions_leptris.json +222 -0
- data/vendor-src/libleptris/benchmarks/results/xpath_functions_libxml2.json +222 -0
- data/vendor-src/libleptris/benchmarks/sax/bench_iterparse.c +115 -0
- data/vendor-src/libleptris/benchmarks/sax/bench_leptris.c +124 -0
- data/vendor-src/libleptris/benchmarks/sax/bench_libxml2.c +115 -0
- data/vendor-src/libleptris/benchmarks/serialization/bench_leptris_serialize.c +198 -0
- data/vendor-src/libleptris/benchmarks/src/benchmark_base.h +175 -0
- data/vendor-src/libleptris/benchmarks/twins/mutation_leptris.c +37 -0
- data/vendor-src/libleptris/benchmarks/twins/mutation_pugixml.cpp +28 -0
- data/vendor-src/libleptris/benchmarks/twins/parse_leptris.c +35 -0
- data/vendor-src/libleptris/benchmarks/twins/parse_pugixml.cpp +35 -0
- data/vendor-src/libleptris/benchmarks/utils.c +171 -0
- data/vendor-src/libleptris/benchmarks/utils.h +70 -0
- data/vendor-src/libleptris/benchmarks/workflows/bench_dom_modify.c +325 -0
- data/vendor-src/libleptris/benchmarks/workflows/bench_end_to_end.c +529 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_axes.c +411 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_axes_libxml2.c +108 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_diagnostic.c +431 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_functions.c +271 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_functions_libxml2.c +123 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_leptris.c +78 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_libxml2.c +98 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_pugixml.cpp +117 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_scalar_eval.c +86 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_scalar_eval_libxml2.c +70 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_xslt_transform.c +48 -0
- data/vendor-src/libleptris/benchmarks/xslt/bench_dispatch.c +52 -0
- data/vendor-src/libleptris/benchmarks/xslt/bench_dispatch_heavy.c +82 -0
- data/vendor-src/libleptris/benchmarks/xslt/bench_dispatch_pred.c +34 -0
- data/vendor-src/libleptris/benchmarks/xslt/bench_subtree_copy.c +55 -0
- data/vendor-src/libleptris/benchmarks/xslt/bench_valueof.c +46 -0
- data/vendor-src/libleptris/benchmarks/xslt/heavy_lxml.py +48 -0
- data/vendor-src/libleptris/benchmarks/xslt/scorecard_lxml.py +169 -0
- data/vendor-src/libleptris/bindings/ruby/leptris.gemspec +22 -0
- data/vendor-src/libleptris/bindings/ruby/lib/leptris/document.rb +60 -0
- data/vendor-src/libleptris/bindings/ruby/lib/leptris/element.rb +86 -0
- data/vendor-src/libleptris/bindings/ruby/lib/leptris/error.rb +6 -0
- data/vendor-src/libleptris/bindings/ruby/lib/leptris/node.rb +73 -0
- data/vendor-src/libleptris/bindings/ruby/lib/leptris/sax.rb +189 -0
- data/vendor-src/libleptris/bindings/ruby/lib/leptris/xpath.rb +44 -0
- data/vendor-src/libleptris/bindings/ruby/lib/leptris.rb +137 -0
- data/vendor-src/libleptris/bindings/ruby/spec/leptris_spec.rb +113 -0
- data/vendor-src/libleptris/bindings/ruby/spec/sax_spec.rb +141 -0
- data/vendor-src/libleptris/bindings/ruby/spec/spec_helper.rb +7 -0
- data/vendor-src/libleptris/bindings/ruby/test_full.rb +21 -0
- data/vendor-src/libleptris/bindings/rust/Cargo.lock +7 -0
- data/vendor-src/libleptris/bindings/rust/Cargo.toml +13 -0
- data/vendor-src/libleptris/bindings/rust/README.md +61 -0
- data/vendor-src/libleptris/bindings/rust/build.rs +74 -0
- data/vendor-src/libleptris/bindings/rust/src/ffi.rs +204 -0
- data/vendor-src/libleptris/bindings/rust/src/lib.rs +580 -0
- data/vendor-src/libleptris/bindings/rust/tests/integration.rs +156 -0
- data/vendor-src/libleptris/cli/ARCHITECTURE_REVIEW.md +514 -0
- data/vendor-src/libleptris/cli/CLI_ARCHITECTURE.md +851 -0
- data/vendor-src/libleptris/cli/CMakeLists.txt +46 -0
- data/vendor-src/libleptris/cli/cli.c +115 -0
- data/vendor-src/libleptris/cli/cli.h +232 -0
- data/vendor-src/libleptris/cli/commands/diff.c +208 -0
- data/vendor-src/libleptris/cli/commands/format.c +379 -0
- data/vendor-src/libleptris/cli/commands/parse.c +343 -0
- data/vendor-src/libleptris/cli/commands/validate.c +284 -0
- data/vendor-src/libleptris/cli/commands/version.c +49 -0
- data/vendor-src/libleptris/cli/commands/xpath.c +428 -0
- data/vendor-src/libleptris/cli/commands/xquery.c +188 -0
- data/vendor-src/libleptris/cli/completion/leptris.bash +86 -0
- data/vendor-src/libleptris/cli/completion/leptris.zsh +74 -0
- data/vendor-src/libleptris/cli/error.c +394 -0
- data/vendor-src/libleptris/cli/error.h +360 -0
- data/vendor-src/libleptris/cli/leptris +0 -0
- data/vendor-src/libleptris/cli/main.c +127 -0
- data/vendor-src/libleptris/cli/man/leptris-format.1.adoc +226 -0
- data/vendor-src/libleptris/cli/man/leptris-parse.1.adoc +213 -0
- data/vendor-src/libleptris/cli/man/leptris-xpath.1.adoc +479 -0
- data/vendor-src/libleptris/cli/man/leptris.1.adoc +192 -0
- data/vendor-src/libleptris/cli/options.c +451 -0
- data/vendor-src/libleptris/cli/options.h +378 -0
- data/vendor-src/libleptris/cli/output.c +841 -0
- data/vendor-src/libleptris/cli/output.h +361 -0
- data/vendor-src/libleptris/cmake/FindUtf8proc.cmake +56 -0
- data/vendor-src/libleptris/cmake/leptris-config.cmake.in +14 -0
- data/vendor-src/libleptris/cmake/leptris.pc.in +11 -0
- data/vendor-src/libleptris/cmake/modules/AdocMan.cmake +132 -0
- data/vendor-src/libleptris/docs/ARCHITECTURE_REVIEW.md +280 -0
- data/vendor-src/libleptris/docs/Doxyfile +47 -0
- data/vendor-src/libleptris/docs/FFI.md +165 -0
- data/vendor-src/libleptris/docs/README.md +47 -0
- data/vendor-src/libleptris/docs/ROADMAP-SAXON-PARITY.md +194 -0
- data/vendor-src/libleptris/docs/guide/building.md +199 -0
- data/vendor-src/libleptris/docs/guide/getting-started.md +134 -0
- data/vendor-src/libleptris/docs/guide/parsing.md +315 -0
- data/vendor-src/libleptris/docs/guide/xpath-queries.md +444 -0
- data/vendor-src/libleptris/examples/c/CMakeLists.txt +58 -0
- data/vendor-src/libleptris/examples/c/README.md +345 -0
- data/vendor-src/libleptris/examples/c/basic_example.c +80 -0
- data/vendor-src/libleptris/examples/c/dom_traversal_example.c +58 -0
- data/vendor-src/libleptris/examples/c/error_handling_example.c +121 -0
- data/vendor-src/libleptris/examples/c/namespace_example.c +49 -0
- data/vendor-src/libleptris/examples/c/xpath_example.c +74 -0
- data/vendor-src/libleptris/ports/leptris/portfile.cmake +41 -0
- data/vendor-src/libleptris/ports/leptris/usage +28 -0
- data/vendor-src/libleptris/scripts/check_dll_exports.py +54 -0
- data/vendor-src/libleptris/scripts/check_export_surface.py +84 -0
- data/vendor-src/libleptris/scripts/check_ffi_mirrors.py +163 -0
- data/vendor-src/libleptris/scripts/check_formatting.sh +30 -0
- data/vendor-src/libleptris/scripts/check_shared_exports.sh +120 -0
- data/vendor-src/libleptris/scripts/check_trailing_whitespace.sh +18 -0
- data/vendor-src/libleptris/scripts/gen-api-docs.sh +31 -0
- data/vendor-src/libleptris/scripts/run_static_analysis.sh +16 -0
- data/vendor-src/libleptris/scripts/validate.sh +199 -0
- data/vendor-src/libleptris/scripts/xslt_triage.sh +72 -0
- data/vendor-src/libleptris/src/CMakeLists.txt +597 -0
- data/vendor-src/libleptris/src/include/leptris/descriptor.h +178 -0
- data/vendor-src/libleptris/src/include/leptris/dom/document.h +213 -0
- data/vendor-src/libleptris/src/include/leptris/dom/element.h +435 -0
- data/vendor-src/libleptris/src/include/leptris/dom/serialize.h +133 -0
- data/vendor-src/libleptris/src/include/leptris/dtd.h +178 -0
- data/vendor-src/libleptris/src/include/leptris/error.h +97 -0
- data/vendor-src/libleptris/src/include/leptris/sax/sax.h +584 -0
- data/vendor-src/libleptris/src/include/leptris/types.h +386 -0
- data/vendor-src/libleptris/src/include/leptris/xpath/xpath.h +250 -0
- data/vendor-src/libleptris/src/include/leptris/xquery/xquery.h +80 -0
- data/vendor-src/libleptris/src/include/leptris.h +3701 -0
- data/vendor-src/libleptris/src/leptris/chartype.h +124 -0
- data/vendor-src/libleptris/src/leptris/common/chartype.c +90 -0
- data/vendor-src/libleptris/src/leptris/common/chartype.h +44 -0
- data/vendor-src/libleptris/src/leptris/common/cpu.c +40 -0
- data/vendor-src/libleptris/src/leptris/common/cpu.h +63 -0
- data/vendor-src/libleptris/src/leptris/common/entities.c +329 -0
- data/vendor-src/libleptris/src/leptris/common/entities.h +79 -0
- data/vendor-src/libleptris/src/leptris/common/format_number.c +273 -0
- data/vendor-src/libleptris/src/leptris/common/format_number.h +29 -0
- data/vendor-src/libleptris/src/leptris/common/port.h +171 -0
- data/vendor-src/libleptris/src/leptris/common/simd_text.c +237 -0
- data/vendor-src/libleptris/src/leptris/common/simd_text.h +104 -0
- data/vendor-src/libleptris/src/leptris/common/simd_text_avx2.c +105 -0
- data/vendor-src/libleptris/src/leptris/common/simd_text_neon.c +280 -0
- data/vendor-src/libleptris/src/leptris/common/string_view.c +204 -0
- data/vendor-src/libleptris/src/leptris/common/string_view.h +68 -0
- data/vendor-src/libleptris/src/leptris/common/types_internal.h +31 -0
- data/vendor-src/libleptris/src/leptris/core.c +201 -0
- data/vendor-src/libleptris/src/leptris/descriptor/plan.c +527 -0
- data/vendor-src/libleptris/src/leptris/diff/diff.c +491 -0
- data/vendor-src/libleptris/src/leptris/dom/cdata.c +47 -0
- data/vendor-src/libleptris/src/leptris/dom/cdata.h +73 -0
- data/vendor-src/libleptris/src/leptris/dom/comment.c +48 -0
- data/vendor-src/libleptris/src/leptris/dom/comment.h +74 -0
- data/vendor-src/libleptris/src/leptris/dom/compact.c +397 -0
- data/vendor-src/libleptris/src/leptris/dom/compact.h +307 -0
- data/vendor-src/libleptris/src/leptris/dom/diag.c +58 -0
- data/vendor-src/libleptris/src/leptris/dom/diag.h +75 -0
- data/vendor-src/libleptris/src/leptris/dom/digest.c +255 -0
- data/vendor-src/libleptris/src/leptris/dom/doctype.c +137 -0
- data/vendor-src/libleptris/src/leptris/dom/doctype.h +52 -0
- data/vendor-src/libleptris/src/leptris/dom/document_node.c +13 -0
- data/vendor-src/libleptris/src/leptris/dom/document_node.h +21 -0
- data/vendor-src/libleptris/src/leptris/dom/edges.h +60 -0
- data/vendor-src/libleptris/src/leptris/dom/element.c +1114 -0
- data/vendor-src/libleptris/src/leptris/dom/element.h +1109 -0
- data/vendor-src/libleptris/src/leptris/dom/element_index.c +444 -0
- data/vendor-src/libleptris/src/leptris/dom/element_index.h +135 -0
- data/vendor-src/libleptris/src/leptris/dom/element_modify.c +2185 -0
- data/vendor-src/libleptris/src/leptris/dom/element_query.c +1468 -0
- data/vendor-src/libleptris/src/leptris/dom/entity_ref.c +57 -0
- data/vendor-src/libleptris/src/leptris/dom/entity_ref.h +70 -0
- data/vendor-src/libleptris/src/leptris/dom/node.c +420 -0
- data/vendor-src/libleptris/src/leptris/dom/node.h +170 -0
- data/vendor-src/libleptris/src/leptris/dom/node_public.c +937 -0
- data/vendor-src/libleptris/src/leptris/dom/node_vtable.c +138 -0
- data/vendor-src/libleptris/src/leptris/dom/pi.c +70 -0
- data/vendor-src/libleptris/src/leptris/dom/pi.h +80 -0
- data/vendor-src/libleptris/src/leptris/dom/root_doc_map.c +310 -0
- data/vendor-src/libleptris/src/leptris/dom/root_doc_map.h +30 -0
- data/vendor-src/libleptris/src/leptris/dom/text.c +157 -0
- data/vendor-src/libleptris/src/leptris/dom/text.h +119 -0
- data/vendor-src/libleptris/src/leptris/dtd/content_check.c +300 -0
- data/vendor-src/libleptris/src/leptris/dtd/model.c +533 -0
- data/vendor-src/libleptris/src/leptris/dtd/model.h +354 -0
- data/vendor-src/libleptris/src/leptris/dtd/parser.c +827 -0
- data/vendor-src/libleptris/src/leptris/dtd/resolver.c +354 -0
- data/vendor-src/libleptris/src/leptris/dtd/validator.c +668 -0
- data/vendor-src/libleptris/src/leptris/encoding/encoders.c +346 -0
- data/vendor-src/libleptris/src/leptris/encoding/encoders.h +61 -0
- data/vendor-src/libleptris/src/leptris/encoding/encoding.c +451 -0
- data/vendor-src/libleptris/src/leptris/encoding/encoding.h +118 -0
- data/vendor-src/libleptris/src/leptris/encoding/unicode.c +317 -0
- data/vendor-src/libleptris/src/leptris/encoding/unicode.h +64 -0
- data/vendor-src/libleptris/src/leptris/encoding/utf16.c +204 -0
- data/vendor-src/libleptris/src/leptris/encoding/utf16.h +78 -0
- data/vendor-src/libleptris/src/leptris/encoding/wrapper.c +243 -0
- data/vendor-src/libleptris/src/leptris/error.c +134 -0
- data/vendor-src/libleptris/src/leptris/flat/direct_parse.c +1935 -0
- data/vendor-src/libleptris/src/leptris/flat/direct_parse.h +41 -0
- data/vendor-src/libleptris/src/leptris/html/html_parse.c +8040 -0
- data/vendor-src/libleptris/src/leptris/leptris.c +1264 -0
- data/vendor-src/libleptris/src/leptris/leptris_internal.h +910 -0
- data/vendor-src/libleptris/src/leptris/leptris_memory.c +179 -0
- data/vendor-src/libleptris/src/leptris/leptris_memory.h +180 -0
- data/vendor-src/libleptris/src/leptris/leptris_parse.h +195 -0
- data/vendor-src/libleptris/src/leptris/memory/arena.c +243 -0
- data/vendor-src/libleptris/src/leptris/memory/arena.h +93 -0
- data/vendor-src/libleptris/src/leptris/memory/pool.c +1055 -0
- data/vendor-src/libleptris/src/leptris/memory/pool.h +426 -0
- data/vendor-src/libleptris/src/leptris/rng/parse.c +814 -0
- data/vendor-src/libleptris/src/leptris/rng/rng_internal.h +112 -0
- data/vendor-src/libleptris/src/leptris/rng/rng_public.c +159 -0
- data/vendor-src/libleptris/src/leptris/rng/rng_regex.c +453 -0
- data/vendor-src/libleptris/src/leptris/rng/validate.c +1923 -0
- data/vendor-src/libleptris/src/leptris/sax/iterparse.c +435 -0
- data/vendor-src/libleptris/src/leptris/sax/parser.c +105 -0
- data/vendor-src/libleptris/src/leptris/sax/pull.c +489 -0
- data/vendor-src/libleptris/src/leptris/sax/recorder.c +252 -0
- data/vendor-src/libleptris/src/leptris/sax/sax_internal.h +163 -0
- data/vendor-src/libleptris/src/leptris/sax/streaming.c +1469 -0
- data/vendor-src/libleptris/src/leptris/sch/schematron.c +1588 -0
- data/vendor-src/libleptris/src/leptris/serialize/c14n.c +1143 -0
- data/vendor-src/libleptris/src/leptris/serialize/serialize.c +2333 -0
- data/vendor-src/libleptris/src/leptris/serialize/serialize.h +188 -0
- data/vendor-src/libleptris/src/leptris/simd_helpers.h +447 -0
- data/vendor-src/libleptris/src/leptris/unicode/unicode.c +237 -0
- data/vendor-src/libleptris/src/leptris/unicode/unicode.h +113 -0
- data/vendor-src/libleptris/src/leptris/xinclude/xinclude.c +794 -0
- data/vendor-src/libleptris/src/leptris/xpath/bytecode.h +229 -0
- data/vendor-src/libleptris/src/leptris/xpath/compiler.c +1478 -0
- data/vendor-src/libleptris/src/leptris/xpath/evaluator.c +1099 -0
- data/vendor-src/libleptris/src/leptris/xpath/evaluator.h +189 -0
- data/vendor-src/libleptris/src/leptris/xpath/evaluator_axes.c +787 -0
- data/vendor-src/libleptris/src/leptris/xpath/evaluator_internal.h +112 -0
- data/vendor-src/libleptris/src/leptris/xpath/evaluator_operators.c +2138 -0
- data/vendor-src/libleptris/src/leptris/xpath/evaluator_path.c +1312 -0
- data/vendor-src/libleptris/src/leptris/xpath/evaluator_types.c +294 -0
- data/vendor-src/libleptris/src/leptris/xpath/functions.c +2544 -0
- data/vendor-src/libleptris/src/leptris/xpath/functions.h +161 -0
- data/vendor-src/libleptris/src/leptris/xpath/functions_exslt.c +545 -0
- data/vendor-src/libleptris/src/leptris/xpath/functions_ext31.c +4316 -0
- data/vendor-src/libleptris/src/leptris/xpath/lexer.c +636 -0
- data/vendor-src/libleptris/src/leptris/xpath/lexer.h +25 -0
- data/vendor-src/libleptris/src/leptris/xpath/parser.c +2992 -0
- data/vendor-src/libleptris/src/leptris/xpath/parser.h +28 -0
- data/vendor-src/libleptris/src/leptris/xpath/vm.c +2903 -0
- data/vendor-src/libleptris/src/leptris/xpath/xpath_ast_cache.c +319 -0
- data/vendor-src/libleptris/src/leptris/xpath/xpath_compiled.c +263 -0
- data/vendor-src/libleptris/src/leptris/xpath/xpath_internal.h +134 -0
- data/vendor-src/libleptris/src/leptris/xpath/xpath_public.c +1139 -0
- data/vendor-src/libleptris/src/leptris/xpath/xpath_variables.c +410 -0
- data/vendor-src/libleptris/src/leptris/xpath/xpath_variables.h +230 -0
- data/vendor-src/libleptris/src/leptris/xquery/xquery.c +2641 -0
- data/vendor-src/libleptris/src/leptris/xslt/xslt_exec.c +4887 -0
- data/vendor-src/libleptris/src/leptris/xslt/xslt_functions.c +1612 -0
- data/vendor-src/libleptris/src/leptris/xslt/xslt_internal.h +862 -0
- data/vendor-src/libleptris/src/leptris/xslt/xslt_parse.c +2418 -0
- data/vendor-src/libleptris/src/leptris/xslt/xslt_pattern.c +441 -0
- data/vendor-src/libleptris/src/leptris/xslt/xslt_public.c +710 -0
- data/vendor-src/libleptris/src/leptris.symvers +16 -0
- data/vendor-src/libleptris/src/man/libleptris.5.adoc +961 -0
- data/vendor-src/libleptris/test/CMakeLists.txt +234 -0
- data/vendor-src/libleptris/test/README.md +59 -0
- data/vendor-src/libleptris/test/abi/test_descriptor.cpp +441 -0
- data/vendor-src/libleptris/test/abi/test_doctype_api.cpp +51 -0
- data/vendor-src/libleptris/test/abi/test_dom_deep_copy.cpp +110 -0
- data/vendor-src/libleptris/test/abi/test_dom_mutation_bugs.cpp +210 -0
- data/vendor-src/libleptris/test/abi/test_header_hygiene.cpp +269 -0
- data/vendor-src/libleptris/test/abi/test_namespace_mutation_and_create.cpp +198 -0
- data/vendor-src/libleptris/test/abi/test_node_get_xpath.cpp +128 -0
- data/vendor-src/libleptris/test/abi/test_nokogiri_api.cpp +392 -0
- data/vendor-src/libleptris/test/abi/test_parse_fragment.cpp +114 -0
- data/vendor-src/libleptris/test/abi/test_previous_sibling_and_c14n_ex.cpp +299 -0
- data/vendor-src/libleptris/test/abi/test_public_surface.cpp +463 -0
- data/vendor-src/libleptris/test/abi/test_serialize_abi.cpp +67 -0
- data/vendor-src/libleptris/test/abi/test_v0_5_14_bugs.cpp +299 -0
- data/vendor-src/libleptris/test/abi/test_xpath_custom_fns.cpp +106 -0
- data/vendor-src/libleptris/test/cli/test_cli.cpp +493 -0
- data/vendor-src/libleptris/test/common/test_simd_spans.cpp +88 -0
- data/vendor-src/libleptris/test/common/test_simd_text.cpp +142 -0
- data/vendor-src/libleptris/test/concurrency/test_concurrency.cpp +218 -0
- data/vendor-src/libleptris/test/diff/test_diff.cpp +244 -0
- data/vendor-src/libleptris/test/dom/test_compact.cpp +339 -0
- data/vendor-src/libleptris/test/dom/test_digest.cpp +111 -0
- data/vendor-src/libleptris/test/dom/test_document_children.cpp +270 -0
- data/vendor-src/libleptris/test/dom/test_dom.cpp +2310 -0
- data/vendor-src/libleptris/test/dom/test_map_lifecycle.cpp +111 -0
- data/vendor-src/libleptris/test/dom/test_node_surface_parity.cpp +268 -0
- data/vendor-src/libleptris/test/dom/test_text_borrowed.cpp +126 -0
- data/vendor-src/libleptris/test/dom/test_vtable.cpp +108 -0
- data/vendor-src/libleptris/test/dtd/test_dtd_validate.cpp +1227 -0
- data/vendor-src/libleptris/test/dtd/test_w3c_conformance.cpp +212 -0
- data/vendor-src/libleptris/test/fixtures/basic.xml +13 -0
- data/vendor-src/libleptris/test/fixtures/cdata.xml +5 -0
- data/vendor-src/libleptris/test/fixtures/malformed.xml +2 -0
- data/vendor-src/libleptris/test/fixtures/namespaces.xml +11 -0
- data/vendor-src/libleptris/test/fixtures/utf16_decl.xml +5 -0
- data/vendor-src/libleptris/test/fuzz/fuzz_parse.c +40 -0
- data/vendor-src/libleptris/test/html/html5lib-redlist.txt +1366 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/LICENSE +21 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/README.md +11 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/adoption01.dat +354 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/adoption02.dat +39 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/blocks.dat +695 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/comments01.dat +217 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/doctype01.dat +474 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/domjs-unsafe.dat +0 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/entities01.dat +943 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/entities02.dat +309 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/foreign-fragment.dat +645 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/html5test-com.dat +301 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/inbody01.dat +54 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/isindex.dat +49 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/main-element.dat +46 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/math.dat +104 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/menuitem-element.dat +240 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/namespace-sensitivity.dat +22 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/noscript01.dat +237 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/pending-spec-changes-plain-text-unsafe.dat +0 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/pending-spec-changes.dat +46 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/plain-text-unsafe.dat +0 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/ruby.dat +302 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/scriptdata01.dat +372 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/search-element.dat +46 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/svg.dat +104 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tables01.dat +308 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/template.dat +1673 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests1.dat +1956 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests10.dat +849 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests11.dat +523 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests12.dat +62 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests14.dat +75 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests15.dat +216 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests16.dat +2602 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests17.dat +179 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests18.dat +558 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests19.dat +1398 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests2.dat +821 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests20.dat +842 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests21.dat +306 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests22.dat +190 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests23.dat +168 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests24.dat +79 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests25.dat +288 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests26.dat +453 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests3.dat +305 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests4.dat +58 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests5.dat +210 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests6.dat +663 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests7.dat +417 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests8.dat +165 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests9.dat +472 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests_innerHTML_1.dat +843 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tricky01.dat +336 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/webkit01.dat +785 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/webkit02.dat +554 -0
- data/vendor-src/libleptris/test/html/html5lib_cases.h.in +6 -0
- data/vendor-src/libleptris/test/html/nokogiri-parity-redlist.txt +1183 -0
- data/vendor-src/libleptris/test/html/nokogiri-tree-tests.dat +18107 -0
- data/vendor-src/libleptris/test/html/test_html.cpp +2191 -0
- data/vendor-src/libleptris/test/html/test_html5lib.cpp +831 -0
- data/vendor-src/libleptris/test/memory/test_arena.cpp +252 -0
- data/vendor-src/libleptris/test/memory/test_oom_injection.cpp +170 -0
- data/vendor-src/libleptris/test/memory/test_pool.cpp +331 -0
- data/vendor-src/libleptris/test/memory/test_pool_arena.cpp +180 -0
- data/vendor-src/libleptris/test/parser/test_encoding.cpp +282 -0
- data/vendor-src/libleptris/test/parser/test_large_documents.cpp +346 -0
- data/vendor-src/libleptris/test/parser/test_parser.cpp +565 -0
- data/vendor-src/libleptris/test/parser/test_simd_count.cpp +70 -0
- data/vendor-src/libleptris/test/perf/test_perf.cpp +362 -0
- data/vendor-src/libleptris/test/perf/test_stress_high_doc_count.cpp +67 -0
- data/vendor-src/libleptris/test/rng/include-cases/bad-construct.rng +7 -0
- data/vendor-src/libleptris/test/rng/include-cases/bad-override.rng +6 -0
- data/vendor-src/libleptris/test/rng/include-cases/bad-start-override.rng +5 -0
- data/vendor-src/libleptris/test/rng/include-cases/ext-lib.rng +3 -0
- data/vendor-src/libleptris/test/rng/include-cases/ext-main.rng +7 -0
- data/vendor-src/libleptris/test/rng/include-cases/lib.rng +5 -0
- data/vendor-src/libleptris/test/rng/include-cases/lib2.rng +6 -0
- data/vendor-src/libleptris/test/rng/include-cases/main.rng +4 -0
- data/vendor-src/libleptris/test/rng/include-cases/no-href.rng +4 -0
- data/vendor-src/libleptris/test/rng/include-cases/override.rng +8 -0
- data/vendor-src/libleptris/test/rng/include-cases/self-include.rng +4 -0
- data/vendor-src/libleptris/test/rng/include-cases/start-override.rng +5 -0
- data/vendor-src/libleptris/test/rng/jing-cases/000.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/000.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/000.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/001.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/001.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/001.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/002.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/002.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/002.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/003.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/003.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/003.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/004.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/004.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/004.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/005.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/005.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/005.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/006.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/006.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/006.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/007.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/007.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/007.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/008.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/008.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/008.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/009.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/009.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/009.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/010.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/010.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/010.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/011.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/011.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/011.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/012.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/012.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/012.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/013.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/013.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/013.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/014.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/014.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/014.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/015.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/015.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/015.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/016.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/016.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/016.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/017.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/017.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/017.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/018.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/018.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/018.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/019.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/019.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/019.rng +7 -0
- data/vendor-src/libleptris/test/rng/jing-cases/020-book.rng +4 -0
- data/vendor-src/libleptris/test/rng/jing-cases/020.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/020.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/020.rng +3 -0
- data/vendor-src/libleptris/test/rng/jing-cases/README.md +32 -0
- data/vendor-src/libleptris/test/rng/jing-cases/jing-ref.json +212 -0
- data/vendor-src/libleptris/test/rng/jing-cases/meta.json +1 -0
- data/vendor-src/libleptris/test/rng/test_rng.cpp +1365 -0
- data/vendor-src/libleptris/test/rng/test_rng_corpus.cpp +133 -0
- data/vendor-src/libleptris/test/rng/test_rng_corpus_msg.cpp +233 -0
- data/vendor-src/libleptris/test/sax/test_iterparse.cpp +203 -0
- data/vendor-src/libleptris/test/sax/test_pull.cpp +214 -0
- data/vendor-src/libleptris/test/sax/test_pull_batch.cpp +201 -0
- data/vendor-src/libleptris/test/sax/test_recorder.cpp +265 -0
- data/vendor-src/libleptris/test/sax/test_sax.cpp +665 -0
- data/vendor-src/libleptris/test/sax/test_streaming.cpp +434 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/README.md +15 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/extends-baseuri-fixup-01.xml +28 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/extends-recursive-01.xml +27 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/include-baseuri-fixup-01.xml +24 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/include-recursive-01.xml +24 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-name-collision-error-01.xml +20 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-name-collision-error-02.xml +20 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-name-collision-error-03.xml +20 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-name-collision-error-04.xml +23 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-name-collision-error-05.xml +20 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-name-collision-error-06.xml +25 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-pattern-global-01.xml +24 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-01.xml +18 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-02.xml +18 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-03.xml +18 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-04.xml +19 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-05.xml +20 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-06.xml +20 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-07.xml +18 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-rule-global-01.xml +20 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-rule-global-02.xml +23 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-scope-pattern-01.xml +25 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-scope-phase-01.xml +23 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-scope-rule-01.xml +23 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-value-element-content-01.xml +33 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/pattern-abstract-01.xml +22 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/pattern-subordinate-document-01.xml +21 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/pattern-subordinate-document-02.xml +21 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-abstract-01.xml +21 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-abstract-02.xml +23 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-attribute-01.xml +18 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-comment-01.xml +20 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-element-01.xml +18 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-pi-01.xml +20 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-root-01.xml +18 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-text-01.xml +18 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-variable-01.xml +22 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-variable-02.xml +25 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-variable-03.xml +22 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-order-01.xml +21 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/schema-default-phase-01.xml +26 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/schema-default-phase-02.xml +25 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/svrl-diagnostic-01.xml +28 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/svrl-diagnostic-02.xml +25 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/svrl-name-nopath-01.xml +23 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/svrl-name-path-01.xml +23 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/svrl-property-01.xml +28 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/svrl-property-copy-of.xml +26 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/svrl-value-of-01.xml +23 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/xslt-key-01.xml +19 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/xslt-key-element-content-01.xml +21 -0
- data/vendor-src/libleptris/test/sch/test_schematron.cpp +337 -0
- data/vendor-src/libleptris/test/sch/test_schematron_corpus.cpp +421 -0
- data/vendor-src/libleptris/test/serializer/test_c14n.cpp +539 -0
- data/vendor-src/libleptris/test/serializer/test_serialize.cpp +890 -0
- data/vendor-src/libleptris/test/smoke/test_smoke.cpp +41 -0
- data/vendor-src/libleptris/test/xinclude/test_xinclude.cpp +903 -0
- data/vendor-src/libleptris/test/xpath/test_bytecode_vm.cpp +755 -0
- data/vendor-src/libleptris/test/xpath/test_compiled.cpp +171 -0
- data/vendor-src/libleptris/test/xpath/test_exslt.cpp +141 -0
- data/vendor-src/libleptris/test/xpath/test_xpath.cpp +2433 -0
- data/vendor-src/libleptris/test/xpath/test_xpath_conformance.cpp +570 -0
- data/vendor-src/libleptris/test/xpath/test_xslt.cpp +4245 -0
- data/vendor-src/libleptris/test/xquery/books.xml +1 -0
- data/vendor-src/libleptris/test/xquery/qt3/README.md +28 -0
- data/vendor-src/libleptris/test/xquery/qt3/fn/concat.xml +878 -0
- data/vendor-src/libleptris/test/xquery/qt3/fn/contains.xml +795 -0
- data/vendor-src/libleptris/test/xquery/qt3/fn/ends-with.xml +556 -0
- data/vendor-src/libleptris/test/xquery/qt3/fn/starts-with.xml +644 -0
- data/vendor-src/libleptris/test/xquery/qt3/fn/substring/concepts.xml +1 -0
- data/vendor-src/libleptris/test/xquery/qt3/fn/substring.xml +449 -0
- data/vendor-src/libleptris/test/xquery/test_qt3.cpp +324 -0
- data/vendor-src/libleptris/test/xquery/test_xquery.cpp +768 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/ATTRIBUTION.md +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/array.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/array.xml +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/array.xsl +26 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-1-.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-1-.xml +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-1-.xsl +21 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-10-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-10-.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-10-.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-100.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-100.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-100.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-101.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-101.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-101.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-102-inc.xsl +21 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-102.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-102.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-102.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-103.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-103.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-103.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-104.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-104.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-104.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-105.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-105.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-105.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-106.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-106.xml +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-106.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-107.out +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-107.xml +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-107.xsl +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-108.out +25 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-108.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-108.xsl +21 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-109.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-109.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-109.xsl +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-11-.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-11-.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-11-.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-110.ent +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-110.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-110.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-110.xsl +20 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-111.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-111.xml +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-111.xsl +45 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-112.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-112.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-112.xsl +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-113.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-113.xml +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-113.xsl +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-114.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-114.xml +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-114.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-115.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-115.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-115.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-116.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-116.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-116.xsl +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-117.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-117.xml +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-117.xsl +59 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-118.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-118.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-118.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-119.out +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-119.xml +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-119.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-12-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-12-.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-12-.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-120.out +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-120.xml +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-120.xsl +27 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-121.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-121.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-121.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-122.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-122.xml +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-122.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-123.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-123.xml +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-123.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-124.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-124.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-124.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-125.out +351 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-125.xml +118 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-125.xsl +99 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-126.out +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-126.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-126.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-127.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-127.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-127.xsl +18 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-128.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-128.xml +26 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-128.xsl +26 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-129.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-129.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-129.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-13-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-13-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-13-.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130-imp1.imp +25 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130-imp2.imp +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130-imp3.imp +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130-imp4.imp +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130.doc +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130.xsl +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-131-imp.imp +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-131.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-131.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-131.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-132.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-132.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-132.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-133.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-133.xml +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-133.xsl +32 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-134.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-134.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-134.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-135.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-135.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-135.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-136.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-136.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-136.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-137.imp +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-137.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-137.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-137.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-138.out +23 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-138.xml +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-138.xsl +28 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-139.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-139.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-139.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-14-.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-14-.xml +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-14-.xsl +23 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-140.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-140.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-140.xsl +32 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-141.out +46 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-141.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-141.xsl +25 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-142.out +35 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-142.xml +65 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-142.xsl +85 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-143.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-143.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-143.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-144.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-144.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-144.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-145.err +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-145.xml +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-145.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147-1.imp +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147-2.imp +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147-3.imp +57 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147-4.imp +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147-5.imp +27 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147-6.imp +31 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147.out +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147.xml +21 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147.xsl +29 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-148.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-148.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-148.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-149.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-149.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-149.xsl +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-15-.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-15-.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-15-.xsl +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-150.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-150.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-150.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-151.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-151.xsl +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-152.out +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-152.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-152.xsl +30 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-153.doc +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-153.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-153.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-153.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-154.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-154.xsl +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-155.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-155.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-155.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-156.err +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-156.imp1.imp +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-156.imp2.imp +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-156.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-156.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-157.err +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-157.out +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-157.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-157.xsl +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-158.doc +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-158.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-158.xml +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-158.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-159.out +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-159.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-159.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-16-.out +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-16-.xml +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-16-.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-160.out +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-160.xml +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-160.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-161.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-161.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-161.xsl +18 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-163.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-163.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-163.xsl +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-164.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-164.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-164.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-165.err +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-165.xml +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-165.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-166.out +15256 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-166.xml +15255 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-166.xsl +131 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-167.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-167.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-167.xsl +20 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-168.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-168.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-168.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-169.imp +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-169.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-169.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-169.xsl +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-17-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-17-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-17-.xsl +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-170.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-170.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-170.xsl +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-171.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-171.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-171.xsl +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-172.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-172.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-172.xsl +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-173.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-173.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-173.xsl +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-174.err +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-174.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-174.xsl +18 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-175.err +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-175.out +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-175.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-175.xsl +33 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-176.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-176.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-176.xsl +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-177.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-177.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-177.xsl +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-178.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-178.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-178.xsl +18 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-179.out +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-179.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-179.xsl +24 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-18-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-18-.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-18-.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-180.err +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-180.xml +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-180.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-181.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-181.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-181.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-182.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-182.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-182.xsl +21 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-183.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-183.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-183.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-184.err +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-184.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-184.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-186.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-186.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-186.xsl +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-187.err +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-187.out +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-187.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-187.xsl +42 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-188-imp.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-188.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-188.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-188.xsl +20 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-189.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-189.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-189.xsl +25 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-19-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-19-.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-19-.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-190-imp.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-190.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-190.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-190.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-191-imp.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-191.err +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-191.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-191.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-192.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-192.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-192.xsl +33 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-193.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-193.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-193.xsl +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-194.err +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-194.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-194.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-195.out +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-195.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-195.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-196.out +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-196.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-196.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-197.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-197.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-197.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-198.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-198.xml +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-198.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-199.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-199.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-199.xsl +18 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-2-.out +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-2-.xml +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-2-.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-20-.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-20-.xml +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-20-.xsl +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-200.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-200.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-200.xsl +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-201.err +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-201.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-201.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-202.err +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-202.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-202.xsl +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-203.err +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-203.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-203.xsl +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-204.err +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-204.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-204.xsl +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-205.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-205.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-205.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-206.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-206.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-206.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-207.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-207.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-207.xsl +61 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-208.err +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-208.xml +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-208.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-209.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-209.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-209.xsl +21 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-21-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-21-.xml +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-21-.xsl +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-210.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-210.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-210.xsl +20 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-211.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-211.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-211.xsl +26 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-212.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-212.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-212.xsl +25 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-213.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-213.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-213.xsl +26 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-214.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-214.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-214.xsl +25 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-215.err +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-215.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-215.xsl +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-216.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-216.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-216.xsl +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-217.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-217.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-217.xsl +24 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-218.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-218.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-218.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-219.out +68 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-219.xml +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-219.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-22-.out +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-22-.xml +18 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-22-.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-220.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-220.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-220.xsl +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-221.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-221.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-221.xsl +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-222.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-222.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-222.xsl +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-223-imp.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-223-inc.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-223.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-223.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-223.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-224.out +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-224.xml +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-224.xsl +28 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-225.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-225.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-225.xsl +32 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-23-.out +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-23-.xml +21 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-23-.xsl +20 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-24-.out +27 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-24-.xml +2419 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-24-.xsl +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-25-.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-25-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-25-.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-26-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-26-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-26-.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-27-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-27-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-27-.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-28-.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-28-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-28-.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-29-.ent +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-29-.out +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-29-.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-29-.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-3-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-3-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-3-.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-30-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-30-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-30-.xsl +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-31-.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-31-.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-31-.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-32-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-32-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-32-.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-33-.out +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-33-.xml +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-33-.xsl +29 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-35-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-35-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-35-.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-36-.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-36-.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-36-.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-36-inc.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-37-.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-37-.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-37-.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-37-inc.xsl +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-38-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-38-.xml +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-38-.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-39-.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-39-.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-39-.xsl +34 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-4-.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-4-.xml +38 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-4-.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-40-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-40-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-40-.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-41-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-41-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-41-.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-42-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-42-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-42-.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-43-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-43-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-43-.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-44-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-44-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-44-.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-45-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-45-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-45-.xsl +27 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-46-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-46-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-46-.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-47-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-47-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-47-.xsl +18 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-48-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-48-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-48-.xsl +24 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-49-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-49-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-49-.xsl +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-5-.out +954 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-5-.xml +475 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-5-.xsl +158 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-50-.out +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-50-.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-50-.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-52.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-52.xml +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-52.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-53.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-53.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-53.xsl +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-54.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-54.xml +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-54.xsl +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-55.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-55.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-55.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-56.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-56.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-56.xsl +28 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-57.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-57.xml +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-57.xsl +21 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-58.xsl +274 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-59.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-59.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-59.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-6-.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-6-.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-6-.xsl +32 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-60.err +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-60.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-60.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-60.xsl +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-61.out +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-61.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-61.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-62-inc.xsl +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-62.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-62.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-62.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-63.out +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-63.xml +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-63.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-64.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-64.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-64.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-65.ent +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-65.out +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-65.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-65.xsl +26 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-66.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-66.xml +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-66.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-68.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-68.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-68.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-69.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-69.xml +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-69.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-7-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-7-.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-7-.xsl +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-70.out +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-70.xml +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-70.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-71.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-71.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-71.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-72.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-72.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-72.xsl +31 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-73.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-73.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-73.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-74.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-74.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-74.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-75.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-75.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-75.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-76.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-76.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-76.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-77.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-77.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-77.xsl +18 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-78.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-78.xml +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-78.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-79.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-79.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-79.xsl +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-8-.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-8-.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-8-.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-80.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-80.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-80.xsl +29 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-81.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-81.xml +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-81.xsl +18 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-82.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-82.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-82.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-83.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-83.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-83.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-84.out +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-84.xml +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-84.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-86.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-86.xml +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-86.xsl +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-87.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-87.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-87.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-88.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-88.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-88.xsl +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-89.out +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-89.xml +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-89.xsl +105 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-9-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-9-.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-9-.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-90.out +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-90.xml +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-90.xsl +35 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-91.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-91.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-91.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-92.out +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-92.xml +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-92.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-93-inc.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-93.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-93.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-93.xsl +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-94.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-94.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-94.xsl +35 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-95.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-95.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-95.xsl +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-96.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-96.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-96.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-97.out +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-97.xml +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-97.xsl +32 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-98.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-98.xml +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-98.xsl +31 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-99.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-99.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-99.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/character.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/character.xml +23 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/character.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/date_add.out +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/date_add.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/date_add.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/doc.dtd +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/doc.out +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/doc.xml +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/doc.xsl +62 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/inner.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/items.xml +34 -0
- data/vendor-src/libleptris/test/xslt/open_cases.txt +0 -0
- data/vendor-src/libleptris/test/xslt/test_libxslt_suite.cpp +398 -0
- data/vendor-src/libleptris/vcpkg.json +29 -0
- data/vendor-src/utf8proc/CMakeLists.txt +133 -0
- data/vendor-src/utf8proc/Doxyfile +2765 -0
- data/vendor-src/utf8proc/LICENSE.md +93 -0
- data/vendor-src/utf8proc/MANIFEST +9 -0
- data/vendor-src/utf8proc/Makefile +203 -0
- data/vendor-src/utf8proc/NEWS.md +479 -0
- data/vendor-src/utf8proc/README.md +143 -0
- data/vendor-src/utf8proc/appveyor.yml +46 -0
- data/vendor-src/utf8proc/bench/Makefile +40 -0
- data/vendor-src/utf8proc/bench/bench.c +56 -0
- data/vendor-src/utf8proc/bench/icu.c +61 -0
- data/vendor-src/utf8proc/bench/unistring.c +60 -0
- data/vendor-src/utf8proc/bench/util.c +39 -0
- data/vendor-src/utf8proc/bench/util.h +22 -0
- data/vendor-src/utf8proc/cmake/utf8proc-config.cmake.in +5 -0
- data/vendor-src/utf8proc/data/Makefile +62 -0
- data/vendor-src/utf8proc/data/Manifest.toml +16 -0
- data/vendor-src/utf8proc/data/Project.toml +2 -0
- data/vendor-src/utf8proc/data/data_generator.jl +498 -0
- data/vendor-src/utf8proc/libutf8proc.pc.cmakein +10 -0
- data/vendor-src/utf8proc/libutf8proc.pc.in +10 -0
- data/vendor-src/utf8proc/lump.md +27 -0
- data/vendor-src/utf8proc/test/app/CMakeLists.txt +6 -0
- data/vendor-src/utf8proc/test/app/app.c +9 -0
- data/vendor-src/utf8proc/test/case.c +76 -0
- data/vendor-src/utf8proc/test/charwidth.c +91 -0
- data/vendor-src/utf8proc/test/custom.c +28 -0
- data/vendor-src/utf8proc/test/fuzz_main.c +54 -0
- data/vendor-src/utf8proc/test/fuzzer.c +97 -0
- data/vendor-src/utf8proc/test/graphemetest.c +136 -0
- data/vendor-src/utf8proc/test/iscase.c +63 -0
- data/vendor-src/utf8proc/test/iterate.c +168 -0
- data/vendor-src/utf8proc/test/maxdecomposition.c +22 -0
- data/vendor-src/utf8proc/test/misc.c +51 -0
- data/vendor-src/utf8proc/test/normtest.c +64 -0
- data/vendor-src/utf8proc/test/ossfuzz.sh +13 -0
- data/vendor-src/utf8proc/test/printproperty.c +68 -0
- data/vendor-src/utf8proc/test/tests.c +60 -0
- data/vendor-src/utf8proc/test/tests.h +27 -0
- data/vendor-src/utf8proc/test/valid.c +41 -0
- data/vendor-src/utf8proc/utf8proc.c +834 -0
- data/vendor-src/utf8proc/utf8proc.h +794 -0
- data/vendor-src/utf8proc/utf8proc_data.c +17141 -0
- data/vendor-src/utf8proc/utils.cmake +20 -0
- metadata +1528 -2
|
@@ -0,0 +1,1935 @@
|
|
|
1
|
+
/* flat/direct_parse.c — Single-pass parse into LeptrisElement tree
|
|
2
|
+
* (TODO 147 Phase A).
|
|
3
|
+
*
|
|
4
|
+
* This is the pugixml-style parser: scan XML once, write LeptrisElement
|
|
5
|
+
* records directly. No FlatDoc intermediate, no promote pass.
|
|
6
|
+
*
|
|
7
|
+
* Key techniques:
|
|
8
|
+
* 1. Upfront bulk allocation: estimate element count, malloc one block
|
|
9
|
+
* 2. Zero-copy names: NUL-terminate in-place in the buffer copy
|
|
10
|
+
* 3. Direct edge wiring: set compact-pointer offsets via pointer
|
|
11
|
+
* arithmetic (no function call, no overflow table)
|
|
12
|
+
* 4. Lookup tables: single-byte char classification (no branch chains)
|
|
13
|
+
* 5. memchr for text scanning: libc vectorized search
|
|
14
|
+
*
|
|
15
|
+
* The parser handles: elements (open/close/self-closing), attributes
|
|
16
|
+
* (single+double quoted), text, comments, CDATA, PIs, XML declaration,
|
|
17
|
+
* DOCTYPE skipping, BOM. Namespace-aware: splits prefix:local names,
|
|
18
|
+
* moves xmlns declarations to elem->namespaces.
|
|
19
|
+
*
|
|
20
|
+
* For inputs the direct parser can't handle (DTD internal subset with
|
|
21
|
+
* entities), the caller falls back to flat_parse + promote.
|
|
22
|
+
*/
|
|
23
|
+
#include "direct_parse.h"
|
|
24
|
+
#include "../memory/arena.h"
|
|
25
|
+
#include "../dom/element.h"
|
|
26
|
+
#include "../dom/root_doc_map.h"
|
|
27
|
+
#include "../dom/text.h"
|
|
28
|
+
#include "../dom/comment.h"
|
|
29
|
+
#include "../dom/cdata.h"
|
|
30
|
+
#include "../dom/pi.h"
|
|
31
|
+
#include "../dom/entity_ref.h"
|
|
32
|
+
#include "../dom/doctype.h"
|
|
33
|
+
#include "../common/string_view.h"
|
|
34
|
+
#include "../common/chartype.h"
|
|
35
|
+
#include "../common/entities.h"
|
|
36
|
+
#include "../common/port.h"
|
|
37
|
+
#include "../common/simd_text.h"
|
|
38
|
+
#include "../dtd/model.h"
|
|
39
|
+
|
|
40
|
+
#include <string.h>
|
|
41
|
+
#include <stdlib.h>
|
|
42
|
+
#include <stdio.h>
|
|
43
|
+
|
|
44
|
+
extern LEPTRIS_THREAD_LOCAL int g_leptris_strict_mode;
|
|
45
|
+
extern void leptris_compact_set_current_document(struct leptris_document* doc);
|
|
46
|
+
int leptris_element_add_namespace(struct leptris_element* elem,
|
|
47
|
+
struct leptris_namespace* ns);
|
|
48
|
+
|
|
49
|
+
#define DP_MAX_DEPTH 256
|
|
50
|
+
|
|
51
|
+
/* #1125 immutable buffer: the parser scans a scratch COPY of the
|
|
52
|
+
* input — NUL-terminating names/values in place, exactly as the
|
|
53
|
+
* zero-copy path always did — while doc->xml_buffer keeps a pristine
|
|
54
|
+
* copy of the input, byte-identical by construction. Views point
|
|
55
|
+
* into the scratch (document-owned, freed at leptris_document_free),
|
|
56
|
+
* so no restore log and no per-string materialization exist. The
|
|
57
|
+
* cost is one bulk memcpy of the document instead of a log entry
|
|
58
|
+
* plus a pool copy per borrowed string. */
|
|
59
|
+
|
|
60
|
+
typedef struct {
|
|
61
|
+
char* buf;
|
|
62
|
+
char* pos;
|
|
63
|
+
char* end;
|
|
64
|
+
LeptrisMemoryPool* pool;
|
|
65
|
+
struct leptris_document* doc;
|
|
66
|
+
LeptrisElement open_stack[DP_MAX_DEPTH];
|
|
67
|
+
/* TODO 155 Phase C: per-depth last-child cache. Replaces the
|
|
68
|
+
* last_child_off field on element. last_child_stack[i] holds
|
|
69
|
+
* the most recently wired child of open_stack[i], or NULL when
|
|
70
|
+
* no child has been wired yet at that depth. */
|
|
71
|
+
LeptrisNode* last_child_stack[DP_MAX_DEPTH];
|
|
72
|
+
int depth;
|
|
73
|
+
LeptrisElement root;
|
|
74
|
+
/* Document children (issue #580): [prolog..., root, epilog...]
|
|
75
|
+
* as ONE node chain in document order — the document node's
|
|
76
|
+
* child list. root_chained moves the root element into the
|
|
77
|
+
* chain at the first epilog capture (or at finalize). */
|
|
78
|
+
LeptrisNode* dc_head;
|
|
79
|
+
LeptrisNode* dc_tail;
|
|
80
|
+
int root_chained;
|
|
81
|
+
/* XML declaration fields */
|
|
82
|
+
char* version;
|
|
83
|
+
char* encoding;
|
|
84
|
+
int standalone;
|
|
85
|
+
/* Source line tracking (issue #223). Updated as the scanner
|
|
86
|
+
* crosses '\n' bytes. Frozen into each node at creation. */
|
|
87
|
+
/* Line tracking is LAZY (issue #223 follow-up): parse stores
|
|
88
|
+
* byteOffset+1 in node->base.line and leptris_node_line resolves
|
|
89
|
+
* it against doc->xml_buffer on first query (doc-level newline
|
|
90
|
+
* table, binary search, cached in-place). The per-byte '
|
|
91
|
+
'
|
|
92
|
+
* compares this removed were ~30% of text-heavy parse. 0 for
|
|
93
|
+
* documents >= 2 GiB (offsets don't fit; line reads return
|
|
94
|
+
* unknown, matching the pre-#223 behavior). */
|
|
95
|
+
int line_offsets_ok;
|
|
96
|
+
int had_declaration;
|
|
97
|
+
/* Bulk-allocated attribute block. Pre-allocated from pool so the
|
|
98
|
+
* common case is a bump-pointer off the block — no per-attr
|
|
99
|
+
* pool_alloc, no name interning, no value pool_strdup. Overflow
|
|
100
|
+
* falls back to per-attr pool_alloc. */
|
|
101
|
+
struct leptris_attribute* attr_block;
|
|
102
|
+
size_t attr_idx;
|
|
103
|
+
size_t attr_capacity;
|
|
104
|
+
/* Attr-diet fields: a running cursor replaces the per-attr
|
|
105
|
+
* `&block[idx++]` multiply (48-byte stride), and the parser-local
|
|
106
|
+
* counter replaces the per-attr elem->attr_count load-add-store
|
|
107
|
+
* (the element cache line only needs touching twice per tag). */
|
|
108
|
+
struct leptris_attribute* attr_cursor;
|
|
109
|
+
struct leptris_attribute* attr_end;
|
|
110
|
+
/* Bulk text-node block (round 8): leptris_text_create_borrowed
|
|
111
|
+
* is an out-of-line call per text node — pool_alloc alone costs
|
|
112
|
+
* more than the field stores. Same carve pattern as the elem and
|
|
113
|
+
* attr blocks. Overflow falls back to the pool path. */
|
|
114
|
+
struct leptris_text_node* text_cursor;
|
|
115
|
+
struct leptris_text_node* text_end;
|
|
116
|
+
/* Comment/CDATA/PI bulk block (#450 endgame): carved from the
|
|
117
|
+
* same combined allocation as elem/text so sibling and parent
|
|
118
|
+
* edges stay intra-block (raw int32, < 2 GB). The per-node
|
|
119
|
+
* pool allocations these types previously used land in a
|
|
120
|
+
* different malloc REGION than the arena on macOS — distances
|
|
121
|
+
* beyond ±2 GB that no compact edge can hold raw. Overflow
|
|
122
|
+
* falls back to the pool path whose setters route far links
|
|
123
|
+
* through the overflow table. */
|
|
124
|
+
char* cpi_cursor;
|
|
125
|
+
char* cpi_end;
|
|
126
|
+
size_t cpi_stride;
|
|
127
|
+
unsigned cur_attr_count;
|
|
128
|
+
/* 1 when the parser owns an over-allocated copy: probe windows
|
|
129
|
+
* may read up to 48 bytes past p->end because the 64-byte zeroed
|
|
130
|
+
* slack after the sentinel stops them (NUL matches neither quote
|
|
131
|
+
* nor '&', and the bounded memchr fallback re-checks). 0 for
|
|
132
|
+
* in-place parses on caller buffers — clamped windows only. */
|
|
133
|
+
int probe_slack;
|
|
134
|
+
/* LEPTRIS_PARSE_DROP_WS_TEXT: skip creating nodes for
|
|
135
|
+
* whitespace-only text runs (pugixml-default semantics). */
|
|
136
|
+
int drop_ws_text;
|
|
137
|
+
/* LEPTRIS_PARSE_KEEP_ENTITY_REFS (#1094): keep &name; references
|
|
138
|
+
* as ENTITY_REF nodes; text runs split around them. Character
|
|
139
|
+
* references (&#...;) still expand — they are not entities. */
|
|
140
|
+
int keep_entity_refs;
|
|
141
|
+
/* TODO 159 Phase G: parser-local last-attr cache for the element
|
|
142
|
+
* currently being parsed. Eliminates the O(N) walk-to-find-tail
|
|
143
|
+
* in dp_add_attr_inline — O(1) wiring per attr instead of O(N),
|
|
144
|
+
* removing the O(N²) per-element-attrs cost. Reset to NULL at
|
|
145
|
+
* the start of each dp_parse_attrs call.
|
|
146
|
+
*
|
|
147
|
+
* Also caches the last xmlns ns-node for the same reason — the
|
|
148
|
+
* old code walked the ns list to find the tail on every xmlns. */
|
|
149
|
+
struct leptris_attribute* current_elem_last_attr;
|
|
150
|
+
struct leptris_namespace* current_elem_last_ns;
|
|
151
|
+
int saw_namespace; /* any xmlns seen → doc->has_namespaces */
|
|
152
|
+
/* Raw-view bulk block (issue #635 perf, pugixml race): raw-attr
|
|
153
|
+
* entries carved from 128-entry pool chunks — one bump per attr,
|
|
154
|
+
* no per-attr pool_alloc, no tail walk. raw_last is the current
|
|
155
|
+
* element's chain tail; reset at dp_parse_attrs start like
|
|
156
|
+
* current_elem_last_attr. */
|
|
157
|
+
struct leptris_raw_attr* raw_cursor;
|
|
158
|
+
struct leptris_raw_attr* raw_end;
|
|
159
|
+
struct leptris_raw_attr* raw_last;
|
|
160
|
+
struct leptris_ns_cache* nsc_cursor;
|
|
161
|
+
struct leptris_ns_cache* nsc_end;
|
|
162
|
+
/* DTD parsed from the DOCTYPE internal subset. NULL when the
|
|
163
|
+
* document has no DTD (or only an external subset). When non-NULL,
|
|
164
|
+
* text/attr entity expansion routes through
|
|
165
|
+
* leptris_decode_entities_view_with_dtd so custom entities
|
|
166
|
+
* (&foo; where foo is declared in the DTD) resolve correctly. */
|
|
167
|
+
LeptrisDTD* dtd;
|
|
168
|
+
} DParser;
|
|
169
|
+
|
|
170
|
+
/* ---- #1125: immutable-buffer logs --------------------------------
|
|
171
|
+
*
|
|
172
|
+
* The zero-copy parse NUL-terminates names/values in place. To keep
|
|
173
|
+
* doc->xml_buffer byte-identical to the input, every in-place NUL is
|
|
174
|
+
* logged with its original byte (restore), and every borrowed string
|
|
175
|
+
* that relies on that NUL is logged for pool materialization (mat).
|
|
176
|
+
* On success dp_logs_replay materializes the strings into pool
|
|
177
|
+
* storage, repoints the owning fields, and restores the bytes. */
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
/* In-place NUL on the scratch copy — free, no bookkeeping: the
|
|
182
|
+
* scratch is never restored, and views into it live as long as the
|
|
183
|
+
* document. Kept as a helper so NUL sites read uniformly. */
|
|
184
|
+
static inline int dp_nul(DParser* p, char* at) {
|
|
185
|
+
(void)p;
|
|
186
|
+
*at = '\0';
|
|
187
|
+
return 0;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
static inline void dp_skip_ws(DParser* p) {
|
|
191
|
+
/* Sentinel-terminated (parse endgame): the parse buffer always
|
|
192
|
+
* carries a NUL at buf[len] (copy and in-place entries both
|
|
193
|
+
* write it), and NUL classifies as no chartype — the bounds
|
|
194
|
+
* check per byte was the pugixml delta this loop can drop. */
|
|
195
|
+
while (IS_WS(*p->pos)) p->pos++;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* Phase B (TODO 166): name-char scan helper.
|
|
199
|
+
*
|
|
200
|
+
* Originally prototyped a 4-byte ASCII fast path
|
|
201
|
+
* (`(w & 0x80808080u) == 0` guard + 4 IS_NAME_CHAR checks per
|
|
202
|
+
* iteration). On the many-attrs benchmark (avg attr-name length
|
|
203
|
+
* 7), the fast path added MORE work per 4 chars than the byte
|
|
204
|
+
* loop saved: the memcpy + mask check + 4 byte extractions cost
|
|
205
|
+
* more than 4 byte loads, while modern branch predictors already
|
|
206
|
+
* make the byte loop nearly free. Measured ~25% regression at
|
|
207
|
+
* K=50 attrs/element. Reverted to the plain byte loop.
|
|
208
|
+
*
|
|
209
|
+
* Kept as a thin LEPTRIS_ALWAYS_INLINE wrapper — preserves the
|
|
210
|
+
* call-site DRY (six name-scan loops collapse to one helper)
|
|
211
|
+
* and guarantees no call-site regression vs the original
|
|
212
|
+
* inline loop. */
|
|
213
|
+
#if defined(__GNUC__)
|
|
214
|
+
# define DP_UNLIKELY(x) __builtin_expect(!!(x), 0)
|
|
215
|
+
#else
|
|
216
|
+
# define DP_UNLIKELY(x) (x)
|
|
217
|
+
#endif
|
|
218
|
+
/* Sentinel-terminated + 4x-unrolled byte loads (parse endgame):
|
|
219
|
+
* pugixml's SCANWHILE_UNROLL shape, never tested here — the earlier
|
|
220
|
+
* failed fast path was SWAR (mask setup dominated short names);
|
|
221
|
+
* this one keeps plain byte loads and only amortizes the loop
|
|
222
|
+
* counter and exits via unlikely hints. NUL stops the scan. */
|
|
223
|
+
static LEPTRIS_ALWAYS_INLINE void dp_scan_name_p(char** pos) {
|
|
224
|
+
char* s = *pos;
|
|
225
|
+
for (;;) {
|
|
226
|
+
char c = s[0];
|
|
227
|
+
if (DP_UNLIKELY(!IS_NAME_CHAR(c))) break;
|
|
228
|
+
c = s[1];
|
|
229
|
+
if (DP_UNLIKELY(!IS_NAME_CHAR(c))) { s += 1; break; }
|
|
230
|
+
c = s[2];
|
|
231
|
+
if (DP_UNLIKELY(!IS_NAME_CHAR(c))) { s += 2; break; }
|
|
232
|
+
c = s[3];
|
|
233
|
+
if (DP_UNLIKELY(!IS_NAME_CHAR(c))) { s += 3; break; }
|
|
234
|
+
s += 4;
|
|
235
|
+
}
|
|
236
|
+
*pos = s;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
static LEPTRIS_ALWAYS_INLINE void dp_scan_name(DParser* p) {
|
|
240
|
+
dp_scan_name_p(&p->pos);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/* Compile-time offset tables for next_sibling and parent_off
|
|
244
|
+
* across all node types. Eliminates the type-dispatched switch in
|
|
245
|
+
* dp_wire_child — one array lookup + one store replaces 5-way branch.
|
|
246
|
+
* TODO 158: branchless tree wiring.
|
|
247
|
+
*
|
|
248
|
+
* (#450) ALL node types use unscaled int32 sibling edges — every
|
|
249
|
+
* compact-encoding range assumption broke at document scale; the
|
|
250
|
+
* uniform encoding removes the overflow table from the parse path. */
|
|
251
|
+
static const size_t dp_ns_off_int32[6] = {
|
|
252
|
+
offsetof(struct leptris_element, next_sibling_off),
|
|
253
|
+
offsetof(LeptrisTextNode, next_sibling_off),
|
|
254
|
+
offsetof(LeptrisCommentNode, next_sibling_off),
|
|
255
|
+
offsetof(LeptrisCDATANode, next_sibling_off),
|
|
256
|
+
offsetof(LeptrisPINode, next_sibling_off),
|
|
257
|
+
offsetof(LeptrisEntityRefNode, next_sibling_off),
|
|
258
|
+
};
|
|
259
|
+
static const size_t dp_par_off[6] = {
|
|
260
|
+
offsetof(struct leptris_element, parent_off),
|
|
261
|
+
offsetof(LeptrisTextNode, parent_off),
|
|
262
|
+
offsetof(LeptrisCommentNode, parent_off),
|
|
263
|
+
offsetof(LeptrisCDATANode, parent_off),
|
|
264
|
+
offsetof(LeptrisPINode, parent_off),
|
|
265
|
+
offsetof(LeptrisEntityRefNode, parent_off),
|
|
266
|
+
};
|
|
267
|
+
/* LeptrisNodeKind → table index: 0-4 identity, ENTITY_REF (10) → 5,
|
|
268
|
+
* anything else → 6 (out of range, no edge). */
|
|
269
|
+
static inline unsigned dp_edge_idx(unsigned t) {
|
|
270
|
+
return t <= 4u ? t : (t == 10u ? 5u : 6u);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/* Wire child into parent's child chain. Uses compile-time offset
|
|
274
|
+
* tables for branchless type dispatch — no switch, no branch predict.
|
|
275
|
+
* Edge encoding goes through leptris_compact_int32_encode_inline
|
|
276
|
+
* (compact.h): #450 guarantees parse-created nodes live in the
|
|
277
|
+
* combined arena-backed block, so the delta is a plain inlined
|
|
278
|
+
* subtraction; documents beyond the 2 GiB window take the shared
|
|
279
|
+
* encoder's overflow-table path. */
|
|
280
|
+
static inline void dp_wire_child(DParser* p, LeptrisElement parent,
|
|
281
|
+
LeptrisNode* child) {
|
|
282
|
+
unsigned ti = dp_edge_idx((unsigned)child->type);
|
|
283
|
+
if (ti < 6) {
|
|
284
|
+
int32_t* par_field =
|
|
285
|
+
(int32_t*)((char*)child + dp_par_off[ti]);
|
|
286
|
+
*par_field = leptris_compact_int32_encode_inline(
|
|
287
|
+
child, parent, par_field);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
LeptrisNode* prev_last = p->last_child_stack[p->depth - 1];
|
|
291
|
+
if (prev_last) {
|
|
292
|
+
unsigned pi = dp_edge_idx((unsigned)prev_last->type);
|
|
293
|
+
if (pi < 6) {
|
|
294
|
+
/* All sibling edges: unscaled int32 byte offsets (#450 —
|
|
295
|
+
* cp16 ranges cannot hold cross-block sibling links on
|
|
296
|
+
* large documents). */
|
|
297
|
+
int32_t* sib_field =
|
|
298
|
+
(int32_t*)((char*)prev_last + dp_ns_off_int32[pi]);
|
|
299
|
+
*sib_field = leptris_compact_int32_encode_inline(
|
|
300
|
+
prev_last, child, sib_field);
|
|
301
|
+
}
|
|
302
|
+
} else {
|
|
303
|
+
parent->first_child_off = leptris_compact_int32_encode_inline(
|
|
304
|
+
parent, child, &parent->first_child_off);
|
|
305
|
+
}
|
|
306
|
+
p->last_child_stack[p->depth - 1] = child;
|
|
307
|
+
|
|
308
|
+
if (child->type == LEPTRIS_NODE_TYPE_ELEMENT) {
|
|
309
|
+
parent->child_count++;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/* Append a node to the document-child chain (issue #580). The first
|
|
314
|
+
* epilog capture moves the root element into the chain between the
|
|
315
|
+
* prolog nodes and everything that follows. */
|
|
316
|
+
static LEPTRIS_ALWAYS_INLINE void dp_doc_child(DParser* p, LeptrisNode* n) {
|
|
317
|
+
/* #612: document linkage — the #526 setters resolve the owning
|
|
318
|
+
* document through owner_doc; parse-created doc-level nodes
|
|
319
|
+
* must carry it exactly like leptris_pi_node_create ones. */
|
|
320
|
+
if (n && n->type == LEPTRIS_NODE_TYPE_PI)
|
|
321
|
+
((LeptrisPINode*)n)->owner_doc = p->doc;
|
|
322
|
+
else if (n && n->type == LEPTRIS_NODE_TYPE_COMMENT)
|
|
323
|
+
((LeptrisCommentNode*)n)->owner_doc = p->doc;
|
|
324
|
+
if (!p->root_chained && p->root) {
|
|
325
|
+
LeptrisNode* rn = (LeptrisNode*)p->root;
|
|
326
|
+
if (p->dc_tail) leptris_node_set_next_sibling(p->dc_tail, rn);
|
|
327
|
+
else p->dc_head = rn;
|
|
328
|
+
p->dc_tail = rn;
|
|
329
|
+
p->root_chained = 1;
|
|
330
|
+
}
|
|
331
|
+
if (p->dc_tail) leptris_node_set_next_sibling(p->dc_tail, n);
|
|
332
|
+
else p->dc_head = n;
|
|
333
|
+
p->dc_tail = n;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/* Inline attribute allocation. Takes the next slot from the
|
|
337
|
+
* pre-allocated attr_block (bump pointer) when capacity remains,
|
|
338
|
+
* else falls back to a per-attr pool_alloc. Both name and value
|
|
339
|
+
* are zero-copy pointers into the buffer copy (already NUL-
|
|
340
|
+
* terminated in-place by the caller). Skips name interning and
|
|
341
|
+
* value pool_strdup entirely — direct_parse path excludes entity
|
|
342
|
+
* inputs, so has_entities is always 0. */
|
|
343
|
+
static inline int dp_add_attr_inline(DParser* p, LeptrisElement elem,
|
|
344
|
+
char* name, size_t name_len,
|
|
345
|
+
char* val, size_t val_len,
|
|
346
|
+
int has_amp, int has_ws,
|
|
347
|
+
const char* name_colon) {
|
|
348
|
+
/* Attribute-value normalization (XML 1.0 §3.3.3, issue #576):
|
|
349
|
+
* each literal tab/LF/CR in a CDATA attribute becomes a single
|
|
350
|
+
* space. Character references (	) are ASCII text here —
|
|
351
|
+
* untouched by the replacement, so they expand later as literal
|
|
352
|
+
* whitespace, exactly as the spec requires. Clean values keep
|
|
353
|
+
* the zero-copy view; only affected values pay the pool copy. */
|
|
354
|
+
if (has_ws) {
|
|
355
|
+
char* norm = (char*)leptris_pool_alloc(p->pool, val_len + 1);
|
|
356
|
+
if (!norm) return -1;
|
|
357
|
+
for (size_t i = 0; i < val_len; i++) {
|
|
358
|
+
char ch = val[i];
|
|
359
|
+
norm[i] = (ch == '\t' || ch == '\n' || ch == '\r')
|
|
360
|
+
? ' ' : ch;
|
|
361
|
+
}
|
|
362
|
+
norm[val_len] = '\0';
|
|
363
|
+
val = norm;
|
|
364
|
+
}
|
|
365
|
+
struct leptris_attribute* attr = p->attr_cursor;
|
|
366
|
+
if (DP_UNLIKELY(attr >= p->attr_end)) {
|
|
367
|
+
attr = (struct leptris_attribute*)leptris_pool_alloc(
|
|
368
|
+
p->pool, sizeof(struct leptris_attribute));
|
|
369
|
+
if (!attr) return -1;
|
|
370
|
+
} else {
|
|
371
|
+
p->attr_cursor = attr + 1;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
attr->name_view = leptris_sv_from_ptr(name, name_len);
|
|
375
|
+
leptris_attr_value_set_heap(attr, leptris_sv_from_ptr(val, val_len));
|
|
376
|
+
/* #1125: the name NUL (at name_end) and the value NUL (at the
|
|
377
|
+
* closing quote) get restored after parse — both views must
|
|
378
|
+
* materialize. The normalized/entity-expanded replacements below
|
|
379
|
+
* overwrite the value view; only the survivor pays the copy. */
|
|
380
|
+
/* Round 19 packed tail: single name_hash store carries both the
|
|
381
|
+
* lazy-hash sentinel (0) and the entity flag (bit 15). Entity
|
|
382
|
+
* routing (has_amp from the caller's fused scan):
|
|
383
|
+
* - DTD present: eagerly expand; the owned pool copy REPLACES
|
|
384
|
+
* the view, entities=0.
|
|
385
|
+
* - No DTD: view stays raw, entities=1 — accessors expand
|
|
386
|
+
* predefined entities lazily on first read.
|
|
387
|
+
* - No '&': nothing to do. */
|
|
388
|
+
unsigned ent = 0;
|
|
389
|
+
if (val_len > 0 && has_amp) {
|
|
390
|
+
if (p->dtd) {
|
|
391
|
+
LeptrisStringView dsv = leptris_sv_from_ptr(val, val_len);
|
|
392
|
+
char* expanded = leptris_decode_entities_view_with_dtd(
|
|
393
|
+
&dsv, p->dtd, p->pool);
|
|
394
|
+
if (expanded) {
|
|
395
|
+
leptris_attr_value_set_heap(attr, leptris_sv_from_cstr(expanded));
|
|
396
|
+
} else {
|
|
397
|
+
ent = 1;
|
|
398
|
+
}
|
|
399
|
+
} else {
|
|
400
|
+
ent = 1;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
attr->name_hash = (uint16_t)(ent << 15);
|
|
404
|
+
attr->ns_cache_off = 0; /* TODO 173: side cache allocated on demand */
|
|
405
|
+
/* #542 fused into the parse loop (was the post-loop
|
|
406
|
+
* dp_stamp_attr_owners pass): a prefixed attr name gets its
|
|
407
|
+
* ns side-cache HERE — owner stamped, prefix materialized from
|
|
408
|
+
* the just-scanned name. Per-attr independent; order within the
|
|
409
|
+
* element is irrelevant. Unprefixed names pay one NULL check. */
|
|
410
|
+
if (name_colon) {
|
|
411
|
+
struct leptris_attr_ns_cache* c =
|
|
412
|
+
(struct leptris_attr_ns_cache*)leptris_pool_alloc(
|
|
413
|
+
p->pool, sizeof(*c));
|
|
414
|
+
if (c) {
|
|
415
|
+
memset(c, 0, sizeof(*c));
|
|
416
|
+
size_t pl = (size_t)(name_colon - name);
|
|
417
|
+
char* pfx = (char*)leptris_pool_alloc(p->pool, pl + 1);
|
|
418
|
+
if (pfx) {
|
|
419
|
+
memcpy(pfx, name, pl);
|
|
420
|
+
pfx[pl] = '\0';
|
|
421
|
+
c->prefix = pfx;
|
|
422
|
+
}
|
|
423
|
+
c->owner_elem = elem;
|
|
424
|
+
attr_set_ns_cache(attr, c);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
/* TODO 183 Phase 5 (TODO 181 Phase D): cp16 sibling edge. Attrs of
|
|
428
|
+
* one element are adjacent attr_block slots (distance ≤ K × 40 B,
|
|
429
|
+
* far inside cp16 range) — direct store, no encoder call on the
|
|
430
|
+
* hot path. The defensive walk below uses the decoder. */
|
|
431
|
+
attr->next_cp = 0;
|
|
432
|
+
|
|
433
|
+
/* Wire attr into elem's attr list. TODO 159 Phase G: use the
|
|
434
|
+
* parser-local last-attr cache for O(1) wiring instead of walking
|
|
435
|
+
* to find the tail (was O(N) per attr, O(N²) per element).
|
|
436
|
+
*
|
|
437
|
+
* Careful: first_attribute_off == 0 means empty list. We can't decode
|
|
438
|
+
* the pointer and check for NULL — at offset 0 the decoded pointer
|
|
439
|
+
* is `elem` itself, which is non-NULL. Check the offset field. */
|
|
440
|
+
if (elem->first_attribute_off != 0) {
|
|
441
|
+
/* Cache should always be valid mid-parse. Fall back to walk
|
|
442
|
+
* only if cache is NULL (defensive — shouldn't happen). */
|
|
443
|
+
struct leptris_attribute* tail = p->current_elem_last_attr;
|
|
444
|
+
if (tail) {
|
|
445
|
+
/* Same-element attrs are adjacent block slots — direct
|
|
446
|
+
* cp16 store, no encoder call (TODO 183 Phase 5). */
|
|
447
|
+
tail->next_cp = (int16_t)(((char*)attr - (char*)tail) >> 3);
|
|
448
|
+
} else {
|
|
449
|
+
tail = (struct leptris_attribute*)((char*)elem + elem->first_attribute_off);
|
|
450
|
+
while (leptris_attr_next(tail)) tail = leptris_attr_next(tail);
|
|
451
|
+
leptris_attr_set_next(tail, attr);
|
|
452
|
+
}
|
|
453
|
+
} else {
|
|
454
|
+
/* First attr of this element: the only place the elem->attr
|
|
455
|
+
* offset is ever needed. */
|
|
456
|
+
elem->first_attribute_off =
|
|
457
|
+
(int32_t)((char*)attr - (char*)elem);
|
|
458
|
+
}
|
|
459
|
+
p->current_elem_last_attr = attr;
|
|
460
|
+
p->cur_attr_count++;
|
|
461
|
+
return 0;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/* Handle `<!DOCTYPE ...>` markup. Extracted as a cold path
|
|
465
|
+
* (TODO 166 Phase A): runs 0–1 times per document, but the body is
|
|
466
|
+
* ~140 lines including PUBLIC/SYSTEM re-scan, internal-subset
|
|
467
|
+
* extraction, and DTD parsing. Keeping it inline bloats the hot
|
|
468
|
+
* parse loop's i-cache footprint for no benefit.
|
|
469
|
+
*
|
|
470
|
+
* Returns:
|
|
471
|
+
* 0 — handled, caller should `continue` the parse loop.
|
|
472
|
+
* -1 — parse error, caller should fail. */
|
|
473
|
+
/* Takes the parser STATE PIECES, never &p: one &DParser escape
|
|
474
|
+
* anywhere in direct_parse_internal keeps the whole 4 KB state
|
|
475
|
+
* struct memory-resident (no SROA/register promotion) for the entire
|
|
476
|
+
* loop — every p.pos/p.depth/p.end access reloaded from the stack
|
|
477
|
+
* each iteration. pos_io/dtd_io point at the CALLER's local scalars,
|
|
478
|
+
* which sync into p around the call. */
|
|
479
|
+
static LEPTRIS_NOINLINE int dp_parse_doctype(char** pos_io, char* end,
|
|
480
|
+
LeptrisMemoryPool* pool,
|
|
481
|
+
struct leptris_document* doc,
|
|
482
|
+
LeptrisDTD** dtd_io) {
|
|
483
|
+
char* pos = *pos_io;
|
|
484
|
+
LeptrisDTD* dtd = *dtd_io;
|
|
485
|
+
pos += 2; /* skip "<!" */
|
|
486
|
+
/* Match "DOCTYPE" keyword (case-sensitive per XML spec). */
|
|
487
|
+
if (end - pos < 7 ||
|
|
488
|
+
memcmp(pos, "DOCTYPE", 7) != 0) {
|
|
489
|
+
while (pos < end && *pos != '>') pos++;
|
|
490
|
+
if (pos < end) pos++;
|
|
491
|
+
*pos_io = pos;
|
|
492
|
+
return 0;
|
|
493
|
+
}
|
|
494
|
+
pos += 7;
|
|
495
|
+
while (pos < end && IS_WS(*pos)) pos++;
|
|
496
|
+
/* Scan DOCTYPE name. */
|
|
497
|
+
char* dt_name_start = pos;
|
|
498
|
+
dp_scan_name_p(&pos);
|
|
499
|
+
size_t dt_name_len = pos - dt_name_start;
|
|
500
|
+
|
|
501
|
+
/* Skip to '[' (internal subset) or '>' (no subset). */
|
|
502
|
+
char* subset_start = NULL;
|
|
503
|
+
char* subset_end = NULL;
|
|
504
|
+
while (pos < end && *pos != '>' && *pos != '[') {
|
|
505
|
+
pos++;
|
|
506
|
+
}
|
|
507
|
+
if (pos < end && *pos == '[') {
|
|
508
|
+
subset_start = ++pos;
|
|
509
|
+
/* Find matching ']'. Nested brackets aren't legal
|
|
510
|
+
* in DTD internal subsets, so no depth tracking. */
|
|
511
|
+
while (pos < end && *pos != ']') pos++;
|
|
512
|
+
subset_end = pos;
|
|
513
|
+
if (pos < end) pos++; /* skip ']' */
|
|
514
|
+
/* Skip to '>'. */
|
|
515
|
+
while (pos < end && *pos != '>') pos++;
|
|
516
|
+
if (pos < end) pos++; /* skip '>' */
|
|
517
|
+
} else {
|
|
518
|
+
/* No internal subset, skip to '>'. */
|
|
519
|
+
while (pos < end && *pos != '>') pos++;
|
|
520
|
+
if (pos < end) pos++; /* skip '>' */
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
/* Create DOCTYPE node with the extracted name. */
|
|
524
|
+
LeptrisDoctypeNode* dt = NULL;
|
|
525
|
+
if (dt_name_len > 0) {
|
|
526
|
+
dt = leptris_doctype_create(
|
|
527
|
+
dt_name_start, dt_name_len, pool);
|
|
528
|
+
if (dt) {
|
|
529
|
+
doc->doctype = dt;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/* Parse PUBLIC/SYSTEM identifiers (issue #253).
|
|
534
|
+
* DOCTYPE grammar (XML 1.0 §2.8):
|
|
535
|
+
* <!DOCTYPE name (SYSTEM quoted | PUBLIC quoted quoted)? subset?>
|
|
536
|
+
* The keywords and quoted strings sit between the name
|
|
537
|
+
* and the '[' or '>'. We need to re-scan that region
|
|
538
|
+
* because the initial skip above skipped past them
|
|
539
|
+
* without extracting values. */
|
|
540
|
+
/* Re-scan from after the name to find PUBLIC/SYSTEM. */
|
|
541
|
+
char* scan = dt_name_start + dt_name_len;
|
|
542
|
+
/* Skip whitespace after name. */
|
|
543
|
+
while (scan < end && IS_WS(*scan)) scan++;
|
|
544
|
+
char* public_id = NULL;
|
|
545
|
+
size_t public_id_len = 0;
|
|
546
|
+
char* system_id = NULL;
|
|
547
|
+
size_t system_id_len = 0;
|
|
548
|
+
if (scan + 6 <= end && memcmp(scan, "SYSTEM", 6) == 0) {
|
|
549
|
+
scan += 6;
|
|
550
|
+
while (scan < end && IS_WS(*scan)) scan++;
|
|
551
|
+
if (scan < end && (*scan == '"' || *scan == '\'')) {
|
|
552
|
+
char q = *scan++;
|
|
553
|
+
system_id = scan;
|
|
554
|
+
while (scan < end && *scan != q) scan++;
|
|
555
|
+
system_id_len = scan - system_id;
|
|
556
|
+
if (scan < end) scan++; /* skip closing quote */
|
|
557
|
+
}
|
|
558
|
+
} else if (scan + 6 <= end && memcmp(scan, "PUBLIC", 6) == 0) {
|
|
559
|
+
scan += 6;
|
|
560
|
+
while (scan < end && IS_WS(*scan)) scan++;
|
|
561
|
+
/* Public ID (quoted) */
|
|
562
|
+
if (scan < end && (*scan == '"' || *scan == '\'')) {
|
|
563
|
+
char q = *scan++;
|
|
564
|
+
public_id = scan;
|
|
565
|
+
while (scan < end && *scan != q) scan++;
|
|
566
|
+
public_id_len = scan - public_id;
|
|
567
|
+
if (scan < end) scan++; /* skip closing quote */
|
|
568
|
+
}
|
|
569
|
+
/* System ID (quoted, after whitespace) */
|
|
570
|
+
while (scan < end && IS_WS(*scan)) scan++;
|
|
571
|
+
if (scan < end && (*scan == '"' || *scan == '\'')) {
|
|
572
|
+
char q = *scan++;
|
|
573
|
+
system_id = scan;
|
|
574
|
+
while (scan < end && *scan != q) scan++;
|
|
575
|
+
system_id_len = scan - system_id;
|
|
576
|
+
if (scan < end) scan++; /* skip closing quote */
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
/* NUL-terminate and set on the DOCTYPE node. The
|
|
580
|
+
* values point into the mutable buffer copy. */
|
|
581
|
+
if (dt) {
|
|
582
|
+
if (public_id && public_id_len > 0) {
|
|
583
|
+
public_id[public_id_len] = '\0';
|
|
584
|
+
leptris_doctype_set_public_id(dt, public_id, pool);
|
|
585
|
+
}
|
|
586
|
+
if (system_id && system_id_len > 0) {
|
|
587
|
+
system_id[system_id_len] = '\0';
|
|
588
|
+
leptris_doctype_set_system_id(dt, system_id, pool);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
/* Parse internal subset if non-empty — builds the
|
|
593
|
+
* entity table for custom entity expansion, and
|
|
594
|
+
* stores the raw text on the DOCTYPE node so the
|
|
595
|
+
* public API (leptris_doctype_get_internal_subset)
|
|
596
|
+
* returns it (#253). */
|
|
597
|
+
if (subset_start && subset_end > subset_start) {
|
|
598
|
+
/* NUL-terminate the subset text in the buffer. */
|
|
599
|
+
*subset_end = '\0';
|
|
600
|
+
if (dt) {
|
|
601
|
+
leptris_doctype_set_internal_subset(
|
|
602
|
+
dt, subset_start, pool);
|
|
603
|
+
}
|
|
604
|
+
LeptrisDTD* parsed = leptris_dtd_parse_internal_subset(
|
|
605
|
+
subset_start, (size_t)(subset_end - subset_start),
|
|
606
|
+
pool);
|
|
607
|
+
if (parsed) {
|
|
608
|
+
dtd = parsed;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
*pos_io = pos;
|
|
612
|
+
*dtd_io = dtd;
|
|
613
|
+
return 0;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/* Fused prefix split + 16-bit FNV-1a of the local name (TODO 159
|
|
617
|
+
* hash), one bounded walk instead of strchr + a second walk to NUL.
|
|
618
|
+
* ':' resets the hash so it covers exactly the local part.
|
|
619
|
+
*
|
|
620
|
+
* Deliberately noinline: inlining this into the element branch of
|
|
621
|
+
* direct_parse_internal grew the hot attr loop's neighborhood and
|
|
622
|
+
* regressed K=100 by ~1.5% (code layout, not work). Called once
|
|
623
|
+
* per element; the call cost is ~1ns against 51us at K=5. */
|
|
624
|
+
static LEPTRIS_ALWAYS_INLINE int dp_split_hash_name(DParser* p,
|
|
625
|
+
LeptrisElement elem, char* name_start,
|
|
626
|
+
size_t name_len) {
|
|
627
|
+
LeptrisMemoryPool* pool = p->pool;
|
|
628
|
+
char* colon = NULL;
|
|
629
|
+
uint16_t h = 0x811C;
|
|
630
|
+
/* A colon needs prefix (>=1) + ':' + local (>=1) = 3 bytes; 1-2
|
|
631
|
+
* byte names skip the colon test in the walk entirely. */
|
|
632
|
+
const int colon_possible = name_len >= 3;
|
|
633
|
+
for (const char* c = name_start; c < name_start + name_len; c++) {
|
|
634
|
+
if (colon_possible && DP_UNLIKELY(*c == ':')) {
|
|
635
|
+
colon = (char*)c;
|
|
636
|
+
h = 0x811C; /* restart on the local part */
|
|
637
|
+
continue;
|
|
638
|
+
}
|
|
639
|
+
h ^= (unsigned char)*c;
|
|
640
|
+
h *= 0x0193;
|
|
641
|
+
}
|
|
642
|
+
elem->name_hash = h;
|
|
643
|
+
if (colon) {
|
|
644
|
+
*colon = '\0';
|
|
645
|
+
leptris_elem_set_prefix(elem, name_start, pool);
|
|
646
|
+
elem->name = colon + 1;
|
|
647
|
+
size_t local_len = name_len - (size_t)(colon + 1 - name_start);
|
|
648
|
+
elem->name_len = (local_len > 254) ? 0xFF : (uint8_t)local_len;
|
|
649
|
+
|
|
650
|
+
} else {
|
|
651
|
+
elem->name = name_start;
|
|
652
|
+
elem->name_len = (name_len > 254) ? 0xFF : (uint8_t)name_len;
|
|
653
|
+
|
|
654
|
+
}
|
|
655
|
+
return 0;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
/* Parse attributes for an element. Writes attr structs into the
|
|
659
|
+
* pre-allocated attr_block (zero-copy name/value, no interning).
|
|
660
|
+
* Names are NUL-terminated in-place AFTER '=' is consumed; values
|
|
661
|
+
* are NUL-terminated in-place at the closing quote. */
|
|
662
|
+
static int dp_raw_attr(DParser* p, LeptrisElement elem,
|
|
663
|
+
const char* qname, size_t qname_len,
|
|
664
|
+
const char* value, size_t value_len);
|
|
665
|
+
static struct leptris_ns_cache* dp_ensure_cache(DParser* p,
|
|
666
|
+
LeptrisElement elem);
|
|
667
|
+
|
|
668
|
+
static int dp_parse_attrs(DParser* p, LeptrisElement elem) {
|
|
669
|
+
/* Reset the per-element caches so dp_add_attr_inline and the
|
|
670
|
+
* xmlns wiring below can both run in O(1) per attr. */
|
|
671
|
+
p->current_elem_last_attr = NULL;
|
|
672
|
+
p->current_elem_last_ns = NULL;
|
|
673
|
+
p->raw_last = NULL;
|
|
674
|
+
p->cur_attr_count = 0;
|
|
675
|
+
/* Sentinel-terminated (parse endgame, third application): buf[len]
|
|
676
|
+
* is NUL and NUL fails every classification below — not '>', not
|
|
677
|
+
* '/', not '=' , not a quote, not IS_NAME_START. Each former
|
|
678
|
+
* bounds check returned -1 on overrun; the NUL now reaches the
|
|
679
|
+
* same return -1 through the character checks, so the compares
|
|
680
|
+
* were pure overhead (3-4 per attribute). */
|
|
681
|
+
for (;;) {
|
|
682
|
+
dp_skip_ws(p);
|
|
683
|
+
char c = *p->pos;
|
|
684
|
+
if (c == '>' || (c == '/' && p->pos[1] == '>')) {
|
|
685
|
+
int self_close = (c == '/');
|
|
686
|
+
p->pos += self_close ? 2 : 1;
|
|
687
|
+
elem->attr_count = (uint8_t)p->cur_attr_count;
|
|
688
|
+
/* Issue #542: prefixed attrs got their owner-stamped
|
|
689
|
+
* side-cache inline in dp_add_attr_inline. */
|
|
690
|
+
return self_close ? 1 : 0;
|
|
691
|
+
}
|
|
692
|
+
if (c == '/') return -1; /* '/' not followed by '>' */
|
|
693
|
+
|
|
694
|
+
/* Attribute name — scan as (pointer, length), no NUL-term. */
|
|
695
|
+
char* name_start = p->pos;
|
|
696
|
+
if (!IS_NAME_START(*p->pos)) return -1;
|
|
697
|
+
p->pos++;
|
|
698
|
+
dp_scan_name(p);
|
|
699
|
+
char* name_end = p->pos;
|
|
700
|
+
size_t name_len = name_end - name_start;
|
|
701
|
+
/* Prefixed-name probe (fused here; was the post-loop
|
|
702
|
+
* dp_stamp_attr_owners pass): a colon needs prefix + ':'
|
|
703
|
+
* + local = >= 3 bytes, so 1-2 byte names skip entirely.
|
|
704
|
+
* Short names inline (a memchr call costs more than the
|
|
705
|
+
* 2-4 iterations); long names keep memchr. */
|
|
706
|
+
const char* attr_colon = NULL;
|
|
707
|
+
if (name_len >= 3) {
|
|
708
|
+
if (name_len <= 16) {
|
|
709
|
+
for (const char* c9 = name_start; c9 < name_end; c9++) {
|
|
710
|
+
if (*c9 == ':') { attr_colon = c9; break; }
|
|
711
|
+
}
|
|
712
|
+
} else {
|
|
713
|
+
attr_colon =
|
|
714
|
+
(const char*)memchr(name_start, ':', name_len);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
/* Defer NUL-termination until after '=' is consumed — the
|
|
718
|
+
* delimiter byte (whitespace or '=') is needed for the scan. */
|
|
719
|
+
|
|
720
|
+
/* Skip = and whitespace. NUL sentinel fails the '=' test. */
|
|
721
|
+
dp_skip_ws(p);
|
|
722
|
+
if (*p->pos != '=') return -1;
|
|
723
|
+
p->pos++;
|
|
724
|
+
/* '=' consumed — the delimiter byte at name_end is no longer
|
|
725
|
+
* needed. Safe to NUL-terminate the name in-place now. */
|
|
726
|
+
if (dp_nul(p, name_end)) return -1;
|
|
727
|
+
dp_skip_ws(p);
|
|
728
|
+
|
|
729
|
+
/* Quoted value — FUSED scan (TODO 184): one pass finds the
|
|
730
|
+
* closing quote AND flags '&' for entity routing. Replaces
|
|
731
|
+
* quote-memchr + separate amp check (two passes; memchr pays
|
|
732
|
+
* ~10ns setup even on 6-byte values — the TODO 174 finding,
|
|
733
|
+
* applied to the quote scan too).
|
|
734
|
+
*
|
|
735
|
+
* First 48 bytes inline (byte loop beats memchr setup — the
|
|
736
|
+
* common case: values are 5-15 bytes). Longer values fall
|
|
737
|
+
* back to SIMD: memchr for the quote, leptris_text_contains
|
|
738
|
+
* for '&' over the scanned prefix. pugixml's single-table
|
|
739
|
+
* ct_parse_attr loop is the model; this is its shape with a
|
|
740
|
+
* SIMD tail. */
|
|
741
|
+
char quote = *p->pos;
|
|
742
|
+
if (quote != '"' && quote != '\'') return -1; /* NUL sentinel fails */
|
|
743
|
+
p->pos++;
|
|
744
|
+
char* val_start = p->pos;
|
|
745
|
+
int has_amp = 0;
|
|
746
|
+
int has_ws = 0; /* literal \t/\n/\r — §3.3.3 (#576) */
|
|
747
|
+
char* val_end = NULL;
|
|
748
|
+
{
|
|
749
|
+
const char* q = p->pos;
|
|
750
|
+
const char* probe_end = p->probe_slack
|
|
751
|
+
? q + 48
|
|
752
|
+
: ((p->end - q > 48) ? q + 48 : p->end);
|
|
753
|
+
while (q < probe_end) {
|
|
754
|
+
char vch = *q;
|
|
755
|
+
if (vch == quote) { val_end = (char*)q; goto value_done; }
|
|
756
|
+
if (vch == '&') has_amp = 1;
|
|
757
|
+
else if (vch == '\t' || vch == '\n' || vch == '\r')
|
|
758
|
+
has_ws = 1;
|
|
759
|
+
q++;
|
|
760
|
+
}
|
|
761
|
+
if (q >= p->end) return -1; /* unterminated */
|
|
762
|
+
val_end = (char*)memchr(q, quote, p->end - q);
|
|
763
|
+
if (!val_end) return -1;
|
|
764
|
+
if (q < val_end) {
|
|
765
|
+
if (!has_amp &&
|
|
766
|
+
leptris_text_contains(q, (size_t)(val_end - q), '&'))
|
|
767
|
+
has_amp = 1;
|
|
768
|
+
if (!has_ws) {
|
|
769
|
+
for (const char* w = q; w < val_end; w++) {
|
|
770
|
+
if (*w == '\t' || *w == '\n' || *w == '\r') {
|
|
771
|
+
has_ws = 1;
|
|
772
|
+
break;
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
value_done:
|
|
779
|
+
p->pos = val_end;
|
|
780
|
+
if (dp_nul(p, p->pos)) return -1; /* closing quote, not a delimiter */
|
|
781
|
+
size_t val_len = p->pos - val_start;
|
|
782
|
+
p->pos++; /* skip the NUL */
|
|
783
|
+
|
|
784
|
+
/* Check for xmlns. */
|
|
785
|
+
if (name_len >= 5 && name_start[0] == 'x' &&
|
|
786
|
+
name_start[1] == 'm' && name_start[2] == 'l' &&
|
|
787
|
+
name_start[3] == 'n' && name_start[4] == 's') {
|
|
788
|
+
/* xmlns or xmlns:prefix. Name was NUL-terminated at
|
|
789
|
+
* name_end above; value at val_start (closing quote
|
|
790
|
+
* replaced with NUL). For "xmlns:foo" the prefix
|
|
791
|
+
* portion is name_start+6 .. name_end; pool-alloc +
|
|
792
|
+
* memcpy because we can't split the name in-place. */
|
|
793
|
+
const char* ns_prefix = NULL;
|
|
794
|
+
if (name_len > 6) {
|
|
795
|
+
size_t plen = name_len - 6;
|
|
796
|
+
ns_prefix = (char*)leptris_pool_alloc(p->pool, plen + 1);
|
|
797
|
+
if (!ns_prefix) return -1;
|
|
798
|
+
memcpy((void*)ns_prefix, name_start + 6, plen);
|
|
799
|
+
((char*)ns_prefix)[plen] = '\0';
|
|
800
|
+
}
|
|
801
|
+
struct leptris_namespace* ns =
|
|
802
|
+
(struct leptris_namespace*)leptris_pool_alloc(
|
|
803
|
+
p->pool, sizeof(struct leptris_namespace));
|
|
804
|
+
if (!ns) return -1;
|
|
805
|
+
ns->prefix = (char*)ns_prefix;
|
|
806
|
+
ns->uri = val_start; /* already NUL-terminated */
|
|
807
|
+
/* Entity-bearing xmlns values (bug-140: xmlns="&svgns;")
|
|
808
|
+
* expand through the DTD — the raw view must never
|
|
809
|
+
* become a namespace URI. */
|
|
810
|
+
if (has_amp && p->dtd) {
|
|
811
|
+
LeptrisStringView nsv =
|
|
812
|
+
leptris_sv_from_ptr(val_start, val_len);
|
|
813
|
+
char* nuri = leptris_decode_entities_view_with_dtd(
|
|
814
|
+
&nsv, p->dtd, p->pool);
|
|
815
|
+
if (nuri) ns->uri = nuri;
|
|
816
|
+
}
|
|
817
|
+
/* The URI borrows the attr-value bytes in the scratch
|
|
818
|
+
* (NUL-terminated at the closing quote) — no copy. */
|
|
819
|
+
ns->next = NULL;
|
|
820
|
+
/* TODO 155 Phase A: parser has the pool directly; use it
|
|
821
|
+
* to allocate ns_cache without going through the
|
|
822
|
+
* (not-yet-registered) document. */
|
|
823
|
+
struct leptris_ns_cache* ecache = dp_ensure_cache(p, elem);
|
|
824
|
+
if (!ecache) return -1;
|
|
825
|
+
struct leptris_namespace** head_ptr = &ecache->declarations;
|
|
826
|
+
if (!head_ptr) return -1;
|
|
827
|
+
if (!*head_ptr) {
|
|
828
|
+
*head_ptr = ns;
|
|
829
|
+
} else {
|
|
830
|
+
/* TODO 159 Phase G: use cached last-ns pointer for
|
|
831
|
+
* O(1) wiring instead of walking to the tail. */
|
|
832
|
+
struct leptris_namespace* tail = p->current_elem_last_ns;
|
|
833
|
+
if (tail) {
|
|
834
|
+
tail->next = ns;
|
|
835
|
+
} else {
|
|
836
|
+
tail = *head_ptr;
|
|
837
|
+
while (tail->next) tail = tail->next;
|
|
838
|
+
tail->next = ns;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
p->current_elem_last_ns = ns;
|
|
842
|
+
p->saw_namespace = 1;
|
|
843
|
+
if (dp_raw_attr(p, elem, name_start, name_len,
|
|
844
|
+
val_start, val_len) != 0) return -1;
|
|
845
|
+
continue;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
/* Regular attribute — zero-copy name/value, bulk-allocated struct. */
|
|
849
|
+
if (dp_add_attr_inline(p, elem, name_start, name_len,
|
|
850
|
+
val_start, val_len, has_amp, has_ws,
|
|
851
|
+
attr_colon) != 0)
|
|
852
|
+
return -1;
|
|
853
|
+
if (dp_raw_attr(p, elem, name_start, name_len,
|
|
854
|
+
val_start, val_len) != 0) return -1;
|
|
855
|
+
}
|
|
856
|
+
/* for (;;): every exit is a return inside the loop (0 = tag
|
|
857
|
+
* closed, 1 = self-closing, -1 = error) — there is no
|
|
858
|
+
* fallthrough path, so no trailing statement. */
|
|
859
|
+
}
|
|
860
|
+
static struct leptris_ns_cache* dp_ensure_cache(DParser* p,
|
|
861
|
+
LeptrisElement elem) {
|
|
862
|
+
if (elem->ns_cache) return elem->ns_cache;
|
|
863
|
+
struct leptris_ns_cache* c;
|
|
864
|
+
if (p->nsc_cursor < p->nsc_end) {
|
|
865
|
+
c = p->nsc_cursor++;
|
|
866
|
+
} else {
|
|
867
|
+
c = (struct leptris_ns_cache*)leptris_pool_alloc(
|
|
868
|
+
p->pool, 64 * sizeof(struct leptris_ns_cache));
|
|
869
|
+
if (!c) return NULL;
|
|
870
|
+
p->nsc_end = c + 64;
|
|
871
|
+
p->nsc_cursor = c + 1;
|
|
872
|
+
}
|
|
873
|
+
c->prefix = NULL;
|
|
874
|
+
c->namespace_uri = NULL;
|
|
875
|
+
c->declarations = NULL;
|
|
876
|
+
c->raw_attrs = NULL;
|
|
877
|
+
c->doc_next = NULL;
|
|
878
|
+
c->prefix_heap = 0;
|
|
879
|
+
c->uri_heap = 0;
|
|
880
|
+
elem->ns_cache = c;
|
|
881
|
+
return c;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
/* Issue #635: append one raw attribute-view entry (attrs AND xmlns
|
|
885
|
+
* declarations, source order) to the element's cache chain. Entries
|
|
886
|
+
* carve from 128-entry pool chunks (the attr/text block pattern) —
|
|
887
|
+
* one bump per attr, O(1) tail via p->raw_last; the old per-attr
|
|
888
|
+
* pool_alloc + tail walk was the largest single cost of attr-heavy
|
|
889
|
+
* parses (39% of attr-heavy-5k). */
|
|
890
|
+
static int dp_raw_attr(DParser* p, LeptrisElement elem,
|
|
891
|
+
const char* qname, size_t qname_len,
|
|
892
|
+
const char* value, size_t value_len) {
|
|
893
|
+
struct leptris_ns_cache* cache = dp_ensure_cache(p, elem);
|
|
894
|
+
if (!cache) return 0;
|
|
895
|
+
struct leptris_raw_attr* ra;
|
|
896
|
+
if (p->raw_cursor < p->raw_end) {
|
|
897
|
+
ra = p->raw_cursor++;
|
|
898
|
+
} else {
|
|
899
|
+
ra = (struct leptris_raw_attr*)leptris_pool_alloc(
|
|
900
|
+
p->pool, 128 * sizeof(struct leptris_raw_attr));
|
|
901
|
+
if (!ra) return -1;
|
|
902
|
+
p->raw_end = ra + 128;
|
|
903
|
+
p->raw_cursor = ra + 1;
|
|
904
|
+
}
|
|
905
|
+
ra->qname = qname;
|
|
906
|
+
ra->value = value;
|
|
907
|
+
ra->next = NULL;
|
|
908
|
+
if (p->raw_last) {
|
|
909
|
+
p->raw_last->next = ra;
|
|
910
|
+
} else {
|
|
911
|
+
cache->raw_attrs = ra;
|
|
912
|
+
}
|
|
913
|
+
p->raw_last = ra;
|
|
914
|
+
return 0;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
|
|
918
|
+
/* Inline borrowed-text creation from the bulk block (round 8): the
|
|
919
|
+
* same stores leptris_text_create_borrowed performs, minus the
|
|
920
|
+
* out-of-line pool_alloc call per node. */
|
|
921
|
+
/* Carve a comment/CDATA/PI node from the bulk block. Returns a
|
|
922
|
+
* zeroed node with base.type set; callers stamp line/frozen and the
|
|
923
|
+
* content pointers (zero-copy into the document buffer). Returns
|
|
924
|
+
* NULL on exhaustion — callers fall back to the pool constructors. */
|
|
925
|
+
static inline void* dp_cpi_carve(DParser* p, int node_type) {
|
|
926
|
+
if (p->cpi_cursor >= p->cpi_end) return NULL;
|
|
927
|
+
void* n = (void*)p->cpi_cursor;
|
|
928
|
+
p->cpi_cursor += p->cpi_stride;
|
|
929
|
+
memset(n, 0, p->cpi_stride);
|
|
930
|
+
((LeptrisNode*)n)->type = (unsigned char)node_type;
|
|
931
|
+
return n;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
static inline LeptrisTextNode* dp_text_create(DParser* p,
|
|
935
|
+
const char* content,
|
|
936
|
+
size_t content_len) {
|
|
937
|
+
LeptrisTextNode* tn = p->text_cursor;
|
|
938
|
+
if (DP_UNLIKELY(tn >= p->text_end)) {
|
|
939
|
+
/* The lt_count bound under-counts when comments/PIs/CDATA
|
|
940
|
+
* interleave with text (each can split a run, adding one).
|
|
941
|
+
* Grow by arena chunks instead of falling to the out-of-line
|
|
942
|
+
* pool path per node — one bump per 128 nodes. */
|
|
943
|
+
tn = (LeptrisTextNode*)leptris_pool_alloc(
|
|
944
|
+
p->pool, 128 * sizeof(LeptrisTextNode));
|
|
945
|
+
if (!tn) {
|
|
946
|
+
return leptris_text_create_borrowed(content, content_len,
|
|
947
|
+
p->pool);
|
|
948
|
+
}
|
|
949
|
+
p->text_end = tn + 128;
|
|
950
|
+
/* cursor == tn: carve below */
|
|
951
|
+
}
|
|
952
|
+
p->text_cursor = tn + 1;
|
|
953
|
+
tn->base.type = LEPTRIS_NODE_TYPE_TEXT;
|
|
954
|
+
tn->base.frozen = 1; /* parse-created: set here, not after */
|
|
955
|
+
tn->base.version = 0;
|
|
956
|
+
/* #815: the carve skips the memset dp_cpi_carve pays — a dirty
|
|
957
|
+
* recycled pool page left raw set on ~5-7% of churn-parses and
|
|
958
|
+
* serialize_text_internal then emitted text VERBATIM (raw < in
|
|
959
|
+
* the output, invalid XML). */
|
|
960
|
+
tn->base.raw = 0;
|
|
961
|
+
tn->base.binding_wrapper = NULL;
|
|
962
|
+
tn->base.line = 0; /* caller stamps the offset */
|
|
963
|
+
tn->content = (char*)content;
|
|
964
|
+
tn->content_len = content_len;
|
|
965
|
+
tn->pool = p->pool;
|
|
966
|
+
tn->borrowed = 1;
|
|
967
|
+
tn->parent_off = 0;
|
|
968
|
+
tn->next_sibling_off = 0;
|
|
969
|
+
return tn;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
/* Internal: parse from a writable, NUL-terminated buffer.
|
|
973
|
+
* owns_buffer: 1 = document frees buf on leptris_document_free,
|
|
974
|
+
* 0 = caller owns buf (in-place mode). */
|
|
975
|
+
/* owns_buffer values:
|
|
976
|
+
* 0 — caller owns the buf (in-place parse). Don't free.
|
|
977
|
+
* 1 — direct_parse_internal owns the buf via separate malloc.
|
|
978
|
+
* Free on failure; doc->xml_buffer owns it on success.
|
|
979
|
+
* 2 — the input `buf` is const; the parser mallocs its own copy,
|
|
980
|
+
* FUSED with the count3 sizing pre-scan into one pass
|
|
981
|
+
* (TODO 188), then behaves as owns_buffer = 1. The copy
|
|
982
|
+
* lives outside the arena; the document frees it via
|
|
983
|
+
* doc->xml_buffer_needs_free.
|
|
984
|
+
*/
|
|
985
|
+
/* §3.3.2 defaults pass: walk the finished tree; for every default-
|
|
986
|
+
* bearing declaration whose element matches, materialize the value
|
|
987
|
+
* when the element does not carry the attribute. */
|
|
988
|
+
static struct leptris_document* direct_parse_internal(char* buf, size_t len,
|
|
989
|
+
int owns_buffer,
|
|
990
|
+
int drop_ws_text,
|
|
991
|
+
int apply_dtd_attrs,
|
|
992
|
+
int keep_entity_refs) {
|
|
993
|
+
|
|
994
|
+
/* 2. Create arena-backed pool (TODO 183 Phase 3).
|
|
995
|
+
*
|
|
996
|
+
* Content-derived sizing: one cheap pre-scan counts '<' (an upper
|
|
997
|
+
* bound on tags — close tags and '<' in text only over-count, which
|
|
998
|
+
* over-allocates in the safe direction) and quote characters (each
|
|
999
|
+
* attribute value contributes exactly 2, single- or double-quoted).
|
|
1000
|
+
* This sizes the element and attribute blocks to the document's
|
|
1001
|
+
* actual shape instead of a fixed len/10 heuristic — the K=100
|
|
1002
|
+
* many-attrs case (884 bytes/element) no longer over-allocates
|
|
1003
|
+
* attrs 5×, and text-heavy docs reserve room the old est missed.
|
|
1004
|
+
*
|
|
1005
|
+
* One arena replaces the old "single 4 MB-capped first pool page"
|
|
1006
|
+
* trick (#261): there is no page cap, so the bulk elem+attr block
|
|
1007
|
+
* and every text/string/mutation allocation share one contiguous
|
|
1008
|
+
* span. Exhaustion is a hard NULL → parse fails cleanly (pugixml
|
|
1009
|
+
* semantics) instead of scattering a second page megabytes away.
|
|
1010
|
+
*
|
|
1011
|
+
* Slack: len covers all text/name/value copies (they're substrings
|
|
1012
|
+
* of the document), plus len/2 mutation headroom (post-parse
|
|
1013
|
+
* append/set calls allocate from the same arena). */
|
|
1014
|
+
/* TODO 188: fused copy+count. The owns-copy path used to stream
|
|
1015
|
+
* the input TWICE — count3 for arena sizing, then the memcpy
|
|
1016
|
+
* into the pool's buffer copy. Now one kernel copies into a
|
|
1017
|
+
* separately-malloc'd buffer AND produces the three counters
|
|
1018
|
+
* from the same load. The arena no longer carries the copy
|
|
1019
|
+
* (buf_extra = 0 below) and the document owns the malloc via
|
|
1020
|
+
* the owns_buffer = 1 free paths + doc->xml_buffer. In-place
|
|
1021
|
+
* callers (owns_buffer = 0) have no copy to fuse and keep the
|
|
1022
|
+
* plain pre-scan. */
|
|
1023
|
+
size_t lt_count, dq_count, sq_count;
|
|
1024
|
+
/* #1125 scratch design: the scanner NUL-terminates in place, so
|
|
1025
|
+
* it runs on a scratch COPY (+64 zeroed probe slack past the
|
|
1026
|
+
* sentinel — probe windows may read up to 48 bytes past p->end;
|
|
1027
|
+
* zeros stop them, NUL matching neither quote nor '&'), while
|
|
1028
|
+
* doc->xml_buffer keeps a pristine copy, byte-identical to the
|
|
1029
|
+
* input by construction. Views point into the scratch and live
|
|
1030
|
+
* for the document's lifetime. Both buffers come from the
|
|
1031
|
+
* retained-block allocator (arena.c) so parse/free cycles don't
|
|
1032
|
+
* re-fault their pages. */
|
|
1033
|
+
char* pristine;
|
|
1034
|
+
int pristine_owned;
|
|
1035
|
+
if (owns_buffer == 2) {
|
|
1036
|
+
char* scratch = leptris_arena_buffer_alloc(len + 1 + 64);
|
|
1037
|
+
if (!scratch) return NULL;
|
|
1038
|
+
leptris_copy_count3(scratch, buf, len, '<', '"', '\'',
|
|
1039
|
+
<_count, &dq_count, &sq_count);
|
|
1040
|
+
scratch[len] = '\0';
|
|
1041
|
+
memset(scratch + len + 1, 0, 64);
|
|
1042
|
+
pristine = leptris_arena_buffer_alloc(len + 1);
|
|
1043
|
+
if (!pristine) {
|
|
1044
|
+
leptris_arena_buffer_release(scratch, len + 1 + 64);
|
|
1045
|
+
return NULL;
|
|
1046
|
+
}
|
|
1047
|
+
memcpy(pristine, scratch, len); /* scratch is still pristine here */
|
|
1048
|
+
pristine[len] = '\0';
|
|
1049
|
+
pristine_owned = 1;
|
|
1050
|
+
buf = scratch;
|
|
1051
|
+
owns_buffer = 1; /* failure paths release the scratch below */
|
|
1052
|
+
} else {
|
|
1053
|
+
leptris_text_count3(buf, len, '<', '"', '\'',
|
|
1054
|
+
<_count, &dq_count, &sq_count);
|
|
1055
|
+
pristine = buf; /* caller's buffer — never written, never freed */
|
|
1056
|
+
pristine_owned = 0;
|
|
1057
|
+
char* scratch = leptris_arena_buffer_alloc(len + 1 + 64);
|
|
1058
|
+
if (!scratch) return NULL;
|
|
1059
|
+
memcpy(scratch, buf, len);
|
|
1060
|
+
scratch[len] = '\0';
|
|
1061
|
+
memset(scratch + len + 1, 0, 64);
|
|
1062
|
+
buf = scratch;
|
|
1063
|
+
owns_buffer = 1;
|
|
1064
|
+
}
|
|
1065
|
+
size_t quote_count = dq_count + sq_count;
|
|
1066
|
+
size_t est_elems = lt_count + 8;
|
|
1067
|
+
#define DP_ELEM_CHUNK 64u
|
|
1068
|
+
size_t elem_bytes = est_elems * sizeof(struct leptris_element);
|
|
1069
|
+
/* Chunked zeroing over-allocation: elements are zeroed 64 at a
|
|
1070
|
+
* time as the carve cursor advances (see the carve site), so the
|
|
1071
|
+
* final chunk's memset may run past the last used element — up to
|
|
1072
|
+
* one chunk past est_elems. */
|
|
1073
|
+
size_t elem_pad = DP_ELEM_CHUNK * sizeof(struct leptris_element);
|
|
1074
|
+
size_t attr_bytes = (quote_count / 2 + 64) * sizeof(struct leptris_attribute);
|
|
1075
|
+
/* len bounds all text/name/value content copies (substrings of the
|
|
1076
|
+
* document), but each text/comment NODE costs ~48-56 B of struct
|
|
1077
|
+
* overhead regardless of content length — one per element on
|
|
1078
|
+
* mixed-content docs, ~2x the per-item markup. Bound it per
|
|
1079
|
+
* element (CI catch: a 134 KB item-heavy doc exhausted the arena
|
|
1080
|
+
* at item 4144/5000 with 38 bytes left when this term was
|
|
1081
|
+
* missing). */
|
|
1082
|
+
size_t node_overhead = est_elems * 64;
|
|
1083
|
+
size_t text_room = len + node_overhead;
|
|
1084
|
+
size_t slack = len / 2 + 64 * 1024; /* mutation headroom + floor */
|
|
1085
|
+
size_t arena_size = elem_bytes + elem_pad + attr_bytes + text_room + slack;
|
|
1086
|
+
LeptrisArena* arena = leptris_arena_create(arena_size);
|
|
1087
|
+
if (!arena) {
|
|
1088
|
+
leptris_arena_buffer_release(buf, len + 1 + 64);
|
|
1089
|
+
if (pristine_owned)
|
|
1090
|
+
leptris_arena_buffer_release(pristine, len + 1);
|
|
1091
|
+
return NULL;
|
|
1092
|
+
}
|
|
1093
|
+
LeptrisMemoryPool* pool = leptris_pool_create_arena_backed(arena, 1);
|
|
1094
|
+
if (!pool) {
|
|
1095
|
+
leptris_arena_destroy(arena);
|
|
1096
|
+
leptris_arena_buffer_release(buf, len + 1 + 64);
|
|
1097
|
+
if (pristine_owned)
|
|
1098
|
+
leptris_arena_buffer_release(pristine, len + 1);
|
|
1099
|
+
return NULL;
|
|
1100
|
+
}
|
|
1101
|
+
if (len >= 256) {
|
|
1102
|
+
pool->string_cache = leptris_hash_table_create(pool, 128);
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
/* owns_buffer == 2 was resolved above (TODO 188): the input is
|
|
1106
|
+
* already copied — fused with the count3 pre-scan into the
|
|
1107
|
+
* separately-malloc'd buffer `buf` — and owns_buffer is now 1.
|
|
1108
|
+
* There is no second copy here. */
|
|
1109
|
+
|
|
1110
|
+
/* 3. Bulk-allocate element + attribute blocks as ONE contiguous
|
|
1111
|
+
* arena bump. Layout: [ elem_block | attr_block ]
|
|
1112
|
+
*
|
|
1113
|
+
* attr capacity follows the quote-derived estimate (each attr
|
|
1114
|
+
* value contributes exactly 2 quote chars). Overflow falls back
|
|
1115
|
+
* to per-attr pool alloc — which now bumps the same arena. */
|
|
1116
|
+
size_t attr_capacity = quote_count / 2 + 64;
|
|
1117
|
+
/* Text-node upper bound: every text node is followed by a '<'
|
|
1118
|
+
* (lt_count), so the count can never exceed it. Attr-heavy docs
|
|
1119
|
+
* over-reserve (~56 B per tag) — bounded, and the retained arena
|
|
1120
|
+
* absorbs it after the first parse of each size. */
|
|
1121
|
+
size_t text_bytes = lt_count * sizeof(struct leptris_text_node);
|
|
1122
|
+
size_t cpi_stride =
|
|
1123
|
+
sizeof(LeptrisPINode) > sizeof(LeptrisCommentNode)
|
|
1124
|
+
? sizeof(LeptrisPINode) : sizeof(LeptrisCommentNode);
|
|
1125
|
+
if (cpi_stride < sizeof(LeptrisCDATANode)) cpi_stride = sizeof(LeptrisCDATANode);
|
|
1126
|
+
cpi_stride = (cpi_stride + 7u) & ~(size_t)7u;
|
|
1127
|
+
size_t cpi_bytes = lt_count * cpi_stride; /* each markup node starts with '<' */
|
|
1128
|
+
char* combined = (char*)leptris_pool_alloc(
|
|
1129
|
+
pool, elem_bytes + elem_pad + attr_bytes + text_bytes + cpi_bytes);
|
|
1130
|
+
if (!combined) {
|
|
1131
|
+
leptris_pool_destroy(pool);
|
|
1132
|
+
leptris_arena_buffer_release(buf, len + 1 + 64);
|
|
1133
|
+
if (pristine_owned)
|
|
1134
|
+
leptris_arena_buffer_release(pristine, len + 1);
|
|
1135
|
+
return NULL;
|
|
1136
|
+
}
|
|
1137
|
+
LeptrisElement elem_block = (LeptrisElement)combined;
|
|
1138
|
+
/* Sub-blocks sit AFTER the pad — the final chunk memset may
|
|
1139
|
+
* write into it, and it must never touch carved attr/text/cpi
|
|
1140
|
+
* nodes (this exact overlap wiped doc-level PIs). */
|
|
1141
|
+
char* elem_end = combined + elem_bytes + elem_pad;
|
|
1142
|
+
struct leptris_attribute* attr_block =
|
|
1143
|
+
(struct leptris_attribute*)(elem_end);
|
|
1144
|
+
struct leptris_text_node* text_block =
|
|
1145
|
+
(struct leptris_text_node*)(elem_end + attr_bytes);
|
|
1146
|
+
char* cpi_block = elem_end + attr_bytes + text_bytes;
|
|
1147
|
+
/* No memset on attr_block — dp_add_attr_inline initializes every
|
|
1148
|
+
* field of each attr it uses. (Elements keep the bulk memset:
|
|
1149
|
+
* carve-time zeroing measured 1-2 us SLOWER — interleaved in-loop
|
|
1150
|
+
* stores cost more than the streaming pass saves, even though the
|
|
1151
|
+
* reservation tail is ~2x the carved elements on mixed docs.) */
|
|
1152
|
+
size_t elem_idx = 0;
|
|
1153
|
+
size_t elem_zeroed = 0;
|
|
1154
|
+
|
|
1155
|
+
/* 4. Create document. Pool-allocated to save one malloc per
|
|
1156
|
+
* parse (TODO 154 Phase B). The doc_pool_allocated flag tells
|
|
1157
|
+
* leptris_document_free to skip the LEPTRIS_FREE(doc) — pool
|
|
1158
|
+
* destroy reclaims it. */
|
|
1159
|
+
struct leptris_document* doc = (struct leptris_document*)
|
|
1160
|
+
leptris_pool_alloc(pool, sizeof(struct leptris_document));
|
|
1161
|
+
if (!doc) {
|
|
1162
|
+
leptris_pool_destroy(pool);
|
|
1163
|
+
leptris_arena_buffer_release(buf, len + 1 + 64);
|
|
1164
|
+
if (pristine_owned)
|
|
1165
|
+
leptris_arena_buffer_release(pristine, len + 1);
|
|
1166
|
+
return NULL;
|
|
1167
|
+
}
|
|
1168
|
+
memset(doc, 0, sizeof(*doc));
|
|
1169
|
+
doc->doc_pool_allocated = 1;
|
|
1170
|
+
doc->strict_mode = g_leptris_strict_mode;
|
|
1171
|
+
doc->pool = pool;
|
|
1172
|
+
doc->page_base = leptris_pool_get_base(pool);
|
|
1173
|
+
doc->ref_count = 1;
|
|
1174
|
+
doc->xml_buffer = pristine;
|
|
1175
|
+
doc->xml_buffer_len = len;
|
|
1176
|
+
doc->xml_buffer_needs_free = pristine_owned;
|
|
1177
|
+
doc->xml_buffer_slack = 0u;
|
|
1178
|
+
doc->parse_scratch = buf; /* string backing; freed at doc free */
|
|
1179
|
+
if (len < 0x7FFFFFFFu) {
|
|
1180
|
+
size_t cap = 256, n_ = 0;
|
|
1181
|
+
uint32_t* brks = (uint32_t*)malloc(cap * sizeof(uint32_t));
|
|
1182
|
+
if (!brks) {
|
|
1183
|
+
leptris_pool_destroy(pool);
|
|
1184
|
+
leptris_arena_buffer_release(buf, len + 1 + 64);
|
|
1185
|
+
if (pristine_owned)
|
|
1186
|
+
leptris_arena_buffer_release(pristine, len + 1);
|
|
1187
|
+
return NULL;
|
|
1188
|
+
}
|
|
1189
|
+
for (size_t i = 0; i < len; i++) {
|
|
1190
|
+
if (buf[i] != '\n') continue;
|
|
1191
|
+
if (n_ == cap) {
|
|
1192
|
+
cap *= 2;
|
|
1193
|
+
uint32_t* grown = (uint32_t*)realloc(
|
|
1194
|
+
brks, cap * sizeof(uint32_t));
|
|
1195
|
+
if (!grown) {
|
|
1196
|
+
free(brks);
|
|
1197
|
+
leptris_pool_destroy(pool);
|
|
1198
|
+
leptris_arena_buffer_release(buf, len + 1 + 64);
|
|
1199
|
+
if (pristine_owned)
|
|
1200
|
+
leptris_arena_buffer_release(pristine, len + 1);
|
|
1201
|
+
return NULL;
|
|
1202
|
+
}
|
|
1203
|
+
brks = grown;
|
|
1204
|
+
}
|
|
1205
|
+
brks[n_++] = (uint32_t)i;
|
|
1206
|
+
}
|
|
1207
|
+
doc->line_breaks = brks;
|
|
1208
|
+
doc->line_break_count = n_;
|
|
1209
|
+
}
|
|
1210
|
+
/* No leptris_compact_set_current_document — direct_parse is
|
|
1211
|
+
* overflow-table-free. All compact pointer edges use direct
|
|
1212
|
+
* offset arithmetic, never touching the shared thread-local
|
|
1213
|
+
* overflow hash table. This eliminates cross-document
|
|
1214
|
+
* contamination under high document counts (#261). */
|
|
1215
|
+
|
|
1216
|
+
/* 5. Parse. */
|
|
1217
|
+
DParser p;
|
|
1218
|
+
p.buf = buf;
|
|
1219
|
+
p.pos = buf;
|
|
1220
|
+
p.end = buf + len;
|
|
1221
|
+
p.pool = pool;
|
|
1222
|
+
p.doc = doc;
|
|
1223
|
+
p.depth = 0;
|
|
1224
|
+
p.root = NULL;
|
|
1225
|
+
p.dc_head = NULL;
|
|
1226
|
+
p.dc_tail = NULL;
|
|
1227
|
+
p.root_chained = 0;
|
|
1228
|
+
p.version = NULL;
|
|
1229
|
+
p.encoding = NULL;
|
|
1230
|
+
p.standalone = -1;
|
|
1231
|
+
p.had_declaration = 0;
|
|
1232
|
+
p.attr_block = attr_block;
|
|
1233
|
+
p.attr_idx = 0;
|
|
1234
|
+
p.attr_capacity = attr_capacity;
|
|
1235
|
+
p.attr_cursor = attr_block;
|
|
1236
|
+
p.attr_end = attr_block + attr_capacity;
|
|
1237
|
+
p.text_cursor = text_block;
|
|
1238
|
+
p.text_end = text_block + lt_count;
|
|
1239
|
+
p.cpi_cursor = cpi_block;
|
|
1240
|
+
p.cpi_end = cpi_block + cpi_bytes;
|
|
1241
|
+
p.raw_cursor = NULL;
|
|
1242
|
+
p.raw_end = NULL;
|
|
1243
|
+
p.raw_last = NULL;
|
|
1244
|
+
p.nsc_cursor = NULL;
|
|
1245
|
+
p.nsc_end = NULL;
|
|
1246
|
+
p.cpi_stride = cpi_stride;
|
|
1247
|
+
/* owns_buffer==2 was converted to 1 above; only the parser's own
|
|
1248
|
+
* copy carries the zeroed slack. */
|
|
1249
|
+
p.probe_slack = 1; /* the scratch always carries zeroed slack */
|
|
1250
|
+
p.drop_ws_text = drop_ws_text;
|
|
1251
|
+
p.keep_entity_refs = keep_entity_refs;
|
|
1252
|
+
p.dtd = NULL;
|
|
1253
|
+
/* Only ever set to 1 in the loop; without the zero here the
|
|
1254
|
+
* field rides the stack (MSVC C4701) and doc->has_namespaces
|
|
1255
|
+
* gets garbage on namespace-less documents. */
|
|
1256
|
+
p.saw_namespace = 0;
|
|
1257
|
+
p.line_offsets_ok = len < 0x7FFFFFFFu;
|
|
1258
|
+
|
|
1259
|
+
/* Skip BOM. */
|
|
1260
|
+
if (len >= 3 && (unsigned char)buf[0] == 0xEF &&
|
|
1261
|
+
(unsigned char)buf[1] == 0xBB && (unsigned char)buf[2] == 0xBF) {
|
|
1262
|
+
p.pos += 3;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
while (p.pos < p.end) {
|
|
1266
|
+
/* Top-level whitespace: a TEXT child of the document node —
|
|
1267
|
+
* chained like prolog comments/PIs so /node() counts it and
|
|
1268
|
+
* identity transforms copy it (#580 chain completion,
|
|
1269
|
+
* bug-195). */
|
|
1270
|
+
if (p.depth == 0) {
|
|
1271
|
+
char* ws_start = p.pos;
|
|
1272
|
+
dp_skip_ws(&p);
|
|
1273
|
+
size_t wl = (size_t)(p.pos - ws_start);
|
|
1274
|
+
/* libxml2 keeps document-level ws ONLY after a comment
|
|
1275
|
+
* or after the root element (bug-195 vs bug-196: ws
|
|
1276
|
+
* after a prolog PI is dropped); leading ws is prolog
|
|
1277
|
+
* Misc; trailing ws is trimmed after the loop. */
|
|
1278
|
+
if (wl > 0 && p.dc_tail &&
|
|
1279
|
+
(p.dc_tail->type == LEPTRIS_NODE_TYPE_COMMENT ||
|
|
1280
|
+
(p.root_chained &&
|
|
1281
|
+
p.dc_tail == (LeptrisNode*)p.root))) {
|
|
1282
|
+
LeptrisTextNode* wtn =
|
|
1283
|
+
dp_text_create(&p, ws_start, wl);
|
|
1284
|
+
if (!wtn) goto fail;
|
|
1285
|
+
wtn->base.frozen = 1;
|
|
1286
|
+
dp_doc_child(&p, (LeptrisNode*)wtn);
|
|
1287
|
+
}
|
|
1288
|
+
if (p.pos >= p.end) break;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
if (*p.pos != '<') {
|
|
1292
|
+
/* DROP_WS_TEXT (issue #677): drop whitespace-ONLY runs —
|
|
1293
|
+
* the boundary whitespace of NON-blank text is data
|
|
1294
|
+
* (libxml2 XML_PARSE_NOBLANKS parity). The run is
|
|
1295
|
+
* dropped only when every byte up to the next markup
|
|
1296
|
+
* delimiter is whitespace; otherwise the text path sees
|
|
1297
|
+
* the leading whitespace untouched. */
|
|
1298
|
+
if (p.drop_ws_text &&
|
|
1299
|
+
(*p.pos == ' ' || *p.pos == '\t' || *p.pos == '\n' ||
|
|
1300
|
+
*p.pos == '\r')) {
|
|
1301
|
+
char* q = p.pos + 1;
|
|
1302
|
+
while (q < p.end && *q != '<') {
|
|
1303
|
+
if (*q != ' ' && *q != '\t' && *q != '\n' &&
|
|
1304
|
+
*q != '\r')
|
|
1305
|
+
break;
|
|
1306
|
+
q++;
|
|
1307
|
+
}
|
|
1308
|
+
if (q >= p.end) break;
|
|
1309
|
+
if (*q == '<') { p.pos = q; continue; }
|
|
1310
|
+
}
|
|
1311
|
+
/* Text content — FUSED scan (TODO 184): one inline loop
|
|
1312
|
+
* finds '<' AND counts '\n' (issue #223 line tracking),
|
|
1313
|
+
* replacing the memchr + dp_advance_line re-walk (two
|
|
1314
|
+
* passes; memchr pays ~10ns setup on short text — the
|
|
1315
|
+
* same finding as the attr-value scan). First 48 bytes
|
|
1316
|
+
* inline, SIMD fallback for longer spans. */
|
|
1317
|
+
char* text_start = p.pos;
|
|
1318
|
+
uint32_t text_off =
|
|
1319
|
+
p.line_offsets_ok
|
|
1320
|
+
? (uint32_t)(text_start - p.buf) + 1u : 0u;
|
|
1321
|
+
char* lt = NULL;
|
|
1322
|
+
{
|
|
1323
|
+
const char* q = p.pos;
|
|
1324
|
+
const char* probe_end = p.probe_slack
|
|
1325
|
+
? q + 48
|
|
1326
|
+
: ((p.end - q > 48) ? q + 48 : p.end);
|
|
1327
|
+
while (q < probe_end) {
|
|
1328
|
+
if (*q == '<') { lt = (char*)q; goto text_done; }
|
|
1329
|
+
q++;
|
|
1330
|
+
}
|
|
1331
|
+
if (q >= p.end) goto text_done;
|
|
1332
|
+
lt = (char*)memchr(q, '<', p.end - q);
|
|
1333
|
+
if (!lt) lt = p.end;
|
|
1334
|
+
}
|
|
1335
|
+
text_done:
|
|
1336
|
+
p.pos = lt ? lt : p.end;
|
|
1337
|
+
size_t tlen = p.pos - text_start;
|
|
1338
|
+
|
|
1339
|
+
if (tlen == 0) continue;
|
|
1340
|
+
/* (ws handling lives at the text-branch ENTRY — see the
|
|
1341
|
+
* drop_ws_text fast path before text_start.) */
|
|
1342
|
+
if (p.depth == 0) {
|
|
1343
|
+
/* Whitespace-only between root and PIs. */
|
|
1344
|
+
for (char* c = text_start; c < p.pos; c++) {
|
|
1345
|
+
if (!IS_WS(*c)) goto fail;
|
|
1346
|
+
}
|
|
1347
|
+
continue;
|
|
1348
|
+
}
|
|
1349
|
+
/* Text node. When a DTD is present (custom entity
|
|
1350
|
+
* declarations), eagerly expand entities into a pool-
|
|
1351
|
+
* allocated string — borrowed storage can't resolve
|
|
1352
|
+
* &foo; without the DTD at access time. Without a DTD,
|
|
1353
|
+
* stay borrowed and let leptris_text_get_content expand
|
|
1354
|
+
* predefined entities lazily. */
|
|
1355
|
+
/* #1094 KEEP_ENTITY_REFS: split the run at each
|
|
1356
|
+
* &name; — text segments stay borrowed (predefined and
|
|
1357
|
+
* character references still expand lazily on read);
|
|
1358
|
+
* named references become ENTITY_REF nodes. A '&' that
|
|
1359
|
+
* is not a well-formed reference stays literal text. */
|
|
1360
|
+
if (p.keep_entity_refs && memchr(text_start, '&', tlen)) {
|
|
1361
|
+
const char* seg = text_start;
|
|
1362
|
+
const char* tq = text_start;
|
|
1363
|
+
const char* t_end = text_start + tlen;
|
|
1364
|
+
while (tq < t_end) {
|
|
1365
|
+
if (*tq != '&') { tq++; continue; }
|
|
1366
|
+
const char* nm = tq + 1;
|
|
1367
|
+
while (nm < t_end && nm - tq - 1 < 64 &&
|
|
1368
|
+
IS_NAME_CHAR(*nm))
|
|
1369
|
+
nm++;
|
|
1370
|
+
if (nm == tq + 1 || nm >= t_end || *nm != ';') {
|
|
1371
|
+
tq++; /* lone '&' or over-long: literal */
|
|
1372
|
+
continue;
|
|
1373
|
+
}
|
|
1374
|
+
if (tq > seg) {
|
|
1375
|
+
LeptrisTextNode* rt =
|
|
1376
|
+
dp_text_create(&p, seg, (size_t)(tq - seg));
|
|
1377
|
+
if (!rt) goto fail;
|
|
1378
|
+
rt->base.line = text_off;
|
|
1379
|
+
if (!rt->base.frozen) rt->base.frozen = 1;
|
|
1380
|
+
dp_wire_child(&p, p.open_stack[p.depth - 1],
|
|
1381
|
+
(LeptrisNode*)rt);
|
|
1382
|
+
}
|
|
1383
|
+
LeptrisEntityRefNode* er = leptris_entity_ref_create(
|
|
1384
|
+
tq + 1, (size_t)(nm - tq - 1), pool);
|
|
1385
|
+
if (!er) goto fail;
|
|
1386
|
+
er->base.line = text_off;
|
|
1387
|
+
dp_wire_child(&p, p.open_stack[p.depth - 1],
|
|
1388
|
+
(LeptrisNode*)er);
|
|
1389
|
+
tq = nm + 1;
|
|
1390
|
+
seg = tq;
|
|
1391
|
+
}
|
|
1392
|
+
if (t_end > seg) {
|
|
1393
|
+
LeptrisTextNode* rt =
|
|
1394
|
+
dp_text_create(&p, seg, (size_t)(t_end - seg));
|
|
1395
|
+
if (!rt) goto fail;
|
|
1396
|
+
rt->base.line = text_off;
|
|
1397
|
+
if (!rt->base.frozen) rt->base.frozen = 1;
|
|
1398
|
+
dp_wire_child(&p, p.open_stack[p.depth - 1],
|
|
1399
|
+
(LeptrisNode*)rt);
|
|
1400
|
+
}
|
|
1401
|
+
continue;
|
|
1402
|
+
}
|
|
1403
|
+
LeptrisTextNode* tn;
|
|
1404
|
+
if (p.dtd && tlen > 0 &&
|
|
1405
|
+
memchr(text_start, '&', tlen) != NULL) {
|
|
1406
|
+
LeptrisStringView sv = leptris_sv_from_ptr(text_start, tlen);
|
|
1407
|
+
char* expanded = leptris_decode_entities_view_with_dtd(
|
|
1408
|
+
&sv, p.dtd, pool);
|
|
1409
|
+
if (expanded) {
|
|
1410
|
+
tn = leptris_text_create(expanded, strlen(expanded), pool);
|
|
1411
|
+
} else {
|
|
1412
|
+
tn = dp_text_create(&p, text_start, tlen);
|
|
1413
|
+
}
|
|
1414
|
+
} else {
|
|
1415
|
+
tn = dp_text_create(&p, text_start, tlen);
|
|
1416
|
+
}
|
|
1417
|
+
if (!tn) goto fail;
|
|
1418
|
+
tn->base.line = text_off;
|
|
1419
|
+
if (!tn->base.frozen) tn->base.frozen = 1;
|
|
1420
|
+
dp_wire_child(&p, p.open_stack[p.depth - 1], (LeptrisNode*)tn);
|
|
1421
|
+
continue;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
/* '<' — dispatch. */
|
|
1425
|
+
if (p.end - p.pos < 2) goto fail;
|
|
1426
|
+
char next = p.pos[1];
|
|
1427
|
+
|
|
1428
|
+
if (IS_NAME_START(next)) {
|
|
1429
|
+
/* Element. Snapshot line BEFORE scanning the open tag so
|
|
1430
|
+
* the element reports the line where '<' appeared. */
|
|
1431
|
+
uint32_t elem_off = p.line_offsets_ok
|
|
1432
|
+
? (uint32_t)(p.pos - p.buf) + 1u : 0u;
|
|
1433
|
+
LeptrisElement elem;
|
|
1434
|
+
if (elem_idx < est_elems) {
|
|
1435
|
+
if (elem_idx >= elem_zeroed) {
|
|
1436
|
+
/* Zero 64 elements per streaming pass instead of
|
|
1437
|
+
* one bulk memset of the whole (2x-over-reserved
|
|
1438
|
+
* on paired-tag documents) block — 17% of a
|
|
1439
|
+
* text-heavy parse was bzero. The pad reservation
|
|
1440
|
+
* makes the final chunk safe. */
|
|
1441
|
+
memset(&elem_block[elem_zeroed], 0,
|
|
1442
|
+
DP_ELEM_CHUNK *
|
|
1443
|
+
sizeof(struct leptris_element));
|
|
1444
|
+
elem_zeroed += DP_ELEM_CHUNK;
|
|
1445
|
+
}
|
|
1446
|
+
elem = &elem_block[elem_idx++];
|
|
1447
|
+
} else {
|
|
1448
|
+
/* Bulk block exhausted — fall back to pool_alloc.
|
|
1449
|
+
* Pool pages are contiguous, so compact-pointer
|
|
1450
|
+
* offsets remain valid as long as the pool's first
|
|
1451
|
+
* page is large enough to hold both the bulk block
|
|
1452
|
+
* and these overflow elements. direct_parse sizes
|
|
1453
|
+
* the first page for exactly this (see page_size
|
|
1454
|
+
* calculation above). */
|
|
1455
|
+
elem = (LeptrisElement)leptris_pool_alloc(
|
|
1456
|
+
pool, sizeof(struct leptris_element));
|
|
1457
|
+
if (!elem) goto fail;
|
|
1458
|
+
memset(elem, 0, sizeof(struct leptris_element));
|
|
1459
|
+
}
|
|
1460
|
+
elem->base.type = LEPTRIS_NODE_TYPE_ELEMENT;
|
|
1461
|
+
elem->base.line = elem_off;
|
|
1462
|
+
/* Parse-built trees are frozen (immutable until a
|
|
1463
|
+
* mutation copies) — set at creation instead of the old
|
|
1464
|
+
* post-parse tree walk, which cost ~11% of parse at
|
|
1465
|
+
* K=5 in the sample profile (TODO 187). */
|
|
1466
|
+
elem->base.frozen = 1;
|
|
1467
|
+
/* TODO 155 Phase A: document field removed; root registered
|
|
1468
|
+
* below via leptris_root_doc_register. */
|
|
1469
|
+
|
|
1470
|
+
/* Scan name (zero-copy). DON'T NUL-terminate yet — the
|
|
1471
|
+
* byte after the name is '>' or whitespace, which
|
|
1472
|
+
* dp_parse_attrs needs to see intact. We NUL-terminate
|
|
1473
|
+
* AFTER dp_parse_attrs returns. */
|
|
1474
|
+
p.pos++; /* skip '<' */
|
|
1475
|
+
char* name_start = p.pos;
|
|
1476
|
+
dp_scan_name(&p);
|
|
1477
|
+
size_t name_len = p.pos - name_start;
|
|
1478
|
+
|
|
1479
|
+
/* Parse attributes (scans from the delimiter position). */
|
|
1480
|
+
int self_closing = dp_parse_attrs(&p, elem);
|
|
1481
|
+
if (self_closing < 0) goto fail;
|
|
1482
|
+
elem->start_tag_end_off = p.line_offsets_ok
|
|
1483
|
+
? (uint32_t)(p.pos - p.buf) : 0u;
|
|
1484
|
+
if (self_closing) elem->element_end_off = elem->start_tag_end_off;
|
|
1485
|
+
|
|
1486
|
+
/* NOW safe to NUL-terminate the name — dp_parse_attrs
|
|
1487
|
+
* has finished scanning the open tag. */
|
|
1488
|
+
if (dp_nul(&p, name_start + name_len)) goto fail;
|
|
1489
|
+
|
|
1490
|
+
if (dp_split_hash_name(&p, elem, name_start, name_len))
|
|
1491
|
+
goto fail;
|
|
1492
|
+
|
|
1493
|
+
/* Wire into parent. */
|
|
1494
|
+
if (p.depth > 0) {
|
|
1495
|
+
dp_wire_child(&p, p.open_stack[p.depth - 1], (LeptrisNode*)elem);
|
|
1496
|
+
} else {
|
|
1497
|
+
if (p.root) goto fail; /* multiple top-level elements */
|
|
1498
|
+
p.root = elem;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
if (!self_closing) {
|
|
1502
|
+
/* Respect custom depth limit (g_leptris_max_depth)
|
|
1503
|
+
* when set by the caller; fall back to the
|
|
1504
|
+
* compile-time default otherwise. */
|
|
1505
|
+
extern LEPTRIS_THREAD_LOCAL int g_leptris_max_depth;
|
|
1506
|
+
int max_depth = g_leptris_max_depth > 0
|
|
1507
|
+
? g_leptris_max_depth : DP_MAX_DEPTH;
|
|
1508
|
+
if (p.depth >= max_depth) goto fail;
|
|
1509
|
+
p.open_stack[p.depth++] = elem;
|
|
1510
|
+
/* Initialize last_child_stack for the new depth. */
|
|
1511
|
+
p.last_child_stack[p.depth - 1] = NULL;
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
else if (next == '/') {
|
|
1515
|
+
/* Close tag. */
|
|
1516
|
+
p.pos += 2;
|
|
1517
|
+
/* Scan name (includes prefix:local). */
|
|
1518
|
+
char* close_start = p.pos;
|
|
1519
|
+
dp_scan_name(&p);
|
|
1520
|
+
size_t close_len = p.pos - close_start;
|
|
1521
|
+
dp_skip_ws(&p);
|
|
1522
|
+
if (p.pos >= p.end || *p.pos != '>') goto fail;
|
|
1523
|
+
p.pos++;
|
|
1524
|
+
if (p.depth == 0) goto fail;
|
|
1525
|
+
/* Verify close tag matches open element. The open
|
|
1526
|
+
* element's name is the LOCAL part (prefix stripped).
|
|
1527
|
+
* Compare the local part of the close tag, which is
|
|
1528
|
+
* everything after ':' (or the whole name if no ':'). */
|
|
1529
|
+
LeptrisElement open = p.open_stack[p.depth - 1];
|
|
1530
|
+
const char* open_name = open->name;
|
|
1531
|
+
size_t open_len = (open->name_len != 0xFF)
|
|
1532
|
+
? (size_t)open->name_len : strlen(open_name);
|
|
1533
|
+
const char* close_local = close_start;
|
|
1534
|
+
size_t close_local_len = close_len;
|
|
1535
|
+
/* Strip the close tag's prefix ONLY when the open element
|
|
1536
|
+
* was prefixed. Exact, allocation-independent test: the
|
|
1537
|
+
* open tag's colon was NUL-terminated in-place, so
|
|
1538
|
+
* open->name[-1] is that NUL for prefixed names and '<'
|
|
1539
|
+
* for unprefixed ones (element names directly follow '<').
|
|
1540
|
+
* An unprefixed open closed by a prefixed name already
|
|
1541
|
+
* fails the length compare below — same result as the old
|
|
1542
|
+
* unconditional scan, without the per-element memchr call
|
|
1543
|
+
* (a libc call for a 1-6 byte span — the TODO 174 law). */
|
|
1544
|
+
const char* colon = NULL;
|
|
1545
|
+
if (open->name[-1] == '\0') {
|
|
1546
|
+
if (close_len < 16) {
|
|
1547
|
+
for (const char* c = close_start;
|
|
1548
|
+
c < close_start + close_len; c++) {
|
|
1549
|
+
if (*c == ':') { colon = c; break; }
|
|
1550
|
+
}
|
|
1551
|
+
} else {
|
|
1552
|
+
colon = (const char*)memchr(close_start, ':', close_len);
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
if (colon) {
|
|
1556
|
+
close_local = colon + 1;
|
|
1557
|
+
close_local_len = close_len - (colon + 1 - close_start);
|
|
1558
|
+
}
|
|
1559
|
+
if (open_len != close_local_len) goto fail;
|
|
1560
|
+
/* Masked 64-bit compare for short names — one load
|
|
1561
|
+
* each side vs a libc memcmp call (the TODO 174 law:
|
|
1562
|
+
* setup dominates sub-8-byte compares; ~9% of the
|
|
1563
|
+
* element-heavy corpus profile). The 8-byte load may
|
|
1564
|
+
* read past the name: safe outright on the owned copy
|
|
1565
|
+
* (zeroed slack), and safe on caller buffers whenever
|
|
1566
|
+
* the load stays inside [buf, end] (the sentinel at
|
|
1567
|
+
* buf[len] is the +1) — only names within 8 bytes of the
|
|
1568
|
+
* document end fall back to memcmp (issue #561: gating
|
|
1569
|
+
* the whole fast path on probe_slack cost inplace
|
|
1570
|
+
* parsing a memcmp per element). */
|
|
1571
|
+
if (close_local_len <= 8 &&
|
|
1572
|
+
(p.probe_slack ||
|
|
1573
|
+
close_local + 8 <= p.end + 1)) {
|
|
1574
|
+
uint64_t mask = (close_local_len == 8)
|
|
1575
|
+
? ~(uint64_t)0
|
|
1576
|
+
: ((1ull << (close_local_len * 8)) - 1);
|
|
1577
|
+
uint64_t a, b;
|
|
1578
|
+
memcpy(&a, open_name, 8);
|
|
1579
|
+
memcpy(&b, close_local, 8);
|
|
1580
|
+
if ((a & mask) != (b & mask)) goto fail;
|
|
1581
|
+
} else if (memcmp(open_name, close_local,
|
|
1582
|
+
close_local_len) != 0) {
|
|
1583
|
+
goto fail;
|
|
1584
|
+
}
|
|
1585
|
+
open->element_end_off = p.line_offsets_ok
|
|
1586
|
+
? (uint32_t)(p.pos - p.buf) : 0u;
|
|
1587
|
+
p.depth--;
|
|
1588
|
+
/* Clear the closed level's tail cache (AFTER the
|
|
1589
|
+
* decrement: at max depth the pre-decrement index would
|
|
1590
|
+
* write past the array): a stale prev_last here wires
|
|
1591
|
+
* cross-level siblings (issue #478). */
|
|
1592
|
+
p.last_child_stack[p.depth] = NULL;
|
|
1593
|
+
}
|
|
1594
|
+
else if (next == '!') {
|
|
1595
|
+
/* Comment, CDATA, or DOCTYPE. */
|
|
1596
|
+
uint32_t markup_off = p.line_offsets_ok
|
|
1597
|
+
? (uint32_t)(p.pos - p.buf) + 1u : 0u;
|
|
1598
|
+
if (p.end - p.pos >= 4 && p.pos[2] == '-' && p.pos[3] == '-') {
|
|
1599
|
+
/* Comment: <!-- ... --> */
|
|
1600
|
+
p.pos += 4;
|
|
1601
|
+
char* start = p.pos;
|
|
1602
|
+
/* TODO 177: SIMD find3 for "-->" (NEON/AVX2 when
|
|
1603
|
+
* available, scalar memchr-anchor fallback). Replaces
|
|
1604
|
+
* the per-candidate dash verify loop; dash-run-heavy
|
|
1605
|
+
* comment bodies no longer re-scan candidates. */
|
|
1606
|
+
ptrdiff_t hit = leptris_text_find3(
|
|
1607
|
+
p.pos, (size_t)(p.end - p.pos), '-', '-', '>');
|
|
1608
|
+
if (hit < 0) goto fail;
|
|
1609
|
+
p.pos += hit;
|
|
1610
|
+
if (dp_nul(&p, p.pos)) goto fail; /* NUL-term content */
|
|
1611
|
+
LeptrisCommentNode* cn = (LeptrisCommentNode*)
|
|
1612
|
+
dp_cpi_carve(&p, LEPTRIS_NODE_TYPE_COMMENT);
|
|
1613
|
+
if (cn) {
|
|
1614
|
+
cn->content = start; /* zero-copy, buf-lifetime */
|
|
1615
|
+
} else {
|
|
1616
|
+
cn = leptris_comment_create(start, p.pos - start, pool);
|
|
1617
|
+
if (!cn) goto fail;
|
|
1618
|
+
}
|
|
1619
|
+
cn->base.line = markup_off;
|
|
1620
|
+
cn->base.frozen = 1; /* at creation — TODO 187 */
|
|
1621
|
+
if (p.depth > 0) {
|
|
1622
|
+
dp_wire_child(&p, p.open_stack[p.depth - 1], (LeptrisNode*)cn);
|
|
1623
|
+
} else {
|
|
1624
|
+
/* Doc-level comment: a tree child of the document
|
|
1625
|
+
* node (#580) — the carved node chains directly,
|
|
1626
|
+
* no heap twin. */
|
|
1627
|
+
dp_doc_child(&p, (LeptrisNode*)cn);
|
|
1628
|
+
}
|
|
1629
|
+
p.pos += 3;
|
|
1630
|
+
} else if (p.end - p.pos >= 9 &&
|
|
1631
|
+
memcmp(p.pos + 2, "[CDATA[", 7) == 0) {
|
|
1632
|
+
/* CDATA: <![CDATA[ ... ]]> */
|
|
1633
|
+
p.pos += 9;
|
|
1634
|
+
char* start = p.pos;
|
|
1635
|
+
/* TODO 177: SIMD find3 for "]]>". */
|
|
1636
|
+
ptrdiff_t hit = leptris_text_find3(
|
|
1637
|
+
p.pos, (size_t)(p.end - p.pos), ']', ']', '>');
|
|
1638
|
+
if (hit < 0) goto fail;
|
|
1639
|
+
p.pos += hit;
|
|
1640
|
+
if (dp_nul(&p, p.pos)) goto fail;
|
|
1641
|
+
LeptrisCDATANode* cd = (LeptrisCDATANode*)
|
|
1642
|
+
dp_cpi_carve(&p, LEPTRIS_NODE_TYPE_CDATA);
|
|
1643
|
+
if (cd) {
|
|
1644
|
+
cd->content = start; /* zero-copy, buf-lifetime */
|
|
1645
|
+
} else {
|
|
1646
|
+
cd = leptris_cdata_create(start, p.pos - start, pool);
|
|
1647
|
+
if (!cd) goto fail;
|
|
1648
|
+
}
|
|
1649
|
+
cd->base.line = markup_off;
|
|
1650
|
+
cd->base.frozen = 1; /* at creation — TODO 187 */
|
|
1651
|
+
if (p.depth > 0) {
|
|
1652
|
+
dp_wire_child(&p, p.open_stack[p.depth - 1], (LeptrisNode*)cd);
|
|
1653
|
+
}
|
|
1654
|
+
p.pos += 3;
|
|
1655
|
+
} else {
|
|
1656
|
+
/* DOCTYPE: extract name + internal subset. Cold path
|
|
1657
|
+
* extracted to dp_parse_doctype (TODO 166 Phase A). */
|
|
1658
|
+
{
|
|
1659
|
+
/* Cold path: pass state pieces through locals, sync
|
|
1660
|
+
* back — &p must never escape direct_parse_internal
|
|
1661
|
+
* (keeps the hot fields register-promoted). */
|
|
1662
|
+
char* dpos = p.pos;
|
|
1663
|
+
LeptrisDTD* ddtd = p.dtd;
|
|
1664
|
+
if (dp_parse_doctype(&dpos, p.end, p.pool, p.doc,
|
|
1665
|
+
&ddtd) != 0)
|
|
1666
|
+
goto fail;
|
|
1667
|
+
p.pos = dpos;
|
|
1668
|
+
p.dtd = ddtd;
|
|
1669
|
+
}
|
|
1670
|
+
continue;
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
else if (next == '?') {
|
|
1674
|
+
/* PI: <?target data?> or XML declaration. */
|
|
1675
|
+
uint32_t pi_off = p.line_offsets_ok
|
|
1676
|
+
? (uint32_t)(p.pos - p.buf) + 1u : 0u;
|
|
1677
|
+
p.pos += 2;
|
|
1678
|
+
char* target_start = p.pos;
|
|
1679
|
+
if (!IS_NAME_START(*p.pos)) goto fail;
|
|
1680
|
+
p.pos++;
|
|
1681
|
+
dp_scan_name(&p);
|
|
1682
|
+
/* NUL-terminate the target by consuming ONE separator
|
|
1683
|
+
* byte — but only when there is one. A dataless PI
|
|
1684
|
+
* (`<?pi?>`, issue #577) ends the target at the CLOSING
|
|
1685
|
+
* '?'; clobbering it would leave nothing for the data
|
|
1686
|
+
* scan to find and fail the whole parse. */
|
|
1687
|
+
char* data_start = p.pos;
|
|
1688
|
+
size_t target_len = (size_t)(p.pos - target_start);
|
|
1689
|
+
if (*p.pos != '?') {
|
|
1690
|
+
if (dp_nul(&p, p.pos)) goto fail;
|
|
1691
|
+
p.pos++;
|
|
1692
|
+
data_start = p.pos;
|
|
1693
|
+
}
|
|
1694
|
+
/* memchr for '?' — fast-skip PI data bodies. */
|
|
1695
|
+
{
|
|
1696
|
+
char* q = (char*)memchr(p.pos, '?', p.end - p.pos);
|
|
1697
|
+
if (!q) goto fail;
|
|
1698
|
+
p.pos = q;
|
|
1699
|
+
}
|
|
1700
|
+
if (p.pos + 1 >= p.end || p.pos[1] != '>') goto fail;
|
|
1701
|
+
if (dp_nul(&p, p.pos)) goto fail; /* NUL-terminate data */
|
|
1702
|
+
size_t data_len = p.pos - data_start;
|
|
1703
|
+
p.pos += 2;
|
|
1704
|
+
|
|
1705
|
+
/* XML declaration handling. */
|
|
1706
|
+
if (strcmp(target_start, "xml") == 0) {
|
|
1707
|
+
p.had_declaration = 1;
|
|
1708
|
+
/* Parse version/encoding/standalone from data. Values
|
|
1709
|
+
* are NUL-terminated in-place by overwriting the
|
|
1710
|
+
* closing quote; the final heap-strdup is required
|
|
1711
|
+
* because leptris_document_free calls LEPTRIS_FREE on
|
|
1712
|
+
* these fields. */
|
|
1713
|
+
char* scan = data_start;
|
|
1714
|
+
while (*scan) {
|
|
1715
|
+
while (IS_WS(*scan)) scan++;
|
|
1716
|
+
if (!*scan) break;
|
|
1717
|
+
char* pname = scan;
|
|
1718
|
+
while (*scan && !IS_WS(*scan) && *scan != '=') scan++;
|
|
1719
|
+
size_t pname_len = scan - pname;
|
|
1720
|
+
while (IS_WS(*scan)) scan++;
|
|
1721
|
+
if (*scan != '=') break;
|
|
1722
|
+
scan++;
|
|
1723
|
+
while (IS_WS(*scan)) scan++;
|
|
1724
|
+
if (*scan != '"' && *scan != '\'') break;
|
|
1725
|
+
char q = *scan++;
|
|
1726
|
+
char* pval = scan;
|
|
1727
|
+
while (*scan && *scan != q) scan++;
|
|
1728
|
+
if (*scan != q) break;
|
|
1729
|
+
if (dp_nul(&p, scan)) goto fail;
|
|
1730
|
+
scan++;
|
|
1731
|
+
|
|
1732
|
+
if (pname_len == 7 && memcmp(pname, "version", 7) == 0) {
|
|
1733
|
+
p.version = pval;
|
|
1734
|
+
} else if (pname_len == 8 && memcmp(pname, "encoding", 8) == 0) {
|
|
1735
|
+
p.encoding = pval;
|
|
1736
|
+
} else if (pname_len == 10 && memcmp(pname, "standalone", 10) == 0) {
|
|
1737
|
+
if (strcmp(pval, "yes") == 0) p.standalone = 1;
|
|
1738
|
+
else if (strcmp(pval, "no") == 0) p.standalone = 0;
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
continue;
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
LeptrisPINode* pi = (LeptrisPINode*)
|
|
1745
|
+
dp_cpi_carve(&p, LEPTRIS_NODE_TYPE_PI);
|
|
1746
|
+
if (pi) {
|
|
1747
|
+
pi->target = target_start; /* zero-copy, buf-lifetime */
|
|
1748
|
+
pi->data = data_start;
|
|
1749
|
+
(void)target_len;
|
|
1750
|
+
(void)data_len;
|
|
1751
|
+
} else {
|
|
1752
|
+
pi = leptris_pi_create(
|
|
1753
|
+
target_start, strlen(target_start),
|
|
1754
|
+
data_start, data_len, pool);
|
|
1755
|
+
if (!pi) goto fail;
|
|
1756
|
+
}
|
|
1757
|
+
pi->base.line = pi_off;
|
|
1758
|
+
pi->base.frozen = 1; /* at creation — TODO 187 */
|
|
1759
|
+
if (p.depth > 0) {
|
|
1760
|
+
dp_wire_child(&p, p.open_stack[p.depth - 1], (LeptrisNode*)pi);
|
|
1761
|
+
} else {
|
|
1762
|
+
/* Doc-level PI: a tree child of the document node
|
|
1763
|
+
* (#580) — the carved node chains directly. */
|
|
1764
|
+
dp_doc_child(&p, (LeptrisNode*)pi);
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
else {
|
|
1768
|
+
goto fail;
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
if (p.depth != 0) goto fail;
|
|
1773
|
+
if (!p.root) goto fail;
|
|
1774
|
+
|
|
1775
|
+
/* 6. Commit to doc. */
|
|
1776
|
+
doc->new_dom_root = p.root;
|
|
1777
|
+
/* TODO 155 Phase A: register root→doc mapping in the thread-local
|
|
1778
|
+
* hash so non-root elements can reach the doc via walk + lookup. */
|
|
1779
|
+
leptris_root_doc_register(p.root, doc);
|
|
1780
|
+
/* Tree is eagerly built — no FlatDoc, no lazy promote. */
|
|
1781
|
+
doc->doc_children_head = p.dc_head;
|
|
1782
|
+
doc->doc_children_tail = p.dc_tail;
|
|
1783
|
+
if (!p.root_chained && p.root) {
|
|
1784
|
+
LeptrisNode* rn = (LeptrisNode*)p.root;
|
|
1785
|
+
if (doc->doc_children_tail)
|
|
1786
|
+
leptris_node_set_next_sibling(
|
|
1787
|
+
(LeptrisNode*)doc->doc_children_tail, rn);
|
|
1788
|
+
else
|
|
1789
|
+
doc->doc_children_head = rn;
|
|
1790
|
+
doc->doc_children_tail = rn;
|
|
1791
|
+
}
|
|
1792
|
+
/* Trim trailing whitespace-only TEXT off the chain (AFTER the
|
|
1793
|
+
* root splice): libxml2 drops document-tail whitespace (bug-83
|
|
1794
|
+
* regression guard); inter-markup nodes keep their position
|
|
1795
|
+
* (bug-195). */
|
|
1796
|
+
{
|
|
1797
|
+
LeptrisNode* last_mark = NULL;
|
|
1798
|
+
for (LeptrisNode* c = doc->doc_children_head; c;
|
|
1799
|
+
c = leptris_node_get_next_sibling(c)) {
|
|
1800
|
+
if (c->type != LEPTRIS_NODE_TYPE_TEXT) last_mark = c;
|
|
1801
|
+
}
|
|
1802
|
+
if (last_mark) {
|
|
1803
|
+
leptris_node_set_next_sibling(last_mark, NULL);
|
|
1804
|
+
doc->doc_children_tail = last_mark;
|
|
1805
|
+
} else {
|
|
1806
|
+
doc->doc_children_head = NULL;
|
|
1807
|
+
doc->doc_children_tail = NULL;
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
doc->has_namespaces = p.saw_namespace;
|
|
1811
|
+
doc->dtd = p.dtd; /* NULL when no DOCTYPE internal subset */
|
|
1812
|
+
|
|
1813
|
+
/* XML 1.0 §3.3.2: ATTLIST default values materialize on elements
|
|
1814
|
+
* that don't carry the attribute (a post-parse pass — the hot
|
|
1815
|
+
* parse loop stays untouched; DTD-less documents never enter).
|
|
1816
|
+
* First-declaration-wins keeps re-declared attributes stable.
|
|
1817
|
+
* OPT-IN via LEPTRIS_PARSE_DTDATTR (#606): the libxml2
|
|
1818
|
+
* XML_PARSE_DTDATTR default — without it a non-validating parse
|
|
1819
|
+
* leaves defaulted attributes out (W3C C14N ex 3.3 parity). */
|
|
1820
|
+
if (apply_dtd_attrs)
|
|
1821
|
+
leptris_dtd_apply_attribute_defaults(doc);
|
|
1822
|
+
doc->had_declaration = p.had_declaration;
|
|
1823
|
+
doc->standalone = p.standalone;
|
|
1824
|
+
/* encoding and xml_version are borrowed pointers into doc->xml_buffer.
|
|
1825
|
+
* leptris_document_free calls LEPTRIS_FREE on them, so we must heap-strdup. */
|
|
1826
|
+
if (p.encoding) {
|
|
1827
|
+
doc->encoding = strdup(p.encoding);
|
|
1828
|
+
if (!doc->encoding) goto fail;
|
|
1829
|
+
}
|
|
1830
|
+
if (p.version) {
|
|
1831
|
+
doc->xml_version = strdup(p.version);
|
|
1832
|
+
if (!doc->xml_version) goto fail;
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
/* 7. Freeze tree (match legacy parser behavior).
|
|
1836
|
+
*
|
|
1837
|
+
* TODO 187: the tree walk is GONE — every node is created with
|
|
1838
|
+
* frozen=1 above (elements, text, comments, CDATA, PIs). The
|
|
1839
|
+
* walk cost ~11% of parse on element-heavy documents (sample
|
|
1840
|
+
* profile: leptris_node_freeze + sibling/offset decoders). The
|
|
1841
|
+
* public leptris_document_freeze API still walks on demand. */
|
|
1842
|
+
|
|
1843
|
+
{
|
|
1844
|
+
static LEPTRIS_THREAD_LOCAL int dbg_ok = -1;
|
|
1845
|
+
if (dbg_ok < 0) dbg_ok = getenv("LEPTRIS_DEBUG_PARSE") != NULL;
|
|
1846
|
+
if (dbg_ok) {
|
|
1847
|
+
size_t dbg_attr_idx =
|
|
1848
|
+
(size_t)(p.attr_cursor - p.attr_block);
|
|
1849
|
+
fprintf(stderr, "dp ok: arena_used=%zu arena_cap=%zu elem_idx=%zu attr_idx=%zu\n",
|
|
1850
|
+
arena->used, arena->size, elem_idx, dbg_attr_idx);
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
/* #1125: materialize the borrowed NUL-terminated strings into
|
|
1855
|
+
* pool storage, then restore every parser NUL — doc->xml_buffer
|
|
1856
|
+
* ends the parse byte-identical to the input. (Runs after the
|
|
1857
|
+
* encoding/version strdups above, which read the buffer.) */
|
|
1858
|
+
|
|
1859
|
+
return doc;
|
|
1860
|
+
|
|
1861
|
+
fail:
|
|
1862
|
+
/* TODO.concurrency/01: record the failure position in the
|
|
1863
|
+
* thread-local slot so bindings can read leptris_last_error()
|
|
1864
|
+
* when leptris_parse_string returns NULL. */
|
|
1865
|
+
{
|
|
1866
|
+
char msg[80];
|
|
1867
|
+
long off = (long)(p.pos ? p.pos - p.buf : 0);
|
|
1868
|
+
snprintf(msg, sizeof(msg), "XML parse error at byte %ld: malformed input", off);
|
|
1869
|
+
leptris_set_error(LEPTRIS_ERROR_PARSE_FAILED, msg);
|
|
1870
|
+
/* 1-based line/column of the failure (issue #510). */
|
|
1871
|
+
int line = 1, column = 1;
|
|
1872
|
+
for (const char* q = p.buf; q < p.pos; q++) {
|
|
1873
|
+
if (*q == '\n') { line++; column = 1; }
|
|
1874
|
+
else column++;
|
|
1875
|
+
}
|
|
1876
|
+
leptris_set_error_position(line, column);
|
|
1877
|
+
}
|
|
1878
|
+
{
|
|
1879
|
+
/* Cached env lookup — getenv is a linear environ scan, too
|
|
1880
|
+
* costly to repeat on every parse. Benign init race. */
|
|
1881
|
+
static LEPTRIS_THREAD_LOCAL int dbg = -1;
|
|
1882
|
+
if (dbg < 0) dbg = getenv("LEPTRIS_DEBUG_PARSE") != NULL;
|
|
1883
|
+
if (dbg) {
|
|
1884
|
+
fprintf(stderr, "dp fail: pos=%ld off=%ld depth=%d arena_used=%zu arena_cap=%zu elem_idx=%zu attr_idx=%zu lt=%zu q=%zu est=%zu attrcap=%zu\n",
|
|
1885
|
+
(long)(p.pos - p.buf), (long)(p.end - p.pos), p.depth,
|
|
1886
|
+
arena ? arena->used : 0, arena ? arena->size : 0,
|
|
1887
|
+
elem_idx, (size_t)(p.attr_cursor - p.attr_block),
|
|
1888
|
+
lt_count, quote_count, est_elems,
|
|
1889
|
+
attr_capacity);
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
/* The eagerly-built line-break table is malloc'd, not pool-owned
|
|
1893
|
+
* — the fail path never reaches leptris_document_free. Free it
|
|
1894
|
+
* BEFORE pool_destroy reclaims the doc struct. */
|
|
1895
|
+
free(doc->line_breaks);
|
|
1896
|
+
leptris_pool_destroy(pool);
|
|
1897
|
+
/* elem_block AND doc are pool-allocated — both freed by
|
|
1898
|
+
* pool_destroy above. Don't LEPTRIS_FREE(doc) (TODO 154). */
|
|
1899
|
+
leptris_arena_buffer_release(buf, len + 1 + 64);
|
|
1900
|
+
if (pristine_owned)
|
|
1901
|
+
leptris_arena_buffer_release(pristine, len + 1);
|
|
1902
|
+
return NULL;
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1905
|
+
/* Public: copy the input then parse (standard path).
|
|
1906
|
+
*
|
|
1907
|
+
* The copy and the arena-sizing pre-scan are ONE fused SIMD pass
|
|
1908
|
+
* into a separately-malloc'd buffer (TODO 188) — the old design
|
|
1909
|
+
* streamed the input twice (count3 pre-scan + pool memcpy). The
|
|
1910
|
+
* document owns the malloc via doc->xml_buffer_needs_free; the
|
|
1911
|
+
* arena holds only nodes and strings. */
|
|
1912
|
+
struct leptris_document* direct_parse(const char* xml, size_t len) {
|
|
1913
|
+
if (!xml || len == 0) return NULL;
|
|
1914
|
+
return direct_parse_internal((char*)xml, len, 2, 0, 0, 0);
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
/* Public flagged entry (LEPTRIS_PARSE_DROP_WS_TEXT et al.). */
|
|
1918
|
+
struct leptris_document* direct_parse_flags(const char* xml, size_t len,
|
|
1919
|
+
unsigned parse_flags) {
|
|
1920
|
+
if (!xml || len == 0) return NULL;
|
|
1921
|
+
return direct_parse_internal((char*)xml, len, 2,
|
|
1922
|
+
(parse_flags & LEPTRIS_PARSE_DROP_WS_TEXT)
|
|
1923
|
+
? 1 : 0,
|
|
1924
|
+
(parse_flags & LEPTRIS_PARSE_DTDATTR)
|
|
1925
|
+
? 1 : 0,
|
|
1926
|
+
(parse_flags & LEPTRIS_PARSE_KEEP_ENTITY_REFS)
|
|
1927
|
+
? 1 : 0);
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
/* Public: parse a caller-owned writable buffer without copying. */
|
|
1931
|
+
struct leptris_document* direct_parse_inplace(char* buf, size_t len) {
|
|
1932
|
+
if (!buf || len == 0) return NULL;
|
|
1933
|
+
buf[len] = '\0'; /* Ensure NUL termination */
|
|
1934
|
+
return direct_parse_internal(buf, len, 0, 0, 0, 0);
|
|
1935
|
+
}
|