apex-ruby 1.0.30 → 1.0.31
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/README.md +2 -8
- data/apex-ruby.gemspec +14 -3
- data/ext/apex_ext/apex_src/include/apex/apex.h +11 -2
- data/ext/apex_ext/apex_src/src/apex.c +64 -5
- data/ext/apex_ext/apex_src/src/ast_terminal.c +2 -4
- data/ext/apex_ext/apex_src/src/extensions/callouts.c +103 -63
- data/ext/apex_ext/apex_src/src/extensions/callouts.h +3 -2
- data/ext/apex_ext/apex_src/src/extensions/citations.c +15 -2
- data/ext/apex_ext/apex_src/src/extensions/emoji.c +73 -7
- data/ext/apex_ext/apex_src/src/extensions/html_markdown.c +25 -4
- data/ext/apex_ext/apex_src/src/extensions/html_markdown.h +4 -1
- data/ext/apex_ext/apex_src/src/extensions/insert.c +49 -0
- data/ext/apex_ext/apex_src/src/extensions/metadata.c +275 -55
- data/ext/apex_ext/apex_src/src/extensions/metadata.h +9 -0
- data/ext/apex_ext/apex_src/src/extensions/relaxed_tables.c +172 -254
- data/ext/apex_ext/apex_src/src/extensions/table_html_postprocess.c +36 -127
- data/ext/apex_ext/apex_src/src/html_renderer.c +99 -157
- data/ext/apex_ext/extconf.rb +31 -79
- data/lib/apex/version.rb +1 -1
- metadata +1 -470
- data/ext/apex_ext/apex_src/AGENTS.md +0 -41
- data/ext/apex_ext/apex_src/BENCHMARK.md +0 -32
- data/ext/apex_ext/apex_src/BENCHMARK_COMPARISON.md +0 -67
- data/ext/apex_ext/apex_src/CHANGELOG.md +0 -3373
- data/ext/apex_ext/apex_src/CMakeLists.txt +0 -481
- data/ext/apex_ext/apex_src/Dockerfile.linux-build +0 -15
- data/ext/apex_ext/apex_src/Formula/apex.rb +0 -43
- data/ext/apex_ext/apex_src/Info.plist.in +0 -27
- data/ext/apex_ext/apex_src/Package.swift +0 -192
- data/ext/apex_ext/apex_src/PackageSupport/README.md +0 -17
- data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/cmark_gfm_spm_stub.c +0 -4
- data/ext/apex_ext/apex_src/README.md +0 -536
- data/ext/apex_ext/apex_src/ROADMAP.md +0 -5
- data/ext/apex_ext/apex_src/VERSION +0 -1
- data/ext/apex_ext/apex_src/apex-debug.log +0 -4
- data/ext/apex_ext/apex_src/apex-header-2-rb@2x.webp +0 -0
- data/ext/apex_ext/apex_src/apex-plugins.json.example +0 -20
- data/ext/apex_ext/apex_src/apex.code-workspace +0 -38
- data/ext/apex_ext/apex_src/apex.pc.in +0 -11
- data/ext/apex_ext/apex_src/apex.taskpaper +0 -12
- data/ext/apex_ext/apex_src/apex_deflist_debug.log +0 -25
- data/ext/apex_ext/apex_src/buildnotes.md +0 -1435
- data/ext/apex_ext/apex_src/cli/main.c +0 -4588
- data/ext/apex_ext/apex_src/debug.log +0 -7
- data/ext/apex_ext/apex_src/debug_test.sh +0 -22
- data/ext/apex_ext/apex_src/docs/API_REFERENCE.md +0 -451
- data/ext/apex_ext/apex_src/docs/ARCHITECTURE.md +0 -166
- data/ext/apex_ext/apex_src/docs/CITATIONS_EXAMPLES.md +0 -274
- data/ext/apex_ext/apex_src/docs/CITATIONS_IMPLEMENTATION_PLAN.md +0 -749
- data/ext/apex_ext/apex_src/docs/CITATIONS_PLAN.md +0 -744
- data/ext/apex_ext/apex_src/docs/CMARK_INTEGRATION.md +0 -220
- data/ext/apex_ext/apex_src/docs/CRITICMARKUP.md +0 -501
- data/ext/apex_ext/apex_src/docs/DEBUGGING.md +0 -73
- data/ext/apex_ext/apex_src/docs/FINAL_STATUS.md +0 -391
- data/ext/apex_ext/apex_src/docs/FINAL_STATUS_UPDATE.md +0 -237
- data/ext/apex_ext/apex_src/docs/IAL_FEATURES.md +0 -210
- data/ext/apex_ext/apex_src/docs/IAL_STATUS.md +0 -344
- data/ext/apex_ext/apex_src/docs/INDEX_IMPLEMENTATION_ANALYSIS.md +0 -382
- data/ext/apex_ext/apex_src/docs/INTEGRATION_EXAMPLE.m +0 -144
- data/ext/apex_ext/apex_src/docs/LIMITATIONS_RESOLVED.md +0 -278
- data/ext/apex_ext/apex_src/docs/OUTPUT_MODES.md +0 -321
- data/ext/apex_ext/apex_src/docs/PROGRESS.md +0 -167
- data/ext/apex_ext/apex_src/docs/STANDALONE_FEATURE.md +0 -174
- data/ext/apex_ext/apex_src/docs/TABLE_SPANS_STATUS.md +0 -243
- data/ext/apex_ext/apex_src/docs/TEST_COVERAGE.md +0 -316
- data/ext/apex_ext/apex_src/docs/USER_GUIDE.md +0 -803
- data/ext/apex_ext/apex_src/docs/WIKI_LINKS_ISSUE.md +0 -91
- data/ext/apex_ext/apex_src/docs/index.md +0 -459
- data/ext/apex_ext/apex_src/docs/plans/2025-02-27-man-page-output-implementation.md +0 -351
- data/ext/apex_ext/apex_src/docs/superpowers/plans/2026-07-12-toc-output-format.md +0 -745
- data/ext/apex_ext/apex_src/docs/superpowers/plans/2026-07-18-bear-image-attributes.md +0 -829
- data/ext/apex_ext/apex_src/docs/superpowers/plans/2026-07-19-apex-node-npm.md +0 -1148
- data/ext/apex_ext/apex_src/docs/superpowers/specs/2026-07-12-toc-output-format-design.md +0 -161
- data/ext/apex_ext/apex_src/docs/superpowers/specs/2026-07-18-bear-image-attributes-design.md +0 -184
- data/ext/apex_ext/apex_src/docs/superpowers/specs/2026-07-19-apex-node-npm-design.md +0 -211
- data/ext/apex_ext/apex_src/documentation/README.md +0 -160
- data/ext/apex_ext/apex_src/documentation/app-settings-table.md +0 -67
- data/ext/apex_ext/apex_src/documentation/app-transformed/Citations.md +0 -340
- data/ext/apex_ext/apex_src/documentation/app-transformed/Credits.md +0 -11
- data/ext/apex_ext/apex_src/documentation/app-transformed/Header-IDs.md +0 -234
- data/ext/apex_ext/apex_src/documentation/app-transformed/Inline-Attribute-Lists.md +0 -516
- data/ext/apex_ext/apex_src/documentation/app-transformed/Metadata-Transforms.md +0 -461
- data/ext/apex_ext/apex_src/documentation/app-transformed/Modes.md +0 -193
- data/ext/apex_ext/apex_src/documentation/app-transformed/Multi-File-Documents.md +0 -201
- data/ext/apex_ext/apex_src/documentation/app-transformed/Plugins.md +0 -678
- data/ext/apex_ext/apex_src/documentation/app-transformed/Syntax.md +0 -1367
- data/ext/apex_ext/apex_src/documentation/docsets/Apex Command Line Options.cheatsheet.txt +0 -371
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Info.plist +0 -24
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/C-API.html +0 -2211
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Callouts.html +0 -1194
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Citations.html +0 -1620
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Command-Line-Options.html +0 -6024
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Configuration.html +0 -1877
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Credits.html +0 -1040
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Examples.html +0 -1402
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Filters.html +0 -1656
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Generating-Man-Pages.html +0 -1226
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Getting-Started.html +0 -1148
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Header-IDs.html +0 -1478
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Home.html +0 -1225
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Indices.html +0 -2327
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Inline-Attribute-Lists.html +0 -2041
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Installation.html +0 -1314
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Limitations-and-Roadmap.html +0 -1868
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Metadata-Transforms.html +0 -1731
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Modes.html +0 -2242
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Multi-File-Documents.html +0 -1533
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Multi-Format-Images.html +0 -1362
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Pandoc-Integration.html +0 -1338
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Plugins.html +0 -3188
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Quarto-Mode.html +0 -1405
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Rendering-Markdown-In-Terminal.html +0 -1902
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Syntax.html +0 -4222
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Tables.html +0 -1781
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Troubleshooting.html +0 -1629
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Usage.html +0 -1394
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Using-Apex-with-Jekyll.html +0 -1132
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Writing-Tests.html +0 -1754
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Xcode-Integration.html +0 -2562
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/docSet.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/optimizedIndex.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Info.plist +0 -22
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Bold.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Bold_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Extrabold.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Extrabold_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Semibold.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Semibold_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/index.html +0 -914
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/style.css +0 -399
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/docSet.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/optimizedIndex.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/generate_app_docs.rb +0 -772
- data/ext/apex_ext/apex_src/documentation/generate_app_docs_ai.rb +0 -678
- data/ext/apex_ext/apex_src/documentation/generate_docset.rb +0 -873
- data/ext/apex_ext/apex_src/documentation/generate_single_html.rb +0 -733
- data/ext/apex_ext/apex_src/documentation/html/apex-app-docs.html +0 -8746
- data/ext/apex_ext/apex_src/documentation/html/apex-docs.html +0 -17073
- data/ext/apex_ext/apex_src/documentation/shared_scripts.js +0 -64
- data/ext/apex_ext/apex_src/documentation/shared_styles.css +0 -651
- data/ext/apex_ext/apex_src/documentation/transform_for_app.example.md +0 -260
- data/ext/apex_ext/apex_src/documentation/transform_for_app.md +0 -55
- data/ext/apex_ext/apex_src/escaping-repro.md +0 -103
- data/ext/apex_ext/apex_src/examples/bracketed_spans_demo.md +0 -119
- data/ext/apex_ext/apex_src/examples/emoji_span_plugin.yml +0 -11
- data/ext/apex_ext/apex_src/examples/example.html +0 -53
- data/ext/apex_ext/apex_src/examples/example.md +0 -85
- data/ext/apex_ext/apex_src/examples/fenced_divs_demo.md +0 -158
- data/ext/apex_ext/apex_src/examples/kbd.md +0 -8
- data/ext/apex_ext/apex_src/examples/kbd_plugin.rb +0 -250
- data/ext/apex_ext/apex_src/examples/kbd_plugin.yml +0 -9
- data/ext/apex_ext/apex_src/examples/quick-actions/Markdown to RTF.workflow/Contents/Info.plist +0 -8
- data/ext/apex_ext/apex_src/examples/quick-actions/Markdown to RTF.workflow/Contents/QuickLook/Preview.png +0 -0
- data/ext/apex_ext/apex_src/examples/quick-actions/Markdown to RTF.workflow/Contents/document.wflow +0 -547
- data/ext/apex_ext/apex_src/examples/quick-actions/Markdown-to-RTF.workflow.zip +0 -0
- data/ext/apex_ext/apex_src/examples/quick-actions/README.md +0 -33
- data/ext/apex_ext/apex_src/ial.html +0 -24
- data/ext/apex_ext/apex_src/icon/apexicon-outline-black.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-black@2x.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-mark.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-mark@2x.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-white.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-white@2x.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon@2x.png +0 -0
- data/ext/apex_ext/apex_src/man/apex-config.5 +0 -455
- data/ext/apex_ext/apex_src/man/apex-config.5.md +0 -262
- data/ext/apex_ext/apex_src/man/apex-plugins.7 +0 -541
- data/ext/apex_ext/apex_src/man/apex-plugins.7.md +0 -365
- data/ext/apex_ext/apex_src/man/apex.1 +0 -583
- data/ext/apex_ext/apex_src/man/apex.1.html +0 -703
- data/ext/apex_ext/apex_src/man/apex.1.md +0 -803
- data/ext/apex_ext/apex_src/man/apex.1.new +0 -338
- data/ext/apex_ext/apex_src/objc/Apex.swift +0 -316
- data/ext/apex_ext/apex_src/objc/ApexPlugins.swift +0 -79
- data/ext/apex_ext/apex_src/objc/NSString+Apex.h +0 -207
- data/ext/apex_ext/apex_src/objc/NSString+Apex.m +0 -584
- data/ext/apex_ext/apex_src/objc/NSString+ApexPlugins.h +0 -76
- data/ext/apex_ext/apex_src/objc/NSString+ApexPlugins.m +0 -169
- data/ext/apex_ext/apex_src/output.html +0 -87
- data/ext/apex_ext/apex_src/pages/index.md +0 -459
- data/ext/apex_ext/apex_src/plans/quarto-mode.md +0 -442
- data/ext/apex_ext/apex_src/src/_README.md +0 -413
- data/ext/apex_ext/apex_src/src/extensions/github-emoji.txt +0 -869
- data/ext/apex_ext/apex_src/test-linux-build.sh +0 -20
- data/ext/apex_ext/apex_src/test.html +0 -103
- data/ext/apex_ext/apex_src/test_coverage.sh +0 -121
- data/ext/apex_ext/apex_src/test_ial_fenced.md +0 -6
- data/ext/apex_ext/apex_src/test_math_norm.py +0 -79
- data/ext/apex_ext/apex_src/test_pandoc_output.html +0 -48
- data/ext/apex_ext/apex_src/test_spm.sh +0 -107
- data/ext/apex_ext/apex_src/tests/ApexSPMTest/main.swift +0 -50
- data/ext/apex_ext/apex_src/tests/BENCHMARK_RESULTS.md +0 -229
- data/ext/apex_ext/apex_src/tests/CMakeLists.txt +0 -25
- data/ext/apex_ext/apex_src/tests/README.md +0 -152
- data/ext/apex_ext/apex_src/tests/benchmark.sh +0 -113
- data/ext/apex_ext/apex_src/tests/benchmark_comparison.sh +0 -166
- data/ext/apex_ext/apex_src/tests/compare_header_ids.sh +0 -31
- data/ext/apex_ext/apex_src/tests/fixtures/basic/headers.md +0 -25
- data/ext/apex_ext/apex_src/tests/fixtures/basic/list-interruption.md +0 -24
- data/ext/apex_ext/apex_src/tests/fixtures/basic/misc_markup.md +0 -33
- data/ext/apex_ext/apex_src/tests/fixtures/basic/test_basic.md +0 -26
- data/ext/apex_ext/apex_src/tests/fixtures/code/code-blocks.md +0 -260
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/SUMMARY.md +0 -6
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/chapter1.md +0 -7
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/index.txt +0 -9
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/intro.md +0 -5
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/section1_1.md +0 -5
- data/ext/apex_ext/apex_src/tests/fixtures/comprehensive_test.md +0 -652
- data/ext/apex_ext/apex_src/tests/fixtures/debug_ref_image_ial.md +0 -3
- data/ext/apex_ext/apex_src/tests/fixtures/demos/ial.md +0 -11
- data/ext/apex_ext/apex_src/tests/fixtures/demos/ial_demo.md +0 -177
- data/ext/apex_ext/apex_src/tests/fixtures/extensions/emoji-autocorrect.md +0 -94
- data/ext/apex_ext/apex_src/tests/fixtures/extensions/emoji_test.md +0 -3
- data/ext/apex_ext/apex_src/tests/fixtures/extensions/kbd_test.md +0 -3
- data/ext/apex_ext/apex_src/tests/fixtures/filters/filter_output_with_rawblock.json +0 -1
- data/ext/apex_ext/apex_src/tests/fixtures/filters/unwrap.md +0 -7
- data/ext/apex_ext/apex_src/tests/fixtures/ial/bracketed_spans_test.md +0 -74
- data/ext/apex_ext/apex_src/tests/fixtures/images/auto-wildcard.md +0 -8
- data/ext/apex_ext/apex_src/tests/fixtures/images/bear_image_attributes.md +0 -10
- data/ext/apex_ext/apex_src/tests/fixtures/images/image_and_encoding_test.md +0 -27
- data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu.avif +0 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu.jpg +0 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu.webp +0 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu@2x.avif +0 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu@2x.jpg +0 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu@2x.webp +0 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/media_formats_test.md +0 -63
- data/ext/apex_ext/apex_src/tests/fixtures/images/multimarkdown_image_attributes_test.md +0 -60
- data/ext/apex_ext/apex_src/tests/fixtures/images/pandoc_ial_image_test.md +0 -27
- data/ext/apex_ext/apex_src/tests/fixtures/images/width_height_conversion_test.md +0 -94
- data/ext/apex_ext/apex_src/tests/fixtures/img-in-div.md +0 -16
- data/ext/apex_ext/apex_src/tests/fixtures/includes/code.py +0 -4
- data/ext/apex_ext/apex_src/tests/fixtures/includes/data-semi.csv +0 -3
- data/ext/apex_ext/apex_src/tests/fixtures/includes/data.csv +0 -5
- data/ext/apex_ext/apex_src/tests/fixtures/includes/data.tsv +0 -5
- data/ext/apex_ext/apex_src/tests/fixtures/includes/image.png +0 -2
- data/ext/apex_ext/apex_src/tests/fixtures/includes/metadata_options.yml +0 -11
- data/ext/apex_ext/apex_src/tests/fixtures/includes/nested.md +0 -8
- data/ext/apex_ext/apex_src/tests/fixtures/includes/raw.html +0 -4
- data/ext/apex_ext/apex_src/tests/fixtures/includes/sections.md +0 -19
- data/ext/apex_ext/apex_src/tests/fixtures/includes/sections.txt +0 -11
- data/ext/apex_ext/apex_src/tests/fixtures/includes/simple.md +0 -7
- data/ext/apex_ext/apex_src/tests/fixtures/includes/test_image.png +0 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/with space.txt +0 -1
- data/ext/apex_ext/apex_src/tests/fixtures/large_doc.md +0 -1094
- data/ext/apex_ext/apex_src/tests/fixtures/metadata/mmd-metadata.md +0 -5
- data/ext/apex_ext/apex_src/tests/fixtures/metadata/pandoc-meta.md +0 -4
- data/ext/apex_ext/apex_src/tests/fixtures/metadata/yaml-frontmatter.md +0 -6
- data/ext/apex_ext/apex_src/tests/fixtures/metadata_options.yml +0 -11
- data/ext/apex_ext/apex_src/tests/fixtures/minimal_pb.md +0 -2
- data/ext/apex_ext/apex_src/tests/fixtures/obsidian-callouts.md +0 -46
- data/ext/apex_ext/apex_src/tests/fixtures/output/gfm_header_id_test.md +0 -96
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_citations.md +0 -43
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_def_list_links.md +0 -12
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_index_mmark.md +0 -53
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_index_textindex.md +0 -37
- data/ext/apex_ext/apex_src/tests/fixtures/pagebreak_html_repro.md +0 -5
- data/ext/apex_ext/apex_src/tests/fixtures/python-callouts.md +0 -47
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/callouts.md +0 -3
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/code-attrs.md +0 -3
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/diagrams.md +0 -8
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/lists.md +0 -19
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/raw-content.md +0 -5
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/shortcodes.md +0 -7
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/smoke.md +0 -81
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/spans.md +0 -5
- data/ext/apex_ext/apex_src/tests/fixtures/quarto-callouts.md +0 -47
- data/ext/apex_ext/apex_src/tests/fixtures/speed.md +0 -192
- data/ext/apex_ext/apex_src/tests/fixtures/tables/advanced_tables_test.md +0 -93
- data/ext/apex_ext/apex_src/tests/fixtures/tables/grid-tables.md +0 -37
- data/ext/apex_ext/apex_src/tests/fixtures/tables/inline_tables_test.md +0 -41
- data/ext/apex_ext/apex_src/tests/fixtures/tables/relaxed-table.md +0 -12
- data/ext/apex_ext/apex_src/tests/fixtures/tables/table_cr_line_endings.md +0 -15
- data/ext/apex_ext/apex_src/tests/fixtures/tables/table_no_trailing_newline.md +0 -15
- data/ext/apex_ext/apex_src/tests/generate_gfm_ids.sh +0 -105
- data/ext/apex_ext/apex_src/tests/generate_ial_demo.sh +0 -143
- data/ext/apex_ext/apex_src/tests/gfm_id_comparison_summary.md +0 -96
- data/ext/apex_ext/apex_src/tests/gh_api_test.md +0 -6
- data/ext/apex_ext/apex_src/tests/ial_demo.html +0 -186
- data/ext/apex_ext/apex_src/tests/include_code.py +0 -19
- data/ext/apex_ext/apex_src/tests/include_snippet.md +0 -15
- data/ext/apex_ext/apex_src/tests/metadata_cli_test.sh +0 -119
- data/ext/apex_ext/apex_src/tests/multi_file_cli_test.sh +0 -64
- data/ext/apex_ext/apex_src/tests/paginate_cli_test.sh +0 -80
- data/ext/apex_ext/apex_src/tests/sample_data.csv +0 -7
- data/ext/apex_ext/apex_src/tests/table_escaped_ltlt.md +0 -4
- data/ext/apex_ext/apex_src/tests/terminal_width_test.sh +0 -29
- data/ext/apex_ext/apex_src/tests/test-swift-package.sh +0 -14
- data/ext/apex_ext/apex_src/tests/test_basic.c +0 -74
- data/ext/apex_ext/apex_src/tests/test_bear_image_attrs.c +0 -301
- data/ext/apex_ext/apex_src/tests/test_cmark_callback.c +0 -189
- data/ext/apex_ext/apex_src/tests/test_concordance.tsv +0 -4
- data/ext/apex_ext/apex_src/tests/test_custom_plugins.c +0 -78
- data/ext/apex_ext/apex_src/tests/test_escaping_repro.c +0 -82
- data/ext/apex_ext/apex_src/tests/test_extensions.c +0 -3337
- data/ext/apex_ext/apex_src/tests/test_helpers.c +0 -183
- data/ext/apex_ext/apex_src/tests/test_helpers.h +0 -91
- data/ext/apex_ext/apex_src/tests/test_ial.c +0 -289
- data/ext/apex_ext/apex_src/tests/test_links.c +0 -418
- data/ext/apex_ext/apex_src/tests/test_marked_integration.c +0 -290
- data/ext/apex_ext/apex_src/tests/test_metadata.c +0 -1147
- data/ext/apex_ext/apex_src/tests/test_output.c +0 -2056
- data/ext/apex_ext/apex_src/tests/test_plugins.c +0 -219
- data/ext/apex_ext/apex_src/tests/test_refs.bib +0 -31
- data/ext/apex_ext/apex_src/tests/test_runner.c +0 -268
- data/ext/apex_ext/apex_src/tests/test_syntax_highlight.c +0 -198
- data/ext/apex_ext/apex_src/tests/test_tables.c +0 -1298
- data/ext/apex_ext/apex_src/tests/update_benchmarks.sh +0 -9
- data/ext/apex_ext/apex_src/tests/yaml_test.md +0 -13
- data/ext/apex_ext/apex_src/tests.rb +0 -39
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/CMakeLists.txt +0 -48
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/CheckFileOffsetBits.c +0 -14
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/CheckFileOffsetBits.cmake +0 -43
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/FindAsan.cmake +0 -74
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/Makefile.nmake +0 -38
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/README.md +0 -206
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/CMakeLists.txt +0 -30
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/cplusplus.cpp +0 -15
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/cplusplus.h +0 -16
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/harness.c +0 -111
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/harness.h +0 -35
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/main.c +0 -1169
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/appveyor.yml +0 -21
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-bq-flat.md +0 -16
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-bq-nested.md +0 -13
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-code.md +0 -11
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-fences.md +0 -14
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-heading.md +0 -9
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-hr.md +0 -10
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-html.md +0 -32
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-lheading.md +0 -8
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-list-flat.md +0 -67
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-list-nested.md +0 -36
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-ref-flat.md +0 -15
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-ref-nested.md +0 -17
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-autolink.md +0 -14
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-backticks.md +0 -3
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-flat.md +0 -5
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-nested.md +0 -5
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-worst.md +0 -5
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-entity.md +0 -11
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-escape.md +0 -15
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-html.md +0 -44
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-links-flat.md +0 -23
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-links-nested.md +0 -13
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-newlines.md +0 -24
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/lorem1.md +0 -13
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/rawtabs.md +0 -18
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/statistics.py +0 -595
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/stats.py +0 -19
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/benchmarks.md +0 -33
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/changelog.txt +0 -1245
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/data/CaseFolding.txt +0 -1495
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/CMakeLists.txt +0 -119
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/ext_scanners.re +0 -92
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/CMakeLists.txt +0 -22
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/README.md +0 -12
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzz_quadratic.c +0 -91
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzz_quadratic_brackets.c +0 -110
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzzloop.sh +0 -28
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/CMakeLists.txt +0 -10
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/make_man_page.py +0 -133
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/man1/cmark-gfm.1 +0 -78
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/man3/cmark-gfm.3 +0 -1041
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/nmake.bat +0 -1
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/CMakeLists.txt +0 -230
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark-gfm_version.h.in +0 -7
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/config.h +0 -38
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/config.h.in +0 -76
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/libcmark-gfm.pc.in +0 -10
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/scanners.re +0 -365
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/suppressions +0 -10
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/CMakeLists.txt +0 -114
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/__pycache__/cmark.cpython-314.pyc +0 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/__pycache__/normalize.cpython-314.pyc +0 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/afl_test_cases/test.md +0 -49
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/cmark-fuzz.c +0 -58
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/cmark.py +0 -105
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/entity_tests.py +0 -67
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions-full-info-string.txt +0 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions-table-prefer-style-attributes.txt +0 -38
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions.txt +0 -989
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/fuzzing_dictionary +0 -67
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/normalize.py +0 -194
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/pathological_tests.py +0 -160
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/regression.txt +0 -375
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/roundtrip_tests.py +0 -50
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/run-cmark-fuzz +0 -4
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/smart_punct.txt +0 -177
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/spec.txt +0 -10212
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/spec_tests.py +0 -152
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/toolchain-mingw32.cmake +0 -17
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/Dockerfile +0 -41
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/appveyor-build.bat +0 -13
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/make_entities_inc.py +0 -32
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/mkcasefold.pl +0 -22
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/xml2md.xsl +0 -319
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/xml2md_gfm.xsl +0 -80
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/why-cmark-and-not-x.md +0 -104
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.js +0 -6
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.py +0 -37
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.rb +0 -15
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.rkt +0 -208
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper_ext.py +0 -109
- data/ext/apex_ext/apex_src/vendor/libyaml/CMakeLists.txt +0 -160
- data/ext/apex_ext/apex_src/vendor/libyaml/Changes +0 -372
- data/ext/apex_ext/apex_src/vendor/libyaml/License +0 -20
- data/ext/apex_ext/apex_src/vendor/libyaml/Makefile.am +0 -51
- data/ext/apex_ext/apex_src/vendor/libyaml/ReadMe.md +0 -46
- data/ext/apex_ext/apex_src/vendor/libyaml/announcement.msg +0 -89
- data/ext/apex_ext/apex_src/vendor/libyaml/bootstrap +0 -3
- data/ext/apex_ext/apex_src/vendor/libyaml/cmake/config.h.in +0 -4
- data/ext/apex_ext/apex_src/vendor/libyaml/configure.ac +0 -73
- data/ext/apex_ext/apex_src/vendor/libyaml/doc/doxygen.cfg +0 -222
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/README.mkd +0 -17
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/alpine-3.7 +0 -26
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/fedora-25 +0 -26
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/ubuntu-14.04 +0 -29
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/ubuntu-16.04 +0 -24
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/anchors.yaml +0 -10
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/array.yaml +0 -2
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/global-tag.yaml +0 -14
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/json.yaml +0 -1
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/mapping.yaml +0 -2
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/numbers.yaml +0 -1
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/strings.yaml +0 -7
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/tags.yaml +0 -7
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/yaml-version.yaml +0 -3
- data/ext/apex_ext/apex_src/vendor/libyaml/include/Makefile.am +0 -17
- data/ext/apex_ext/apex_src/vendor/libyaml/include/yaml.h +0 -1999
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/ReadMe.md +0 -77
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/Dockerfile +0 -32
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/output/ReadMe +0 -1
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/scripts/libyaml-dist.sh +0 -23
- data/ext/apex_ext/apex_src/vendor/libyaml/regression-inputs/clusterfuzz-testcase-minimized-5607885063061504.yml +0 -1
- data/ext/apex_ext/apex_src/vendor/libyaml/src/Makefile.am +0 -4
- data/ext/apex_ext/apex_src/vendor/libyaml/src/api.c +0 -1393
- data/ext/apex_ext/apex_src/vendor/libyaml/src/dumper.c +0 -394
- data/ext/apex_ext/apex_src/vendor/libyaml/src/emitter.c +0 -2358
- data/ext/apex_ext/apex_src/vendor/libyaml/src/loader.c +0 -544
- data/ext/apex_ext/apex_src/vendor/libyaml/src/parser.c +0 -1416
- data/ext/apex_ext/apex_src/vendor/libyaml/src/reader.c +0 -469
- data/ext/apex_ext/apex_src/vendor/libyaml/src/scanner.c +0 -3598
- data/ext/apex_ext/apex_src/vendor/libyaml/src/writer.c +0 -141
- data/ext/apex_ext/apex_src/vendor/libyaml/src/yaml_private.h +0 -684
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/CMakeLists.txt +0 -27
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/Makefile.am +0 -9
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/ReadMe.md +0 -63
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-deconstructor-alt.c +0 -800
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-deconstructor.c +0 -1127
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-reformatter-alt.c +0 -217
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-reformatter.c +0 -202
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-all-tests.sh +0 -29
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-dumper.c +0 -314
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-emitter-test-suite.c +0 -290
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-emitter.c +0 -327
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-loader.c +0 -63
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-parser-test-suite.c +0 -196
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-parser.c +0 -88
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-scanner.c +0 -63
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/test-reader.c +0 -354
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/test-version.c +0 -29
- data/ext/apex_ext/apex_src/vendor/libyaml/yaml-0.1.pc.in +0 -10
- data/ext/apex_ext/apex_src/vendor/libyaml/yamlConfig.cmake.in +0 -16
- data/ext/apex_ext/apex_src/xcode_build/CMakeScripts/ReRunCMake.make +0 -74
- data/ext/apex_ext/apex_src/xcode_build/CTestTestfile.cmake +0 -22
- data/ext/apex_ext/apex_src/xcode_build/Debug/Apex.framework/Versions/A/Apex +0 -0
- data/ext/apex_ext/apex_src/xcode_build/Debug/Apex.framework/Versions/A/Resources/Info.plist +0 -44
- data/ext/apex_ext/apex_src/xcode_build/Debug/Apex.framework/Versions/A/_CodeSignature/CodeResources +0 -128
- data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.pbxproj +0 -5118
- data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +0 -8
- data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.xcworkspace/xcuserdata/ttscoff.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.xcworkspace/xcuserdata/ttscoff.xcuserdatad/WorkspaceSettings.xcsettings +0 -8
- data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/xcuserdata/ttscoff.xcuserdatad/xcschemes/xcschememanagement.plist +0 -99
- data/ext/apex_ext/apex_src/xcode_build/cmake_install.cmake +0 -452
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/CMakeScripts/ReRunCMake.make +0 -52
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/cmake_install.cmake +0 -55
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/cmark-gfm.xcodeproj/project.pbxproj +0 -2455
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/cmark-gfm.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +0 -8
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/extensions/cmake_install.cmake +0 -171
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/man/cmake_install.cmake +0 -55
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/cmake_install.cmake +0 -220
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/cmark-gfm_export.h +0 -43
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/cmark-gfm_version.h +0 -7
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/config.h +0 -76
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/libcmark-gfm.pc +0 -10
|
@@ -1,1416 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/*
|
|
3
|
-
* The parser implements the following grammar:
|
|
4
|
-
*
|
|
5
|
-
* stream ::= STREAM-START implicit_document? explicit_document* STREAM-END
|
|
6
|
-
* implicit_document ::= block_node DOCUMENT-END*
|
|
7
|
-
* explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
|
|
8
|
-
* block_node_or_indentless_sequence ::=
|
|
9
|
-
* ALIAS
|
|
10
|
-
* | properties (block_content | indentless_block_sequence)?
|
|
11
|
-
* | block_content
|
|
12
|
-
* | indentless_block_sequence
|
|
13
|
-
* block_node ::= ALIAS
|
|
14
|
-
* | properties block_content?
|
|
15
|
-
* | block_content
|
|
16
|
-
* flow_node ::= ALIAS
|
|
17
|
-
* | properties flow_content?
|
|
18
|
-
* | flow_content
|
|
19
|
-
* properties ::= TAG ANCHOR? | ANCHOR TAG?
|
|
20
|
-
* block_content ::= block_collection | flow_collection | SCALAR
|
|
21
|
-
* flow_content ::= flow_collection | SCALAR
|
|
22
|
-
* block_collection ::= block_sequence | block_mapping
|
|
23
|
-
* flow_collection ::= flow_sequence | flow_mapping
|
|
24
|
-
* block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END
|
|
25
|
-
* indentless_sequence ::= (BLOCK-ENTRY block_node?)+
|
|
26
|
-
* block_mapping ::= BLOCK-MAPPING_START
|
|
27
|
-
* ((KEY block_node_or_indentless_sequence?)?
|
|
28
|
-
* (VALUE block_node_or_indentless_sequence?)?)*
|
|
29
|
-
* BLOCK-END
|
|
30
|
-
* flow_sequence ::= FLOW-SEQUENCE-START
|
|
31
|
-
* (flow_sequence_entry FLOW-ENTRY)*
|
|
32
|
-
* flow_sequence_entry?
|
|
33
|
-
* FLOW-SEQUENCE-END
|
|
34
|
-
* flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
|
|
35
|
-
* flow_mapping ::= FLOW-MAPPING-START
|
|
36
|
-
* (flow_mapping_entry FLOW-ENTRY)*
|
|
37
|
-
* flow_mapping_entry?
|
|
38
|
-
* FLOW-MAPPING-END
|
|
39
|
-
* flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
#include "yaml_private.h"
|
|
43
|
-
|
|
44
|
-
/*
|
|
45
|
-
* Peek the next token in the token queue.
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
#define PEEK_TOKEN(parser) \
|
|
49
|
-
((parser->token_available || yaml_parser_fetch_more_tokens(parser)) ? \
|
|
50
|
-
parser->tokens.head : NULL)
|
|
51
|
-
|
|
52
|
-
/*
|
|
53
|
-
* Remove the next token from the queue (must be called after PEEK_TOKEN).
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
#define SKIP_TOKEN(parser) \
|
|
57
|
-
(parser->token_available = 0, \
|
|
58
|
-
parser->tokens_parsed ++, \
|
|
59
|
-
parser->stream_end_produced = \
|
|
60
|
-
(parser->tokens.head->type == YAML_STREAM_END_TOKEN), \
|
|
61
|
-
parser->tokens.head ++)
|
|
62
|
-
|
|
63
|
-
/*
|
|
64
|
-
* Public API declarations.
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
int MAX_NESTING_LEVEL = 1000;
|
|
68
|
-
|
|
69
|
-
YAML_DECLARE(int)
|
|
70
|
-
yaml_parser_parse(yaml_parser_t *parser, yaml_event_t *event);
|
|
71
|
-
|
|
72
|
-
/*
|
|
73
|
-
* Error handling.
|
|
74
|
-
*/
|
|
75
|
-
|
|
76
|
-
static int
|
|
77
|
-
yaml_parser_set_parser_error(yaml_parser_t *parser,
|
|
78
|
-
const char *problem, yaml_mark_t problem_mark);
|
|
79
|
-
|
|
80
|
-
static int
|
|
81
|
-
yaml_parser_set_parser_error_context(yaml_parser_t *parser,
|
|
82
|
-
const char *context, yaml_mark_t context_mark,
|
|
83
|
-
const char *problem, yaml_mark_t problem_mark);
|
|
84
|
-
|
|
85
|
-
static int
|
|
86
|
-
yaml_maximum_level_reached(yaml_parser_t *parser,
|
|
87
|
-
yaml_mark_t context_mark, yaml_mark_t problem_mark);
|
|
88
|
-
|
|
89
|
-
/*
|
|
90
|
-
* State functions.
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
static int
|
|
94
|
-
yaml_parser_state_machine(yaml_parser_t *parser, yaml_event_t *event);
|
|
95
|
-
|
|
96
|
-
static int
|
|
97
|
-
yaml_parser_parse_stream_start(yaml_parser_t *parser, yaml_event_t *event);
|
|
98
|
-
|
|
99
|
-
static int
|
|
100
|
-
yaml_parser_parse_document_start(yaml_parser_t *parser, yaml_event_t *event,
|
|
101
|
-
int implicit);
|
|
102
|
-
|
|
103
|
-
static int
|
|
104
|
-
yaml_parser_parse_document_content(yaml_parser_t *parser, yaml_event_t *event);
|
|
105
|
-
|
|
106
|
-
static int
|
|
107
|
-
yaml_parser_parse_document_end(yaml_parser_t *parser, yaml_event_t *event);
|
|
108
|
-
|
|
109
|
-
static int
|
|
110
|
-
yaml_parser_parse_node(yaml_parser_t *parser, yaml_event_t *event,
|
|
111
|
-
int block, int indentless_sequence);
|
|
112
|
-
|
|
113
|
-
static int
|
|
114
|
-
yaml_parser_parse_block_sequence_entry(yaml_parser_t *parser,
|
|
115
|
-
yaml_event_t *event, int first);
|
|
116
|
-
|
|
117
|
-
static int
|
|
118
|
-
yaml_parser_parse_indentless_sequence_entry(yaml_parser_t *parser,
|
|
119
|
-
yaml_event_t *event);
|
|
120
|
-
|
|
121
|
-
static int
|
|
122
|
-
yaml_parser_parse_block_mapping_key(yaml_parser_t *parser,
|
|
123
|
-
yaml_event_t *event, int first);
|
|
124
|
-
|
|
125
|
-
static int
|
|
126
|
-
yaml_parser_parse_block_mapping_value(yaml_parser_t *parser,
|
|
127
|
-
yaml_event_t *event);
|
|
128
|
-
|
|
129
|
-
static int
|
|
130
|
-
yaml_parser_parse_flow_sequence_entry(yaml_parser_t *parser,
|
|
131
|
-
yaml_event_t *event, int first);
|
|
132
|
-
|
|
133
|
-
static int
|
|
134
|
-
yaml_parser_parse_flow_sequence_entry_mapping_key(yaml_parser_t *parser,
|
|
135
|
-
yaml_event_t *event);
|
|
136
|
-
|
|
137
|
-
static int
|
|
138
|
-
yaml_parser_parse_flow_sequence_entry_mapping_value(yaml_parser_t *parser,
|
|
139
|
-
yaml_event_t *event);
|
|
140
|
-
|
|
141
|
-
static int
|
|
142
|
-
yaml_parser_parse_flow_sequence_entry_mapping_end(yaml_parser_t *parser,
|
|
143
|
-
yaml_event_t *event);
|
|
144
|
-
|
|
145
|
-
static int
|
|
146
|
-
yaml_parser_parse_flow_mapping_key(yaml_parser_t *parser,
|
|
147
|
-
yaml_event_t *event, int first);
|
|
148
|
-
|
|
149
|
-
static int
|
|
150
|
-
yaml_parser_parse_flow_mapping_value(yaml_parser_t *parser,
|
|
151
|
-
yaml_event_t *event, int empty);
|
|
152
|
-
|
|
153
|
-
/*
|
|
154
|
-
* Utility functions.
|
|
155
|
-
*/
|
|
156
|
-
|
|
157
|
-
static int
|
|
158
|
-
yaml_parser_process_empty_scalar(yaml_parser_t *parser,
|
|
159
|
-
yaml_event_t *event, yaml_mark_t mark);
|
|
160
|
-
|
|
161
|
-
static int
|
|
162
|
-
yaml_parser_process_directives(yaml_parser_t *parser,
|
|
163
|
-
yaml_version_directive_t **version_directive_ref,
|
|
164
|
-
yaml_tag_directive_t **tag_directives_start_ref,
|
|
165
|
-
yaml_tag_directive_t **tag_directives_end_ref);
|
|
166
|
-
|
|
167
|
-
static int
|
|
168
|
-
yaml_parser_append_tag_directive(yaml_parser_t *parser,
|
|
169
|
-
yaml_tag_directive_t value, int allow_duplicates, yaml_mark_t mark);
|
|
170
|
-
|
|
171
|
-
YAML_DECLARE(void)
|
|
172
|
-
yaml_set_max_nest_level(int max)
|
|
173
|
-
{
|
|
174
|
-
MAX_NESTING_LEVEL = max;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/*
|
|
178
|
-
* Get the next event.
|
|
179
|
-
*/
|
|
180
|
-
|
|
181
|
-
YAML_DECLARE(int)
|
|
182
|
-
yaml_parser_parse(yaml_parser_t *parser, yaml_event_t *event)
|
|
183
|
-
{
|
|
184
|
-
assert(parser); /* Non-NULL parser object is expected. */
|
|
185
|
-
assert(event); /* Non-NULL event object is expected. */
|
|
186
|
-
|
|
187
|
-
/* Erase the event object. */
|
|
188
|
-
|
|
189
|
-
memset(event, 0, sizeof(yaml_event_t));
|
|
190
|
-
|
|
191
|
-
/* No events after the end of the stream or error. */
|
|
192
|
-
|
|
193
|
-
if (parser->stream_end_produced || parser->error ||
|
|
194
|
-
parser->state == YAML_PARSE_END_STATE) {
|
|
195
|
-
return 1;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/* Generate the next event. */
|
|
199
|
-
|
|
200
|
-
return yaml_parser_state_machine(parser, event);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/*
|
|
204
|
-
* Set parser error.
|
|
205
|
-
*/
|
|
206
|
-
|
|
207
|
-
static int
|
|
208
|
-
yaml_parser_set_parser_error(yaml_parser_t *parser,
|
|
209
|
-
const char *problem, yaml_mark_t problem_mark)
|
|
210
|
-
{
|
|
211
|
-
parser->error = YAML_PARSER_ERROR;
|
|
212
|
-
parser->problem = problem;
|
|
213
|
-
parser->problem_mark = problem_mark;
|
|
214
|
-
|
|
215
|
-
return 0;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
static int
|
|
219
|
-
yaml_parser_set_parser_error_context(yaml_parser_t *parser,
|
|
220
|
-
const char *context, yaml_mark_t context_mark,
|
|
221
|
-
const char *problem, yaml_mark_t problem_mark)
|
|
222
|
-
{
|
|
223
|
-
parser->error = YAML_PARSER_ERROR;
|
|
224
|
-
parser->context = context;
|
|
225
|
-
parser->context_mark = context_mark;
|
|
226
|
-
parser->problem = problem;
|
|
227
|
-
parser->problem_mark = problem_mark;
|
|
228
|
-
|
|
229
|
-
return 0;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
static int
|
|
233
|
-
yaml_maximum_level_reached(yaml_parser_t *parser,
|
|
234
|
-
yaml_mark_t context_mark, yaml_mark_t problem_mark)
|
|
235
|
-
{
|
|
236
|
-
yaml_parser_set_parser_error_context(parser,
|
|
237
|
-
"while parsing", context_mark, "Maximum nesting level reached, set with yaml_set_max_nest_level())", problem_mark);
|
|
238
|
-
return 0;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/*
|
|
242
|
-
* State dispatcher.
|
|
243
|
-
*/
|
|
244
|
-
|
|
245
|
-
static int
|
|
246
|
-
yaml_parser_state_machine(yaml_parser_t *parser, yaml_event_t *event)
|
|
247
|
-
{
|
|
248
|
-
switch (parser->state)
|
|
249
|
-
{
|
|
250
|
-
case YAML_PARSE_STREAM_START_STATE:
|
|
251
|
-
return yaml_parser_parse_stream_start(parser, event);
|
|
252
|
-
|
|
253
|
-
case YAML_PARSE_IMPLICIT_DOCUMENT_START_STATE:
|
|
254
|
-
return yaml_parser_parse_document_start(parser, event, 1);
|
|
255
|
-
|
|
256
|
-
case YAML_PARSE_DOCUMENT_START_STATE:
|
|
257
|
-
return yaml_parser_parse_document_start(parser, event, 0);
|
|
258
|
-
|
|
259
|
-
case YAML_PARSE_DOCUMENT_CONTENT_STATE:
|
|
260
|
-
return yaml_parser_parse_document_content(parser, event);
|
|
261
|
-
|
|
262
|
-
case YAML_PARSE_DOCUMENT_END_STATE:
|
|
263
|
-
return yaml_parser_parse_document_end(parser, event);
|
|
264
|
-
|
|
265
|
-
case YAML_PARSE_BLOCK_NODE_STATE:
|
|
266
|
-
return yaml_parser_parse_node(parser, event, 1, 0);
|
|
267
|
-
|
|
268
|
-
case YAML_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE:
|
|
269
|
-
return yaml_parser_parse_node(parser, event, 1, 1);
|
|
270
|
-
|
|
271
|
-
case YAML_PARSE_FLOW_NODE_STATE:
|
|
272
|
-
return yaml_parser_parse_node(parser, event, 0, 0);
|
|
273
|
-
|
|
274
|
-
case YAML_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE:
|
|
275
|
-
return yaml_parser_parse_block_sequence_entry(parser, event, 1);
|
|
276
|
-
|
|
277
|
-
case YAML_PARSE_BLOCK_SEQUENCE_ENTRY_STATE:
|
|
278
|
-
return yaml_parser_parse_block_sequence_entry(parser, event, 0);
|
|
279
|
-
|
|
280
|
-
case YAML_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE:
|
|
281
|
-
return yaml_parser_parse_indentless_sequence_entry(parser, event);
|
|
282
|
-
|
|
283
|
-
case YAML_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE:
|
|
284
|
-
return yaml_parser_parse_block_mapping_key(parser, event, 1);
|
|
285
|
-
|
|
286
|
-
case YAML_PARSE_BLOCK_MAPPING_KEY_STATE:
|
|
287
|
-
return yaml_parser_parse_block_mapping_key(parser, event, 0);
|
|
288
|
-
|
|
289
|
-
case YAML_PARSE_BLOCK_MAPPING_VALUE_STATE:
|
|
290
|
-
return yaml_parser_parse_block_mapping_value(parser, event);
|
|
291
|
-
|
|
292
|
-
case YAML_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE:
|
|
293
|
-
return yaml_parser_parse_flow_sequence_entry(parser, event, 1);
|
|
294
|
-
|
|
295
|
-
case YAML_PARSE_FLOW_SEQUENCE_ENTRY_STATE:
|
|
296
|
-
return yaml_parser_parse_flow_sequence_entry(parser, event, 0);
|
|
297
|
-
|
|
298
|
-
case YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE:
|
|
299
|
-
return yaml_parser_parse_flow_sequence_entry_mapping_key(parser, event);
|
|
300
|
-
|
|
301
|
-
case YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE:
|
|
302
|
-
return yaml_parser_parse_flow_sequence_entry_mapping_value(parser, event);
|
|
303
|
-
|
|
304
|
-
case YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE:
|
|
305
|
-
return yaml_parser_parse_flow_sequence_entry_mapping_end(parser, event);
|
|
306
|
-
|
|
307
|
-
case YAML_PARSE_FLOW_MAPPING_FIRST_KEY_STATE:
|
|
308
|
-
return yaml_parser_parse_flow_mapping_key(parser, event, 1);
|
|
309
|
-
|
|
310
|
-
case YAML_PARSE_FLOW_MAPPING_KEY_STATE:
|
|
311
|
-
return yaml_parser_parse_flow_mapping_key(parser, event, 0);
|
|
312
|
-
|
|
313
|
-
case YAML_PARSE_FLOW_MAPPING_VALUE_STATE:
|
|
314
|
-
return yaml_parser_parse_flow_mapping_value(parser, event, 0);
|
|
315
|
-
|
|
316
|
-
case YAML_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE:
|
|
317
|
-
return yaml_parser_parse_flow_mapping_value(parser, event, 1);
|
|
318
|
-
|
|
319
|
-
default:
|
|
320
|
-
assert(1); /* Invalid state. */
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
return 0;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
/*
|
|
327
|
-
* Parse the production:
|
|
328
|
-
* stream ::= STREAM-START implicit_document? explicit_document* STREAM-END
|
|
329
|
-
* ************
|
|
330
|
-
*/
|
|
331
|
-
|
|
332
|
-
static int
|
|
333
|
-
yaml_parser_parse_stream_start(yaml_parser_t *parser, yaml_event_t *event)
|
|
334
|
-
{
|
|
335
|
-
yaml_token_t *token;
|
|
336
|
-
|
|
337
|
-
token = PEEK_TOKEN(parser);
|
|
338
|
-
if (!token) return 0;
|
|
339
|
-
|
|
340
|
-
if (token->type != YAML_STREAM_START_TOKEN) {
|
|
341
|
-
return yaml_parser_set_parser_error(parser,
|
|
342
|
-
"did not find expected <stream-start>", token->start_mark);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
parser->state = YAML_PARSE_IMPLICIT_DOCUMENT_START_STATE;
|
|
346
|
-
STREAM_START_EVENT_INIT(*event, token->data.stream_start.encoding,
|
|
347
|
-
token->start_mark, token->start_mark);
|
|
348
|
-
SKIP_TOKEN(parser);
|
|
349
|
-
|
|
350
|
-
return 1;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
/*
|
|
354
|
-
* Parse the productions:
|
|
355
|
-
* implicit_document ::= block_node DOCUMENT-END*
|
|
356
|
-
* *
|
|
357
|
-
* explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
|
|
358
|
-
* *************************
|
|
359
|
-
*/
|
|
360
|
-
|
|
361
|
-
static int
|
|
362
|
-
yaml_parser_parse_document_start(yaml_parser_t *parser, yaml_event_t *event,
|
|
363
|
-
int implicit)
|
|
364
|
-
{
|
|
365
|
-
yaml_token_t *token;
|
|
366
|
-
yaml_version_directive_t *version_directive = NULL;
|
|
367
|
-
struct {
|
|
368
|
-
yaml_tag_directive_t *start;
|
|
369
|
-
yaml_tag_directive_t *end;
|
|
370
|
-
} tag_directives = { NULL, NULL };
|
|
371
|
-
|
|
372
|
-
token = PEEK_TOKEN(parser);
|
|
373
|
-
if (!token) return 0;
|
|
374
|
-
|
|
375
|
-
/* Parse extra document end indicators. */
|
|
376
|
-
|
|
377
|
-
if (!implicit)
|
|
378
|
-
{
|
|
379
|
-
while (token->type == YAML_DOCUMENT_END_TOKEN) {
|
|
380
|
-
SKIP_TOKEN(parser);
|
|
381
|
-
token = PEEK_TOKEN(parser);
|
|
382
|
-
if (!token) return 0;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
/* Parse an implicit document. */
|
|
387
|
-
|
|
388
|
-
if (implicit && token->type != YAML_VERSION_DIRECTIVE_TOKEN &&
|
|
389
|
-
token->type != YAML_TAG_DIRECTIVE_TOKEN &&
|
|
390
|
-
token->type != YAML_DOCUMENT_START_TOKEN &&
|
|
391
|
-
token->type != YAML_STREAM_END_TOKEN)
|
|
392
|
-
{
|
|
393
|
-
if (!yaml_parser_process_directives(parser, NULL, NULL, NULL))
|
|
394
|
-
return 0;
|
|
395
|
-
if (!PUSH(parser, parser->states, YAML_PARSE_DOCUMENT_END_STATE))
|
|
396
|
-
return 0;
|
|
397
|
-
parser->state = YAML_PARSE_BLOCK_NODE_STATE;
|
|
398
|
-
DOCUMENT_START_EVENT_INIT(*event, NULL, NULL, NULL, 1,
|
|
399
|
-
token->start_mark, token->start_mark);
|
|
400
|
-
return 1;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
/* Parse an explicit document. */
|
|
404
|
-
|
|
405
|
-
else if (token->type != YAML_STREAM_END_TOKEN)
|
|
406
|
-
{
|
|
407
|
-
yaml_mark_t start_mark, end_mark;
|
|
408
|
-
start_mark = token->start_mark;
|
|
409
|
-
if (!yaml_parser_process_directives(parser, &version_directive,
|
|
410
|
-
&tag_directives.start, &tag_directives.end))
|
|
411
|
-
return 0;
|
|
412
|
-
token = PEEK_TOKEN(parser);
|
|
413
|
-
if (!token) goto error;
|
|
414
|
-
if (token->type != YAML_DOCUMENT_START_TOKEN) {
|
|
415
|
-
yaml_parser_set_parser_error(parser,
|
|
416
|
-
"did not find expected <document start>", token->start_mark);
|
|
417
|
-
goto error;
|
|
418
|
-
}
|
|
419
|
-
if (!PUSH(parser, parser->states, YAML_PARSE_DOCUMENT_END_STATE))
|
|
420
|
-
goto error;
|
|
421
|
-
parser->state = YAML_PARSE_DOCUMENT_CONTENT_STATE;
|
|
422
|
-
end_mark = token->end_mark;
|
|
423
|
-
DOCUMENT_START_EVENT_INIT(*event, version_directive,
|
|
424
|
-
tag_directives.start, tag_directives.end, 0,
|
|
425
|
-
start_mark, end_mark);
|
|
426
|
-
SKIP_TOKEN(parser);
|
|
427
|
-
version_directive = NULL;
|
|
428
|
-
tag_directives.start = tag_directives.end = NULL;
|
|
429
|
-
return 1;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
/* Parse the stream end. */
|
|
433
|
-
|
|
434
|
-
else
|
|
435
|
-
{
|
|
436
|
-
parser->state = YAML_PARSE_END_STATE;
|
|
437
|
-
STREAM_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
|
|
438
|
-
SKIP_TOKEN(parser);
|
|
439
|
-
return 1;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
error:
|
|
443
|
-
yaml_free(version_directive);
|
|
444
|
-
while (tag_directives.start != tag_directives.end) {
|
|
445
|
-
yaml_free(tag_directives.end[-1].handle);
|
|
446
|
-
yaml_free(tag_directives.end[-1].prefix);
|
|
447
|
-
tag_directives.end --;
|
|
448
|
-
}
|
|
449
|
-
yaml_free(tag_directives.start);
|
|
450
|
-
return 0;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
/*
|
|
454
|
-
* Parse the productions:
|
|
455
|
-
* explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
|
|
456
|
-
* ***********
|
|
457
|
-
*/
|
|
458
|
-
|
|
459
|
-
static int
|
|
460
|
-
yaml_parser_parse_document_content(yaml_parser_t *parser, yaml_event_t *event)
|
|
461
|
-
{
|
|
462
|
-
yaml_token_t *token;
|
|
463
|
-
|
|
464
|
-
token = PEEK_TOKEN(parser);
|
|
465
|
-
if (!token) return 0;
|
|
466
|
-
|
|
467
|
-
if (token->type == YAML_VERSION_DIRECTIVE_TOKEN ||
|
|
468
|
-
token->type == YAML_TAG_DIRECTIVE_TOKEN ||
|
|
469
|
-
token->type == YAML_DOCUMENT_START_TOKEN ||
|
|
470
|
-
token->type == YAML_DOCUMENT_END_TOKEN ||
|
|
471
|
-
token->type == YAML_STREAM_END_TOKEN) {
|
|
472
|
-
parser->state = POP(parser, parser->states);
|
|
473
|
-
return yaml_parser_process_empty_scalar(parser, event,
|
|
474
|
-
token->start_mark);
|
|
475
|
-
}
|
|
476
|
-
else {
|
|
477
|
-
return yaml_parser_parse_node(parser, event, 1, 0);
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
/*
|
|
482
|
-
* Parse the productions:
|
|
483
|
-
* implicit_document ::= block_node DOCUMENT-END*
|
|
484
|
-
* *************
|
|
485
|
-
* explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
|
|
486
|
-
* *************
|
|
487
|
-
*/
|
|
488
|
-
|
|
489
|
-
static int
|
|
490
|
-
yaml_parser_parse_document_end(yaml_parser_t *parser, yaml_event_t *event)
|
|
491
|
-
{
|
|
492
|
-
yaml_token_t *token;
|
|
493
|
-
yaml_mark_t start_mark, end_mark;
|
|
494
|
-
int implicit = 1;
|
|
495
|
-
|
|
496
|
-
token = PEEK_TOKEN(parser);
|
|
497
|
-
if (!token) return 0;
|
|
498
|
-
|
|
499
|
-
start_mark = end_mark = token->start_mark;
|
|
500
|
-
|
|
501
|
-
if (token->type == YAML_DOCUMENT_END_TOKEN) {
|
|
502
|
-
end_mark = token->end_mark;
|
|
503
|
-
SKIP_TOKEN(parser);
|
|
504
|
-
implicit = 0;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
while (!STACK_EMPTY(parser, parser->tag_directives)) {
|
|
508
|
-
yaml_tag_directive_t tag_directive = POP(parser, parser->tag_directives);
|
|
509
|
-
yaml_free(tag_directive.handle);
|
|
510
|
-
yaml_free(tag_directive.prefix);
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
parser->state = YAML_PARSE_DOCUMENT_START_STATE;
|
|
514
|
-
DOCUMENT_END_EVENT_INIT(*event, implicit, start_mark, end_mark);
|
|
515
|
-
|
|
516
|
-
return 1;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
/*
|
|
520
|
-
* Parse the productions:
|
|
521
|
-
* block_node_or_indentless_sequence ::=
|
|
522
|
-
* ALIAS
|
|
523
|
-
* *****
|
|
524
|
-
* | properties (block_content | indentless_block_sequence)?
|
|
525
|
-
* ********** *
|
|
526
|
-
* | block_content | indentless_block_sequence
|
|
527
|
-
* *
|
|
528
|
-
* block_node ::= ALIAS
|
|
529
|
-
* *****
|
|
530
|
-
* | properties block_content?
|
|
531
|
-
* ********** *
|
|
532
|
-
* | block_content
|
|
533
|
-
* *
|
|
534
|
-
* flow_node ::= ALIAS
|
|
535
|
-
* *****
|
|
536
|
-
* | properties flow_content?
|
|
537
|
-
* ********** *
|
|
538
|
-
* | flow_content
|
|
539
|
-
* *
|
|
540
|
-
* properties ::= TAG ANCHOR? | ANCHOR TAG?
|
|
541
|
-
* *************************
|
|
542
|
-
* block_content ::= block_collection | flow_collection | SCALAR
|
|
543
|
-
* ******
|
|
544
|
-
* flow_content ::= flow_collection | SCALAR
|
|
545
|
-
* ******
|
|
546
|
-
*/
|
|
547
|
-
|
|
548
|
-
static int
|
|
549
|
-
yaml_parser_parse_node(yaml_parser_t *parser, yaml_event_t *event,
|
|
550
|
-
int block, int indentless_sequence)
|
|
551
|
-
{
|
|
552
|
-
yaml_token_t *token;
|
|
553
|
-
yaml_char_t *anchor = NULL;
|
|
554
|
-
yaml_char_t *tag_handle = NULL;
|
|
555
|
-
yaml_char_t *tag_suffix = NULL;
|
|
556
|
-
yaml_char_t *tag = NULL;
|
|
557
|
-
yaml_mark_t start_mark, end_mark, tag_mark;
|
|
558
|
-
int implicit;
|
|
559
|
-
|
|
560
|
-
token = PEEK_TOKEN(parser);
|
|
561
|
-
if (!token) return 0;
|
|
562
|
-
|
|
563
|
-
if (token->type == YAML_ALIAS_TOKEN)
|
|
564
|
-
{
|
|
565
|
-
parser->state = POP(parser, parser->states);
|
|
566
|
-
ALIAS_EVENT_INIT(*event, token->data.alias.value,
|
|
567
|
-
token->start_mark, token->end_mark);
|
|
568
|
-
SKIP_TOKEN(parser);
|
|
569
|
-
return 1;
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
else
|
|
573
|
-
{
|
|
574
|
-
start_mark = end_mark = token->start_mark;
|
|
575
|
-
|
|
576
|
-
if (token->type == YAML_ANCHOR_TOKEN)
|
|
577
|
-
{
|
|
578
|
-
anchor = token->data.anchor.value;
|
|
579
|
-
start_mark = token->start_mark;
|
|
580
|
-
end_mark = token->end_mark;
|
|
581
|
-
SKIP_TOKEN(parser);
|
|
582
|
-
token = PEEK_TOKEN(parser);
|
|
583
|
-
if (!token) goto error;
|
|
584
|
-
if (token->type == YAML_TAG_TOKEN)
|
|
585
|
-
{
|
|
586
|
-
tag_handle = token->data.tag.handle;
|
|
587
|
-
tag_suffix = token->data.tag.suffix;
|
|
588
|
-
tag_mark = token->start_mark;
|
|
589
|
-
end_mark = token->end_mark;
|
|
590
|
-
SKIP_TOKEN(parser);
|
|
591
|
-
token = PEEK_TOKEN(parser);
|
|
592
|
-
if (!token) goto error;
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
else if (token->type == YAML_TAG_TOKEN)
|
|
596
|
-
{
|
|
597
|
-
tag_handle = token->data.tag.handle;
|
|
598
|
-
tag_suffix = token->data.tag.suffix;
|
|
599
|
-
start_mark = tag_mark = token->start_mark;
|
|
600
|
-
end_mark = token->end_mark;
|
|
601
|
-
SKIP_TOKEN(parser);
|
|
602
|
-
token = PEEK_TOKEN(parser);
|
|
603
|
-
if (!token) goto error;
|
|
604
|
-
if (token->type == YAML_ANCHOR_TOKEN)
|
|
605
|
-
{
|
|
606
|
-
anchor = token->data.anchor.value;
|
|
607
|
-
end_mark = token->end_mark;
|
|
608
|
-
SKIP_TOKEN(parser);
|
|
609
|
-
token = PEEK_TOKEN(parser);
|
|
610
|
-
if (!token) goto error;
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
if (tag_handle) {
|
|
615
|
-
if (!*tag_handle) {
|
|
616
|
-
tag = tag_suffix;
|
|
617
|
-
yaml_free(tag_handle);
|
|
618
|
-
tag_handle = tag_suffix = NULL;
|
|
619
|
-
}
|
|
620
|
-
else {
|
|
621
|
-
yaml_tag_directive_t *tag_directive;
|
|
622
|
-
for (tag_directive = parser->tag_directives.start;
|
|
623
|
-
tag_directive != parser->tag_directives.top;
|
|
624
|
-
tag_directive ++) {
|
|
625
|
-
if (strcmp((char *)tag_directive->handle, (char *)tag_handle) == 0) {
|
|
626
|
-
size_t prefix_len = strlen((char *)tag_directive->prefix);
|
|
627
|
-
size_t suffix_len = strlen((char *)tag_suffix);
|
|
628
|
-
tag = YAML_MALLOC(prefix_len+suffix_len+1);
|
|
629
|
-
if (!tag) {
|
|
630
|
-
parser->error = YAML_MEMORY_ERROR;
|
|
631
|
-
goto error;
|
|
632
|
-
}
|
|
633
|
-
memcpy(tag, tag_directive->prefix, prefix_len);
|
|
634
|
-
memcpy(tag+prefix_len, tag_suffix, suffix_len);
|
|
635
|
-
tag[prefix_len+suffix_len] = '\0';
|
|
636
|
-
yaml_free(tag_handle);
|
|
637
|
-
yaml_free(tag_suffix);
|
|
638
|
-
tag_handle = tag_suffix = NULL;
|
|
639
|
-
break;
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
if (!tag) {
|
|
643
|
-
yaml_parser_set_parser_error_context(parser,
|
|
644
|
-
"while parsing a node", start_mark,
|
|
645
|
-
"found undefined tag handle", tag_mark);
|
|
646
|
-
goto error;
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
implicit = (!tag || !*tag);
|
|
652
|
-
if (indentless_sequence && token->type == YAML_BLOCK_ENTRY_TOKEN) {
|
|
653
|
-
end_mark = token->end_mark;
|
|
654
|
-
parser->state = YAML_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE;
|
|
655
|
-
SEQUENCE_START_EVENT_INIT(*event, anchor, tag, implicit,
|
|
656
|
-
YAML_BLOCK_SEQUENCE_STYLE, start_mark, end_mark);
|
|
657
|
-
return 1;
|
|
658
|
-
}
|
|
659
|
-
else {
|
|
660
|
-
if (token->type == YAML_SCALAR_TOKEN) {
|
|
661
|
-
int plain_implicit = 0;
|
|
662
|
-
int quoted_implicit = 0;
|
|
663
|
-
end_mark = token->end_mark;
|
|
664
|
-
if ((token->data.scalar.style == YAML_PLAIN_SCALAR_STYLE && !tag)
|
|
665
|
-
|| (tag && strcmp((char *)tag, "!") == 0)) {
|
|
666
|
-
plain_implicit = 1;
|
|
667
|
-
}
|
|
668
|
-
else if (!tag) {
|
|
669
|
-
quoted_implicit = 1;
|
|
670
|
-
}
|
|
671
|
-
parser->state = POP(parser, parser->states);
|
|
672
|
-
SCALAR_EVENT_INIT(*event, anchor, tag,
|
|
673
|
-
token->data.scalar.value, token->data.scalar.length,
|
|
674
|
-
plain_implicit, quoted_implicit,
|
|
675
|
-
token->data.scalar.style, start_mark, end_mark);
|
|
676
|
-
SKIP_TOKEN(parser);
|
|
677
|
-
return 1;
|
|
678
|
-
}
|
|
679
|
-
else if (token->type == YAML_FLOW_SEQUENCE_START_TOKEN) {
|
|
680
|
-
if (!STACK_LIMIT(parser, parser->indents, MAX_NESTING_LEVEL - parser->flow_level)) {
|
|
681
|
-
yaml_maximum_level_reached(parser, start_mark, token->start_mark);
|
|
682
|
-
goto error;
|
|
683
|
-
}
|
|
684
|
-
end_mark = token->end_mark;
|
|
685
|
-
parser->state = YAML_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE;
|
|
686
|
-
SEQUENCE_START_EVENT_INIT(*event, anchor, tag, implicit,
|
|
687
|
-
YAML_FLOW_SEQUENCE_STYLE, start_mark, end_mark);
|
|
688
|
-
return 1;
|
|
689
|
-
}
|
|
690
|
-
else if (token->type == YAML_FLOW_MAPPING_START_TOKEN) {
|
|
691
|
-
if (!STACK_LIMIT(parser, parser->indents, MAX_NESTING_LEVEL - parser->flow_level)) {
|
|
692
|
-
yaml_maximum_level_reached(parser, start_mark, token->start_mark);
|
|
693
|
-
goto error;
|
|
694
|
-
}
|
|
695
|
-
end_mark = token->end_mark;
|
|
696
|
-
parser->state = YAML_PARSE_FLOW_MAPPING_FIRST_KEY_STATE;
|
|
697
|
-
MAPPING_START_EVENT_INIT(*event, anchor, tag, implicit,
|
|
698
|
-
YAML_FLOW_MAPPING_STYLE, start_mark, end_mark);
|
|
699
|
-
return 1;
|
|
700
|
-
}
|
|
701
|
-
else if (block && token->type == YAML_BLOCK_SEQUENCE_START_TOKEN) {
|
|
702
|
-
if (!STACK_LIMIT(parser, parser->indents, MAX_NESTING_LEVEL - parser->flow_level)) {
|
|
703
|
-
yaml_maximum_level_reached(parser, start_mark, token->start_mark);
|
|
704
|
-
goto error;
|
|
705
|
-
}
|
|
706
|
-
end_mark = token->end_mark;
|
|
707
|
-
parser->state = YAML_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE;
|
|
708
|
-
SEQUENCE_START_EVENT_INIT(*event, anchor, tag, implicit,
|
|
709
|
-
YAML_BLOCK_SEQUENCE_STYLE, start_mark, end_mark);
|
|
710
|
-
return 1;
|
|
711
|
-
}
|
|
712
|
-
else if (block && token->type == YAML_BLOCK_MAPPING_START_TOKEN) {
|
|
713
|
-
if (!STACK_LIMIT(parser, parser->indents, MAX_NESTING_LEVEL - parser->flow_level)) {
|
|
714
|
-
yaml_maximum_level_reached(parser, start_mark, token->start_mark);
|
|
715
|
-
goto error;
|
|
716
|
-
}
|
|
717
|
-
end_mark = token->end_mark;
|
|
718
|
-
parser->state = YAML_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE;
|
|
719
|
-
MAPPING_START_EVENT_INIT(*event, anchor, tag, implicit,
|
|
720
|
-
YAML_BLOCK_MAPPING_STYLE, start_mark, end_mark);
|
|
721
|
-
return 1;
|
|
722
|
-
}
|
|
723
|
-
else if (anchor || tag) {
|
|
724
|
-
yaml_char_t *value = YAML_MALLOC(1);
|
|
725
|
-
if (!value) {
|
|
726
|
-
parser->error = YAML_MEMORY_ERROR;
|
|
727
|
-
goto error;
|
|
728
|
-
}
|
|
729
|
-
value[0] = '\0';
|
|
730
|
-
parser->state = POP(parser, parser->states);
|
|
731
|
-
SCALAR_EVENT_INIT(*event, anchor, tag, value, 0,
|
|
732
|
-
implicit, 0, YAML_PLAIN_SCALAR_STYLE,
|
|
733
|
-
start_mark, end_mark);
|
|
734
|
-
return 1;
|
|
735
|
-
}
|
|
736
|
-
else {
|
|
737
|
-
yaml_parser_set_parser_error_context(parser,
|
|
738
|
-
(block ? "while parsing a block node"
|
|
739
|
-
: "while parsing a flow node"), start_mark,
|
|
740
|
-
"did not find expected node content", token->start_mark);
|
|
741
|
-
goto error;
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
error:
|
|
747
|
-
yaml_free(anchor);
|
|
748
|
-
yaml_free(tag_handle);
|
|
749
|
-
yaml_free(tag_suffix);
|
|
750
|
-
yaml_free(tag);
|
|
751
|
-
|
|
752
|
-
return 0;
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
/*
|
|
756
|
-
* Parse the productions:
|
|
757
|
-
* block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END
|
|
758
|
-
* ******************** *********** * *********
|
|
759
|
-
*/
|
|
760
|
-
|
|
761
|
-
static int
|
|
762
|
-
yaml_parser_parse_block_sequence_entry(yaml_parser_t *parser,
|
|
763
|
-
yaml_event_t *event, int first)
|
|
764
|
-
{
|
|
765
|
-
yaml_token_t *token;
|
|
766
|
-
|
|
767
|
-
if (first) {
|
|
768
|
-
token = PEEK_TOKEN(parser);
|
|
769
|
-
if (!PUSH(parser, parser->marks, token->start_mark))
|
|
770
|
-
return 0;
|
|
771
|
-
SKIP_TOKEN(parser);
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
token = PEEK_TOKEN(parser);
|
|
775
|
-
if (!token) return 0;
|
|
776
|
-
|
|
777
|
-
if (token->type == YAML_BLOCK_ENTRY_TOKEN)
|
|
778
|
-
{
|
|
779
|
-
yaml_mark_t mark = token->end_mark;
|
|
780
|
-
SKIP_TOKEN(parser);
|
|
781
|
-
token = PEEK_TOKEN(parser);
|
|
782
|
-
if (!token) return 0;
|
|
783
|
-
if (token->type != YAML_BLOCK_ENTRY_TOKEN &&
|
|
784
|
-
token->type != YAML_BLOCK_END_TOKEN) {
|
|
785
|
-
if (!PUSH(parser, parser->states,
|
|
786
|
-
YAML_PARSE_BLOCK_SEQUENCE_ENTRY_STATE))
|
|
787
|
-
return 0;
|
|
788
|
-
return yaml_parser_parse_node(parser, event, 1, 0);
|
|
789
|
-
}
|
|
790
|
-
else {
|
|
791
|
-
parser->state = YAML_PARSE_BLOCK_SEQUENCE_ENTRY_STATE;
|
|
792
|
-
return yaml_parser_process_empty_scalar(parser, event, mark);
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
else if (token->type == YAML_BLOCK_END_TOKEN)
|
|
797
|
-
{
|
|
798
|
-
parser->state = POP(parser, parser->states);
|
|
799
|
-
(void)POP(parser, parser->marks);
|
|
800
|
-
SEQUENCE_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
|
|
801
|
-
SKIP_TOKEN(parser);
|
|
802
|
-
return 1;
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
else
|
|
806
|
-
{
|
|
807
|
-
return yaml_parser_set_parser_error_context(parser,
|
|
808
|
-
"while parsing a block collection", POP(parser, parser->marks),
|
|
809
|
-
"did not find expected '-' indicator", token->start_mark);
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
/*
|
|
814
|
-
* Parse the productions:
|
|
815
|
-
* indentless_sequence ::= (BLOCK-ENTRY block_node?)+
|
|
816
|
-
* *********** *
|
|
817
|
-
*/
|
|
818
|
-
|
|
819
|
-
static int
|
|
820
|
-
yaml_parser_parse_indentless_sequence_entry(yaml_parser_t *parser,
|
|
821
|
-
yaml_event_t *event)
|
|
822
|
-
{
|
|
823
|
-
yaml_token_t *token;
|
|
824
|
-
|
|
825
|
-
token = PEEK_TOKEN(parser);
|
|
826
|
-
if (!token) return 0;
|
|
827
|
-
|
|
828
|
-
if (token->type == YAML_BLOCK_ENTRY_TOKEN)
|
|
829
|
-
{
|
|
830
|
-
yaml_mark_t mark = token->end_mark;
|
|
831
|
-
SKIP_TOKEN(parser);
|
|
832
|
-
token = PEEK_TOKEN(parser);
|
|
833
|
-
if (!token) return 0;
|
|
834
|
-
if (token->type != YAML_BLOCK_ENTRY_TOKEN &&
|
|
835
|
-
token->type != YAML_KEY_TOKEN &&
|
|
836
|
-
token->type != YAML_VALUE_TOKEN &&
|
|
837
|
-
token->type != YAML_BLOCK_END_TOKEN) {
|
|
838
|
-
if (!PUSH(parser, parser->states,
|
|
839
|
-
YAML_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE))
|
|
840
|
-
return 0;
|
|
841
|
-
return yaml_parser_parse_node(parser, event, 1, 0);
|
|
842
|
-
}
|
|
843
|
-
else {
|
|
844
|
-
parser->state = YAML_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE;
|
|
845
|
-
return yaml_parser_process_empty_scalar(parser, event, mark);
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
else
|
|
850
|
-
{
|
|
851
|
-
parser->state = POP(parser, parser->states);
|
|
852
|
-
SEQUENCE_END_EVENT_INIT(*event, token->start_mark, token->start_mark);
|
|
853
|
-
return 1;
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
/*
|
|
858
|
-
* Parse the productions:
|
|
859
|
-
* block_mapping ::= BLOCK-MAPPING_START
|
|
860
|
-
* *******************
|
|
861
|
-
* ((KEY block_node_or_indentless_sequence?)?
|
|
862
|
-
* *** *
|
|
863
|
-
* (VALUE block_node_or_indentless_sequence?)?)*
|
|
864
|
-
*
|
|
865
|
-
* BLOCK-END
|
|
866
|
-
* *********
|
|
867
|
-
*/
|
|
868
|
-
|
|
869
|
-
static int
|
|
870
|
-
yaml_parser_parse_block_mapping_key(yaml_parser_t *parser,
|
|
871
|
-
yaml_event_t *event, int first)
|
|
872
|
-
{
|
|
873
|
-
yaml_token_t *token;
|
|
874
|
-
|
|
875
|
-
if (first) {
|
|
876
|
-
token = PEEK_TOKEN(parser);
|
|
877
|
-
if (!PUSH(parser, parser->marks, token->start_mark))
|
|
878
|
-
return 0;
|
|
879
|
-
SKIP_TOKEN(parser);
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
token = PEEK_TOKEN(parser);
|
|
883
|
-
if (!token) return 0;
|
|
884
|
-
|
|
885
|
-
if (token->type == YAML_KEY_TOKEN)
|
|
886
|
-
{
|
|
887
|
-
yaml_mark_t mark = token->end_mark;
|
|
888
|
-
SKIP_TOKEN(parser);
|
|
889
|
-
token = PEEK_TOKEN(parser);
|
|
890
|
-
if (!token) return 0;
|
|
891
|
-
if (token->type != YAML_KEY_TOKEN &&
|
|
892
|
-
token->type != YAML_VALUE_TOKEN &&
|
|
893
|
-
token->type != YAML_BLOCK_END_TOKEN) {
|
|
894
|
-
if (!PUSH(parser, parser->states,
|
|
895
|
-
YAML_PARSE_BLOCK_MAPPING_VALUE_STATE))
|
|
896
|
-
return 0;
|
|
897
|
-
return yaml_parser_parse_node(parser, event, 1, 1);
|
|
898
|
-
}
|
|
899
|
-
else {
|
|
900
|
-
parser->state = YAML_PARSE_BLOCK_MAPPING_VALUE_STATE;
|
|
901
|
-
return yaml_parser_process_empty_scalar(parser, event, mark);
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
|
|
905
|
-
else if (token->type == YAML_BLOCK_END_TOKEN)
|
|
906
|
-
{
|
|
907
|
-
parser->state = POP(parser, parser->states);
|
|
908
|
-
(void)POP(parser, parser->marks);
|
|
909
|
-
MAPPING_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
|
|
910
|
-
SKIP_TOKEN(parser);
|
|
911
|
-
return 1;
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
else
|
|
915
|
-
{
|
|
916
|
-
return yaml_parser_set_parser_error_context(parser,
|
|
917
|
-
"while parsing a block mapping", POP(parser, parser->marks),
|
|
918
|
-
"did not find expected key", token->start_mark);
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
/*
|
|
923
|
-
* Parse the productions:
|
|
924
|
-
* block_mapping ::= BLOCK-MAPPING_START
|
|
925
|
-
*
|
|
926
|
-
* ((KEY block_node_or_indentless_sequence?)?
|
|
927
|
-
*
|
|
928
|
-
* (VALUE block_node_or_indentless_sequence?)?)*
|
|
929
|
-
* ***** *
|
|
930
|
-
* BLOCK-END
|
|
931
|
-
*
|
|
932
|
-
*/
|
|
933
|
-
|
|
934
|
-
static int
|
|
935
|
-
yaml_parser_parse_block_mapping_value(yaml_parser_t *parser,
|
|
936
|
-
yaml_event_t *event)
|
|
937
|
-
{
|
|
938
|
-
yaml_token_t *token;
|
|
939
|
-
|
|
940
|
-
token = PEEK_TOKEN(parser);
|
|
941
|
-
if (!token) return 0;
|
|
942
|
-
|
|
943
|
-
if (token->type == YAML_VALUE_TOKEN)
|
|
944
|
-
{
|
|
945
|
-
yaml_mark_t mark = token->end_mark;
|
|
946
|
-
SKIP_TOKEN(parser);
|
|
947
|
-
token = PEEK_TOKEN(parser);
|
|
948
|
-
if (!token) return 0;
|
|
949
|
-
if (token->type != YAML_KEY_TOKEN &&
|
|
950
|
-
token->type != YAML_VALUE_TOKEN &&
|
|
951
|
-
token->type != YAML_BLOCK_END_TOKEN) {
|
|
952
|
-
if (!PUSH(parser, parser->states,
|
|
953
|
-
YAML_PARSE_BLOCK_MAPPING_KEY_STATE))
|
|
954
|
-
return 0;
|
|
955
|
-
return yaml_parser_parse_node(parser, event, 1, 1);
|
|
956
|
-
}
|
|
957
|
-
else {
|
|
958
|
-
parser->state = YAML_PARSE_BLOCK_MAPPING_KEY_STATE;
|
|
959
|
-
return yaml_parser_process_empty_scalar(parser, event, mark);
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
else
|
|
964
|
-
{
|
|
965
|
-
parser->state = YAML_PARSE_BLOCK_MAPPING_KEY_STATE;
|
|
966
|
-
return yaml_parser_process_empty_scalar(parser, event, token->start_mark);
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
|
|
970
|
-
/*
|
|
971
|
-
* Parse the productions:
|
|
972
|
-
* flow_sequence ::= FLOW-SEQUENCE-START
|
|
973
|
-
* *******************
|
|
974
|
-
* (flow_sequence_entry FLOW-ENTRY)*
|
|
975
|
-
* * **********
|
|
976
|
-
* flow_sequence_entry?
|
|
977
|
-
* *
|
|
978
|
-
* FLOW-SEQUENCE-END
|
|
979
|
-
* *****************
|
|
980
|
-
* flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
|
|
981
|
-
* *
|
|
982
|
-
*/
|
|
983
|
-
|
|
984
|
-
static int
|
|
985
|
-
yaml_parser_parse_flow_sequence_entry(yaml_parser_t *parser,
|
|
986
|
-
yaml_event_t *event, int first)
|
|
987
|
-
{
|
|
988
|
-
yaml_token_t *token;
|
|
989
|
-
|
|
990
|
-
if (first) {
|
|
991
|
-
token = PEEK_TOKEN(parser);
|
|
992
|
-
if (!PUSH(parser, parser->marks, token->start_mark))
|
|
993
|
-
return 0;
|
|
994
|
-
SKIP_TOKEN(parser);
|
|
995
|
-
}
|
|
996
|
-
|
|
997
|
-
token = PEEK_TOKEN(parser);
|
|
998
|
-
if (!token) return 0;
|
|
999
|
-
|
|
1000
|
-
if (token->type != YAML_FLOW_SEQUENCE_END_TOKEN)
|
|
1001
|
-
{
|
|
1002
|
-
if (!first) {
|
|
1003
|
-
if (token->type == YAML_FLOW_ENTRY_TOKEN) {
|
|
1004
|
-
SKIP_TOKEN(parser);
|
|
1005
|
-
token = PEEK_TOKEN(parser);
|
|
1006
|
-
if (!token) return 0;
|
|
1007
|
-
}
|
|
1008
|
-
else {
|
|
1009
|
-
return yaml_parser_set_parser_error_context(parser,
|
|
1010
|
-
"while parsing a flow sequence", POP(parser, parser->marks),
|
|
1011
|
-
"did not find expected ',' or ']'", token->start_mark);
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
if (token->type == YAML_KEY_TOKEN) {
|
|
1016
|
-
parser->state = YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE;
|
|
1017
|
-
MAPPING_START_EVENT_INIT(*event, NULL, NULL,
|
|
1018
|
-
1, YAML_FLOW_MAPPING_STYLE,
|
|
1019
|
-
token->start_mark, token->end_mark);
|
|
1020
|
-
SKIP_TOKEN(parser);
|
|
1021
|
-
return 1;
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
else if (token->type != YAML_FLOW_SEQUENCE_END_TOKEN) {
|
|
1025
|
-
if (!PUSH(parser, parser->states,
|
|
1026
|
-
YAML_PARSE_FLOW_SEQUENCE_ENTRY_STATE))
|
|
1027
|
-
return 0;
|
|
1028
|
-
return yaml_parser_parse_node(parser, event, 0, 0);
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
parser->state = POP(parser, parser->states);
|
|
1033
|
-
(void)POP(parser, parser->marks);
|
|
1034
|
-
SEQUENCE_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
|
|
1035
|
-
SKIP_TOKEN(parser);
|
|
1036
|
-
return 1;
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
|
-
/*
|
|
1040
|
-
* Parse the productions:
|
|
1041
|
-
* flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
|
|
1042
|
-
* *** *
|
|
1043
|
-
*/
|
|
1044
|
-
|
|
1045
|
-
static int
|
|
1046
|
-
yaml_parser_parse_flow_sequence_entry_mapping_key(yaml_parser_t *parser,
|
|
1047
|
-
yaml_event_t *event)
|
|
1048
|
-
{
|
|
1049
|
-
yaml_token_t *token;
|
|
1050
|
-
|
|
1051
|
-
token = PEEK_TOKEN(parser);
|
|
1052
|
-
if (!token) return 0;
|
|
1053
|
-
|
|
1054
|
-
if (token->type != YAML_VALUE_TOKEN && token->type != YAML_FLOW_ENTRY_TOKEN
|
|
1055
|
-
&& token->type != YAML_FLOW_SEQUENCE_END_TOKEN) {
|
|
1056
|
-
if (!PUSH(parser, parser->states,
|
|
1057
|
-
YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE))
|
|
1058
|
-
return 0;
|
|
1059
|
-
return yaml_parser_parse_node(parser, event, 0, 0);
|
|
1060
|
-
}
|
|
1061
|
-
else if (token->type == YAML_FLOW_SEQUENCE_END_TOKEN) {
|
|
1062
|
-
yaml_mark_t mark = token->start_mark;
|
|
1063
|
-
parser->state = YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE;
|
|
1064
|
-
return yaml_parser_process_empty_scalar(parser, event, mark);
|
|
1065
|
-
}
|
|
1066
|
-
else {
|
|
1067
|
-
yaml_mark_t mark = token->end_mark;
|
|
1068
|
-
SKIP_TOKEN(parser);
|
|
1069
|
-
parser->state = YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE;
|
|
1070
|
-
return yaml_parser_process_empty_scalar(parser, event, mark);
|
|
1071
|
-
}
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
/*
|
|
1075
|
-
* Parse the productions:
|
|
1076
|
-
* flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
|
|
1077
|
-
* ***** *
|
|
1078
|
-
*/
|
|
1079
|
-
|
|
1080
|
-
static int
|
|
1081
|
-
yaml_parser_parse_flow_sequence_entry_mapping_value(yaml_parser_t *parser,
|
|
1082
|
-
yaml_event_t *event)
|
|
1083
|
-
{
|
|
1084
|
-
yaml_token_t *token;
|
|
1085
|
-
|
|
1086
|
-
token = PEEK_TOKEN(parser);
|
|
1087
|
-
if (!token) return 0;
|
|
1088
|
-
|
|
1089
|
-
if (token->type == YAML_VALUE_TOKEN) {
|
|
1090
|
-
SKIP_TOKEN(parser);
|
|
1091
|
-
token = PEEK_TOKEN(parser);
|
|
1092
|
-
if (!token) return 0;
|
|
1093
|
-
if (token->type != YAML_FLOW_ENTRY_TOKEN
|
|
1094
|
-
&& token->type != YAML_FLOW_SEQUENCE_END_TOKEN) {
|
|
1095
|
-
if (!PUSH(parser, parser->states,
|
|
1096
|
-
YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE))
|
|
1097
|
-
return 0;
|
|
1098
|
-
return yaml_parser_parse_node(parser, event, 0, 0);
|
|
1099
|
-
}
|
|
1100
|
-
}
|
|
1101
|
-
parser->state = YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE;
|
|
1102
|
-
return yaml_parser_process_empty_scalar(parser, event, token->start_mark);
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
/*
|
|
1106
|
-
* Parse the productions:
|
|
1107
|
-
* flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
|
|
1108
|
-
* *
|
|
1109
|
-
*/
|
|
1110
|
-
|
|
1111
|
-
static int
|
|
1112
|
-
yaml_parser_parse_flow_sequence_entry_mapping_end(yaml_parser_t *parser,
|
|
1113
|
-
yaml_event_t *event)
|
|
1114
|
-
{
|
|
1115
|
-
yaml_token_t *token;
|
|
1116
|
-
|
|
1117
|
-
token = PEEK_TOKEN(parser);
|
|
1118
|
-
if (!token) return 0;
|
|
1119
|
-
|
|
1120
|
-
parser->state = YAML_PARSE_FLOW_SEQUENCE_ENTRY_STATE;
|
|
1121
|
-
|
|
1122
|
-
MAPPING_END_EVENT_INIT(*event, token->start_mark, token->start_mark);
|
|
1123
|
-
return 1;
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
/*
|
|
1127
|
-
* Parse the productions:
|
|
1128
|
-
* flow_mapping ::= FLOW-MAPPING-START
|
|
1129
|
-
* ******************
|
|
1130
|
-
* (flow_mapping_entry FLOW-ENTRY)*
|
|
1131
|
-
* * **********
|
|
1132
|
-
* flow_mapping_entry?
|
|
1133
|
-
* ******************
|
|
1134
|
-
* FLOW-MAPPING-END
|
|
1135
|
-
* ****************
|
|
1136
|
-
* flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
|
|
1137
|
-
* * *** *
|
|
1138
|
-
*/
|
|
1139
|
-
|
|
1140
|
-
static int
|
|
1141
|
-
yaml_parser_parse_flow_mapping_key(yaml_parser_t *parser,
|
|
1142
|
-
yaml_event_t *event, int first)
|
|
1143
|
-
{
|
|
1144
|
-
yaml_token_t *token;
|
|
1145
|
-
|
|
1146
|
-
if (first) {
|
|
1147
|
-
token = PEEK_TOKEN(parser);
|
|
1148
|
-
if (!PUSH(parser, parser->marks, token->start_mark))
|
|
1149
|
-
return 0;
|
|
1150
|
-
SKIP_TOKEN(parser);
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
token = PEEK_TOKEN(parser);
|
|
1154
|
-
if (!token) return 0;
|
|
1155
|
-
|
|
1156
|
-
if (token->type != YAML_FLOW_MAPPING_END_TOKEN)
|
|
1157
|
-
{
|
|
1158
|
-
if (!first) {
|
|
1159
|
-
if (token->type == YAML_FLOW_ENTRY_TOKEN) {
|
|
1160
|
-
SKIP_TOKEN(parser);
|
|
1161
|
-
token = PEEK_TOKEN(parser);
|
|
1162
|
-
if (!token) return 0;
|
|
1163
|
-
}
|
|
1164
|
-
else {
|
|
1165
|
-
return yaml_parser_set_parser_error_context(parser,
|
|
1166
|
-
"while parsing a flow mapping", POP(parser, parser->marks),
|
|
1167
|
-
"did not find expected ',' or '}'", token->start_mark);
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
if (token->type == YAML_KEY_TOKEN) {
|
|
1172
|
-
SKIP_TOKEN(parser);
|
|
1173
|
-
token = PEEK_TOKEN(parser);
|
|
1174
|
-
if (!token) return 0;
|
|
1175
|
-
if (token->type != YAML_VALUE_TOKEN
|
|
1176
|
-
&& token->type != YAML_FLOW_ENTRY_TOKEN
|
|
1177
|
-
&& token->type != YAML_FLOW_MAPPING_END_TOKEN) {
|
|
1178
|
-
if (!PUSH(parser, parser->states,
|
|
1179
|
-
YAML_PARSE_FLOW_MAPPING_VALUE_STATE))
|
|
1180
|
-
return 0;
|
|
1181
|
-
return yaml_parser_parse_node(parser, event, 0, 0);
|
|
1182
|
-
}
|
|
1183
|
-
else {
|
|
1184
|
-
parser->state = YAML_PARSE_FLOW_MAPPING_VALUE_STATE;
|
|
1185
|
-
return yaml_parser_process_empty_scalar(parser, event,
|
|
1186
|
-
token->start_mark);
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
else if (token->type != YAML_FLOW_MAPPING_END_TOKEN) {
|
|
1190
|
-
if (!PUSH(parser, parser->states,
|
|
1191
|
-
YAML_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE))
|
|
1192
|
-
return 0;
|
|
1193
|
-
return yaml_parser_parse_node(parser, event, 0, 0);
|
|
1194
|
-
}
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
parser->state = POP(parser, parser->states);
|
|
1198
|
-
(void)POP(parser, parser->marks);
|
|
1199
|
-
MAPPING_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
|
|
1200
|
-
SKIP_TOKEN(parser);
|
|
1201
|
-
return 1;
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
/*
|
|
1205
|
-
* Parse the productions:
|
|
1206
|
-
* flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
|
|
1207
|
-
* * ***** *
|
|
1208
|
-
*/
|
|
1209
|
-
|
|
1210
|
-
static int
|
|
1211
|
-
yaml_parser_parse_flow_mapping_value(yaml_parser_t *parser,
|
|
1212
|
-
yaml_event_t *event, int empty)
|
|
1213
|
-
{
|
|
1214
|
-
yaml_token_t *token;
|
|
1215
|
-
|
|
1216
|
-
token = PEEK_TOKEN(parser);
|
|
1217
|
-
if (!token) return 0;
|
|
1218
|
-
|
|
1219
|
-
if (empty) {
|
|
1220
|
-
parser->state = YAML_PARSE_FLOW_MAPPING_KEY_STATE;
|
|
1221
|
-
return yaml_parser_process_empty_scalar(parser, event,
|
|
1222
|
-
token->start_mark);
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
if (token->type == YAML_VALUE_TOKEN) {
|
|
1226
|
-
SKIP_TOKEN(parser);
|
|
1227
|
-
token = PEEK_TOKEN(parser);
|
|
1228
|
-
if (!token) return 0;
|
|
1229
|
-
if (token->type != YAML_FLOW_ENTRY_TOKEN
|
|
1230
|
-
&& token->type != YAML_FLOW_MAPPING_END_TOKEN) {
|
|
1231
|
-
if (!PUSH(parser, parser->states,
|
|
1232
|
-
YAML_PARSE_FLOW_MAPPING_KEY_STATE))
|
|
1233
|
-
return 0;
|
|
1234
|
-
return yaml_parser_parse_node(parser, event, 0, 0);
|
|
1235
|
-
}
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
parser->state = YAML_PARSE_FLOW_MAPPING_KEY_STATE;
|
|
1239
|
-
return yaml_parser_process_empty_scalar(parser, event, token->start_mark);
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
/*
|
|
1243
|
-
* Generate an empty scalar event.
|
|
1244
|
-
*/
|
|
1245
|
-
|
|
1246
|
-
static int
|
|
1247
|
-
yaml_parser_process_empty_scalar(yaml_parser_t *parser, yaml_event_t *event,
|
|
1248
|
-
yaml_mark_t mark)
|
|
1249
|
-
{
|
|
1250
|
-
yaml_char_t *value;
|
|
1251
|
-
|
|
1252
|
-
value = YAML_MALLOC(1);
|
|
1253
|
-
if (!value) {
|
|
1254
|
-
parser->error = YAML_MEMORY_ERROR;
|
|
1255
|
-
return 0;
|
|
1256
|
-
}
|
|
1257
|
-
value[0] = '\0';
|
|
1258
|
-
|
|
1259
|
-
SCALAR_EVENT_INIT(*event, NULL, NULL, value, 0,
|
|
1260
|
-
1, 0, YAML_PLAIN_SCALAR_STYLE, mark, mark);
|
|
1261
|
-
|
|
1262
|
-
return 1;
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
/*
|
|
1266
|
-
* Parse directives.
|
|
1267
|
-
*/
|
|
1268
|
-
|
|
1269
|
-
static int
|
|
1270
|
-
yaml_parser_process_directives(yaml_parser_t *parser,
|
|
1271
|
-
yaml_version_directive_t **version_directive_ref,
|
|
1272
|
-
yaml_tag_directive_t **tag_directives_start_ref,
|
|
1273
|
-
yaml_tag_directive_t **tag_directives_end_ref)
|
|
1274
|
-
{
|
|
1275
|
-
yaml_tag_directive_t default_tag_directives[] = {
|
|
1276
|
-
{(yaml_char_t *)"!", (yaml_char_t *)"!"},
|
|
1277
|
-
{(yaml_char_t *)"!!", (yaml_char_t *)"tag:yaml.org,2002:"},
|
|
1278
|
-
{NULL, NULL}
|
|
1279
|
-
};
|
|
1280
|
-
yaml_tag_directive_t *default_tag_directive;
|
|
1281
|
-
yaml_version_directive_t *version_directive = NULL;
|
|
1282
|
-
struct {
|
|
1283
|
-
yaml_tag_directive_t *start;
|
|
1284
|
-
yaml_tag_directive_t *end;
|
|
1285
|
-
yaml_tag_directive_t *top;
|
|
1286
|
-
} tag_directives = { NULL, NULL, NULL };
|
|
1287
|
-
yaml_token_t *token;
|
|
1288
|
-
|
|
1289
|
-
if (!STACK_INIT(parser, tag_directives, yaml_tag_directive_t*))
|
|
1290
|
-
goto error;
|
|
1291
|
-
|
|
1292
|
-
token = PEEK_TOKEN(parser);
|
|
1293
|
-
if (!token) goto error;
|
|
1294
|
-
|
|
1295
|
-
while (token->type == YAML_VERSION_DIRECTIVE_TOKEN ||
|
|
1296
|
-
token->type == YAML_TAG_DIRECTIVE_TOKEN)
|
|
1297
|
-
{
|
|
1298
|
-
if (token->type == YAML_VERSION_DIRECTIVE_TOKEN) {
|
|
1299
|
-
if (version_directive) {
|
|
1300
|
-
yaml_parser_set_parser_error(parser,
|
|
1301
|
-
"found duplicate %YAML directive", token->start_mark);
|
|
1302
|
-
goto error;
|
|
1303
|
-
}
|
|
1304
|
-
if (token->data.version_directive.major != 1
|
|
1305
|
-
|| (
|
|
1306
|
-
token->data.version_directive.minor != 1
|
|
1307
|
-
&& token->data.version_directive.minor != 2
|
|
1308
|
-
)) {
|
|
1309
|
-
yaml_parser_set_parser_error(parser,
|
|
1310
|
-
"found incompatible YAML document", token->start_mark);
|
|
1311
|
-
goto error;
|
|
1312
|
-
}
|
|
1313
|
-
version_directive = YAML_MALLOC_STATIC(yaml_version_directive_t);
|
|
1314
|
-
if (!version_directive) {
|
|
1315
|
-
parser->error = YAML_MEMORY_ERROR;
|
|
1316
|
-
goto error;
|
|
1317
|
-
}
|
|
1318
|
-
version_directive->major = token->data.version_directive.major;
|
|
1319
|
-
version_directive->minor = token->data.version_directive.minor;
|
|
1320
|
-
}
|
|
1321
|
-
|
|
1322
|
-
else if (token->type == YAML_TAG_DIRECTIVE_TOKEN) {
|
|
1323
|
-
yaml_tag_directive_t value;
|
|
1324
|
-
value.handle = token->data.tag_directive.handle;
|
|
1325
|
-
value.prefix = token->data.tag_directive.prefix;
|
|
1326
|
-
|
|
1327
|
-
if (!yaml_parser_append_tag_directive(parser, value, 0,
|
|
1328
|
-
token->start_mark))
|
|
1329
|
-
goto error;
|
|
1330
|
-
if (!PUSH(parser, tag_directives, value))
|
|
1331
|
-
goto error;
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
SKIP_TOKEN(parser);
|
|
1335
|
-
token = PEEK_TOKEN(parser);
|
|
1336
|
-
if (!token) goto error;
|
|
1337
|
-
}
|
|
1338
|
-
|
|
1339
|
-
for (default_tag_directive = default_tag_directives;
|
|
1340
|
-
default_tag_directive->handle; default_tag_directive++) {
|
|
1341
|
-
if (!yaml_parser_append_tag_directive(parser, *default_tag_directive, 1,
|
|
1342
|
-
token->start_mark))
|
|
1343
|
-
goto error;
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
if (version_directive_ref) {
|
|
1347
|
-
*version_directive_ref = version_directive;
|
|
1348
|
-
}
|
|
1349
|
-
if (tag_directives_start_ref) {
|
|
1350
|
-
if (STACK_EMPTY(parser, tag_directives)) {
|
|
1351
|
-
*tag_directives_start_ref = *tag_directives_end_ref = NULL;
|
|
1352
|
-
STACK_DEL(parser, tag_directives);
|
|
1353
|
-
}
|
|
1354
|
-
else {
|
|
1355
|
-
*tag_directives_start_ref = tag_directives.start;
|
|
1356
|
-
*tag_directives_end_ref = tag_directives.top;
|
|
1357
|
-
}
|
|
1358
|
-
}
|
|
1359
|
-
else {
|
|
1360
|
-
STACK_DEL(parser, tag_directives);
|
|
1361
|
-
}
|
|
1362
|
-
|
|
1363
|
-
if (!version_directive_ref)
|
|
1364
|
-
yaml_free(version_directive);
|
|
1365
|
-
return 1;
|
|
1366
|
-
|
|
1367
|
-
error:
|
|
1368
|
-
yaml_free(version_directive);
|
|
1369
|
-
while (!STACK_EMPTY(parser, tag_directives)) {
|
|
1370
|
-
yaml_tag_directive_t tag_directive = POP(parser, tag_directives);
|
|
1371
|
-
yaml_free(tag_directive.handle);
|
|
1372
|
-
yaml_free(tag_directive.prefix);
|
|
1373
|
-
}
|
|
1374
|
-
STACK_DEL(parser, tag_directives);
|
|
1375
|
-
return 0;
|
|
1376
|
-
}
|
|
1377
|
-
|
|
1378
|
-
/*
|
|
1379
|
-
* Append a tag directive to the directives stack.
|
|
1380
|
-
*/
|
|
1381
|
-
|
|
1382
|
-
static int
|
|
1383
|
-
yaml_parser_append_tag_directive(yaml_parser_t *parser,
|
|
1384
|
-
yaml_tag_directive_t value, int allow_duplicates, yaml_mark_t mark)
|
|
1385
|
-
{
|
|
1386
|
-
yaml_tag_directive_t *tag_directive;
|
|
1387
|
-
yaml_tag_directive_t copy = { NULL, NULL };
|
|
1388
|
-
|
|
1389
|
-
for (tag_directive = parser->tag_directives.start;
|
|
1390
|
-
tag_directive != parser->tag_directives.top; tag_directive ++) {
|
|
1391
|
-
if (strcmp((char *)value.handle, (char *)tag_directive->handle) == 0) {
|
|
1392
|
-
if (allow_duplicates)
|
|
1393
|
-
return 1;
|
|
1394
|
-
return yaml_parser_set_parser_error(parser,
|
|
1395
|
-
"found duplicate %TAG directive", mark);
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
|
-
copy.handle = yaml_strdup(value.handle);
|
|
1400
|
-
copy.prefix = yaml_strdup(value.prefix);
|
|
1401
|
-
if (!copy.handle || !copy.prefix) {
|
|
1402
|
-
parser->error = YAML_MEMORY_ERROR;
|
|
1403
|
-
goto error;
|
|
1404
|
-
}
|
|
1405
|
-
|
|
1406
|
-
if (!PUSH(parser, parser->tag_directives, copy))
|
|
1407
|
-
goto error;
|
|
1408
|
-
|
|
1409
|
-
return 1;
|
|
1410
|
-
|
|
1411
|
-
error:
|
|
1412
|
-
yaml_free(copy.handle);
|
|
1413
|
-
yaml_free(copy.prefix);
|
|
1414
|
-
return 0;
|
|
1415
|
-
}
|
|
1416
|
-
|