apex-ruby 1.0.6

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.
Files changed (501) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +119 -0
  3. data/apex-ruby.gemspec +31 -0
  4. data/ext/apex_ext/apex_ext.c +215 -0
  5. data/ext/apex_ext/apex_src/BENCHMARK.md +32 -0
  6. data/ext/apex_ext/apex_src/BENCHMARK_COMPARISON.md +67 -0
  7. data/ext/apex_ext/apex_src/CHANGELOG.md +2454 -0
  8. data/ext/apex_ext/apex_src/CMakeLists.txt +454 -0
  9. data/ext/apex_ext/apex_src/Dockerfile.linux-build +15 -0
  10. data/ext/apex_ext/apex_src/Formula/apex.rb +38 -0
  11. data/ext/apex_ext/apex_src/Info.plist.in +27 -0
  12. data/ext/apex_ext/apex_src/LICENSE +21 -0
  13. data/ext/apex_ext/apex_src/Package.swift +160 -0
  14. data/ext/apex_ext/apex_src/PackageSupport/README.md +17 -0
  15. data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/cmark-gfm_export.h +20 -0
  16. data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/cmark-gfm_version.h +14 -0
  17. data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/cmark_gfm_spm_stub.c +4 -0
  18. data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/config.h +41 -0
  19. data/ext/apex_ext/apex_src/README.md +452 -0
  20. data/ext/apex_ext/apex_src/VERSION +1 -0
  21. data/ext/apex_ext/apex_src/apex-header-2-rb@2x.webp +0 -0
  22. data/ext/apex_ext/apex_src/apex-plugins.json.example +20 -0
  23. data/ext/apex_ext/apex_src/apex.pc.in +11 -0
  24. data/ext/apex_ext/apex_src/cli/main.c +2720 -0
  25. data/ext/apex_ext/apex_src/debug_test.sh +22 -0
  26. data/ext/apex_ext/apex_src/docs/API_REFERENCE.md +451 -0
  27. data/ext/apex_ext/apex_src/docs/ARCHITECTURE.md +166 -0
  28. data/ext/apex_ext/apex_src/docs/CMARK_INTEGRATION.md +220 -0
  29. data/ext/apex_ext/apex_src/docs/CRITICMARKUP.md +501 -0
  30. data/ext/apex_ext/apex_src/docs/DEBUGGING.md +73 -0
  31. data/ext/apex_ext/apex_src/docs/FINAL_STATUS.md +391 -0
  32. data/ext/apex_ext/apex_src/docs/FINAL_STATUS_UPDATE.md +237 -0
  33. data/ext/apex_ext/apex_src/docs/FUTURE_FEATURES.md +456 -0
  34. data/ext/apex_ext/apex_src/docs/IAL_FEATURES.md +210 -0
  35. data/ext/apex_ext/apex_src/docs/IAL_STATUS.md +344 -0
  36. data/ext/apex_ext/apex_src/docs/INTEGRATION_EXAMPLE.m +144 -0
  37. data/ext/apex_ext/apex_src/docs/LIMITATIONS_RESOLVED.md +278 -0
  38. data/ext/apex_ext/apex_src/docs/OUTPUT_MODES.md +321 -0
  39. data/ext/apex_ext/apex_src/docs/PROGRESS.md +167 -0
  40. data/ext/apex_ext/apex_src/docs/STANDALONE_FEATURE.md +174 -0
  41. data/ext/apex_ext/apex_src/docs/TABLE_SPANS_STATUS.md +243 -0
  42. data/ext/apex_ext/apex_src/docs/TEST_COVERAGE.md +316 -0
  43. data/ext/apex_ext/apex_src/docs/USER_GUIDE.md +803 -0
  44. data/ext/apex_ext/apex_src/docs/WIKI_LINKS_ISSUE.md +91 -0
  45. data/ext/apex_ext/apex_src/documentation/README.md +160 -0
  46. data/ext/apex_ext/apex_src/documentation/docsets/Apex Command Line Options.cheatsheet.txt +365 -0
  47. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Info.plist +24 -0
  48. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/C-API.html +1737 -0
  49. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Citations.html +1420 -0
  50. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Command-Line-Options.html +3574 -0
  51. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Configuration.html +1603 -0
  52. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Credits.html +910 -0
  53. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Examples.html +1168 -0
  54. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Getting-Started.html +1003 -0
  55. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Header-IDs.html +1308 -0
  56. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Home.html +1078 -0
  57. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Inline-Attribute-Lists.html +1622 -0
  58. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Installation.html +1168 -0
  59. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Limitations-and-Roadmap.html +1698 -0
  60. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Metadata-Transforms.html +1531 -0
  61. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Modes.html +1980 -0
  62. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Multi-File-Documents.html +1368 -0
  63. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Pandoc-Integration.html +1151 -0
  64. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Plugins.html +2861 -0
  65. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Syntax.html +3981 -0
  66. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Troubleshooting.html +1454 -0
  67. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Usage.html +1200 -0
  68. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Xcode-Integration.html +2066 -0
  69. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/docSet.dsidx +0 -0
  70. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/optimizedIndex.dsidx +0 -0
  71. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/tempOptimizedIndex.dsidx +0 -0
  72. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Info.plist +22 -0
  73. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans.woff +0 -0
  74. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Bold.woff +0 -0
  75. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Bold_Italic.woff +0 -0
  76. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Extrabold.woff +0 -0
  77. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Extrabold_Italic.woff +0 -0
  78. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Italic.woff +0 -0
  79. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Semibold.woff +0 -0
  80. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Semibold_Italic.woff +0 -0
  81. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/index.html +914 -0
  82. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/style.css +399 -0
  83. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/docSet.dsidx +0 -0
  84. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/optimizedIndex.dsidx +0 -0
  85. data/ext/apex_ext/apex_src/documentation/generate_app_docs.rb +772 -0
  86. data/ext/apex_ext/apex_src/documentation/generate_app_docs_ai.rb +678 -0
  87. data/ext/apex_ext/apex_src/documentation/generate_docset.rb +873 -0
  88. data/ext/apex_ext/apex_src/documentation/generate_single_html.rb +733 -0
  89. data/ext/apex_ext/apex_src/documentation/html/apex-docs.html +17073 -0
  90. data/ext/apex_ext/apex_src/documentation/shared_scripts.js +64 -0
  91. data/ext/apex_ext/apex_src/documentation/shared_styles.css +646 -0
  92. data/ext/apex_ext/apex_src/documentation/transform_for_app.example.md +260 -0
  93. data/ext/apex_ext/apex_src/examples/bracketed_spans_demo.md +119 -0
  94. data/ext/apex_ext/apex_src/examples/emoji_span_plugin.yml +11 -0
  95. data/ext/apex_ext/apex_src/examples/example.html +53 -0
  96. data/ext/apex_ext/apex_src/examples/example.md +85 -0
  97. data/ext/apex_ext/apex_src/examples/fenced_divs_demo.md +158 -0
  98. data/ext/apex_ext/apex_src/examples/kbd.md +8 -0
  99. data/ext/apex_ext/apex_src/examples/kbd_plugin.rb +250 -0
  100. data/ext/apex_ext/apex_src/examples/kbd_plugin.yml +9 -0
  101. data/ext/apex_ext/apex_src/icon/apexicon-outline-black.png +0 -0
  102. data/ext/apex_ext/apex_src/icon/apexicon-outline-black@2x.png +0 -0
  103. data/ext/apex_ext/apex_src/icon/apexicon-outline-mark.png +0 -0
  104. data/ext/apex_ext/apex_src/icon/apexicon-outline-mark@2x.png +0 -0
  105. data/ext/apex_ext/apex_src/icon/apexicon-outline-white.png +0 -0
  106. data/ext/apex_ext/apex_src/icon/apexicon-outline-white@2x.png +0 -0
  107. data/ext/apex_ext/apex_src/icon/apexicon.png +0 -0
  108. data/ext/apex_ext/apex_src/icon/apexicon@2x.png +0 -0
  109. data/ext/apex_ext/apex_src/include/apex/apex.h +247 -0
  110. data/ext/apex_ext/apex_src/include/apex/buffer.h +93 -0
  111. data/ext/apex_ext/apex_src/include/apex/module.modulemap +16 -0
  112. data/ext/apex_ext/apex_src/include/apex/parser.h +150 -0
  113. data/ext/apex_ext/apex_src/include/apex/renderer.h +39 -0
  114. data/ext/apex_ext/apex_src/man/apex-config.5 +374 -0
  115. data/ext/apex_ext/apex_src/man/apex-config.5.md +260 -0
  116. data/ext/apex_ext/apex_src/man/apex-plugins.7 +456 -0
  117. data/ext/apex_ext/apex_src/man/apex-plugins.7.md +365 -0
  118. data/ext/apex_ext/apex_src/man/apex.1 +828 -0
  119. data/ext/apex_ext/apex_src/man/apex.1.md +643 -0
  120. data/ext/apex_ext/apex_src/man/apex.1.new +338 -0
  121. data/ext/apex_ext/apex_src/objc/Apex.swift +237 -0
  122. data/ext/apex_ext/apex_src/objc/NSString+Apex.h +117 -0
  123. data/ext/apex_ext/apex_src/objc/NSString+Apex.m +332 -0
  124. data/ext/apex_ext/apex_src/src/_README.md +358 -0
  125. data/ext/apex_ext/apex_src/src/apex.c +6326 -0
  126. data/ext/apex_ext/apex_src/src/buffer.c +93 -0
  127. data/ext/apex_ext/apex_src/src/extensions/abbreviations.c +362 -0
  128. data/ext/apex_ext/apex_src/src/extensions/abbreviations.h +45 -0
  129. data/ext/apex_ext/apex_src/src/extensions/advanced_footnotes.c +184 -0
  130. data/ext/apex_ext/apex_src/src/extensions/advanced_footnotes.h +50 -0
  131. data/ext/apex_ext/apex_src/src/extensions/advanced_tables.c +1897 -0
  132. data/ext/apex_ext/apex_src/src/extensions/advanced_tables.h +42 -0
  133. data/ext/apex_ext/apex_src/src/extensions/callouts.c +215 -0
  134. data/ext/apex_ext/apex_src/src/extensions/callouts.h +53 -0
  135. data/ext/apex_ext/apex_src/src/extensions/citations.c +2042 -0
  136. data/ext/apex_ext/apex_src/src/extensions/citations.h +163 -0
  137. data/ext/apex_ext/apex_src/src/extensions/critic.c +329 -0
  138. data/ext/apex_ext/apex_src/src/extensions/critic.h +48 -0
  139. data/ext/apex_ext/apex_src/src/extensions/definition_list.c +1670 -0
  140. data/ext/apex_ext/apex_src/src/extensions/definition_list.h +42 -0
  141. data/ext/apex_ext/apex_src/src/extensions/emoji.c +710 -0
  142. data/ext/apex_ext/apex_src/src/extensions/emoji.h +38 -0
  143. data/ext/apex_ext/apex_src/src/extensions/emoji_data.h +942 -0
  144. data/ext/apex_ext/apex_src/src/extensions/fenced_divs.c +925 -0
  145. data/ext/apex_ext/apex_src/src/extensions/fenced_divs.h +43 -0
  146. data/ext/apex_ext/apex_src/src/extensions/github-emoji.txt +869 -0
  147. data/ext/apex_ext/apex_src/src/extensions/grid_tables.c +1121 -0
  148. data/ext/apex_ext/apex_src/src/extensions/grid_tables.h +33 -0
  149. data/ext/apex_ext/apex_src/src/extensions/header_ids.c +626 -0
  150. data/ext/apex_ext/apex_src/src/extensions/header_ids.h +60 -0
  151. data/ext/apex_ext/apex_src/src/extensions/highlight.c +135 -0
  152. data/ext/apex_ext/apex_src/src/extensions/highlight.h +16 -0
  153. data/ext/apex_ext/apex_src/src/extensions/html_markdown.c +408 -0
  154. data/ext/apex_ext/apex_src/src/extensions/html_markdown.h +42 -0
  155. data/ext/apex_ext/apex_src/src/extensions/ial.c +4084 -0
  156. data/ext/apex_ext/apex_src/src/extensions/ial.h +145 -0
  157. data/ext/apex_ext/apex_src/src/extensions/includes.c +1536 -0
  158. data/ext/apex_ext/apex_src/src/extensions/includes.h +54 -0
  159. data/ext/apex_ext/apex_src/src/extensions/index.c +967 -0
  160. data/ext/apex_ext/apex_src/src/extensions/index.h +90 -0
  161. data/ext/apex_ext/apex_src/src/extensions/inline_footnotes.c +205 -0
  162. data/ext/apex_ext/apex_src/src/extensions/inline_footnotes.h +34 -0
  163. data/ext/apex_ext/apex_src/src/extensions/inline_tables.c +332 -0
  164. data/ext/apex_ext/apex_src/src/extensions/inline_tables.h +13 -0
  165. data/ext/apex_ext/apex_src/src/extensions/insert.c +248 -0
  166. data/ext/apex_ext/apex_src/src/extensions/insert.h +18 -0
  167. data/ext/apex_ext/apex_src/src/extensions/math.c +279 -0
  168. data/ext/apex_ext/apex_src/src/extensions/math.h +32 -0
  169. data/ext/apex_ext/apex_src/src/extensions/metadata.c +3046 -0
  170. data/ext/apex_ext/apex_src/src/extensions/metadata.h +125 -0
  171. data/ext/apex_ext/apex_src/src/extensions/relaxed_tables.c +1297 -0
  172. data/ext/apex_ext/apex_src/src/extensions/relaxed_tables.h +39 -0
  173. data/ext/apex_ext/apex_src/src/extensions/special_markers.c +194 -0
  174. data/ext/apex_ext/apex_src/src/extensions/special_markers.h +29 -0
  175. data/ext/apex_ext/apex_src/src/extensions/sup_sub.c +405 -0
  176. data/ext/apex_ext/apex_src/src/extensions/sup_sub.h +16 -0
  177. data/ext/apex_ext/apex_src/src/extensions/syntax_highlight.c +468 -0
  178. data/ext/apex_ext/apex_src/src/extensions/syntax_highlight.h +44 -0
  179. data/ext/apex_ext/apex_src/src/extensions/table_html_postprocess.c +2679 -0
  180. data/ext/apex_ext/apex_src/src/extensions/table_html_postprocess.h +23 -0
  181. data/ext/apex_ext/apex_src/src/extensions/toc.c +255 -0
  182. data/ext/apex_ext/apex_src/src/extensions/toc.h +34 -0
  183. data/ext/apex_ext/apex_src/src/extensions/wiki_links.c +624 -0
  184. data/ext/apex_ext/apex_src/src/extensions/wiki_links.h +58 -0
  185. data/ext/apex_ext/apex_src/src/html_renderer.c +2762 -0
  186. data/ext/apex_ext/apex_src/src/html_renderer.h +126 -0
  187. data/ext/apex_ext/apex_src/src/parser.c +227 -0
  188. data/ext/apex_ext/apex_src/src/plugins.c +895 -0
  189. data/ext/apex_ext/apex_src/src/plugins.h +39 -0
  190. data/ext/apex_ext/apex_src/src/plugins_env.c +187 -0
  191. data/ext/apex_ext/apex_src/src/plugins_remote.c +263 -0
  192. data/ext/apex_ext/apex_src/src/pretty_html.c +358 -0
  193. data/ext/apex_ext/apex_src/src/renderer.c +241 -0
  194. data/ext/apex_ext/apex_src/src/utf8.c +56 -0
  195. data/ext/apex_ext/apex_src/test-linux-build.sh +20 -0
  196. data/ext/apex_ext/apex_src/test.html +103 -0
  197. data/ext/apex_ext/apex_src/test_coverage.sh +121 -0
  198. data/ext/apex_ext/apex_src/test_ial_fenced.md +6 -0
  199. data/ext/apex_ext/apex_src/test_math_norm.py +79 -0
  200. data/ext/apex_ext/apex_src/test_pandoc_output.html +48 -0
  201. data/ext/apex_ext/apex_src/test_spm.sh +107 -0
  202. data/ext/apex_ext/apex_src/tests/ApexSPMTest/main.swift +50 -0
  203. data/ext/apex_ext/apex_src/tests/BENCHMARK_RESULTS.md +229 -0
  204. data/ext/apex_ext/apex_src/tests/CMakeLists.txt +24 -0
  205. data/ext/apex_ext/apex_src/tests/README.md +146 -0
  206. data/ext/apex_ext/apex_src/tests/benchmark.sh +113 -0
  207. data/ext/apex_ext/apex_src/tests/benchmark_comparison.sh +166 -0
  208. data/ext/apex_ext/apex_src/tests/compare_header_ids.sh +31 -0
  209. data/ext/apex_ext/apex_src/tests/fixtures/basic/headers.md +25 -0
  210. data/ext/apex_ext/apex_src/tests/fixtures/basic/list-interruption.md +24 -0
  211. data/ext/apex_ext/apex_src/tests/fixtures/basic/misc_markup.md +33 -0
  212. data/ext/apex_ext/apex_src/tests/fixtures/basic/test_basic.md +26 -0
  213. data/ext/apex_ext/apex_src/tests/fixtures/code/code-blocks.md +260 -0
  214. data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/SUMMARY.md +6 -0
  215. data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/chapter1.md +7 -0
  216. data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/index.txt +9 -0
  217. data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/intro.md +5 -0
  218. data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/section1_1.md +5 -0
  219. data/ext/apex_ext/apex_src/tests/fixtures/comprehensive_test.md +620 -0
  220. data/ext/apex_ext/apex_src/tests/fixtures/debug_ref_image_ial.md +3 -0
  221. data/ext/apex_ext/apex_src/tests/fixtures/demos/ial.md +11 -0
  222. data/ext/apex_ext/apex_src/tests/fixtures/demos/ial_demo.md +177 -0
  223. data/ext/apex_ext/apex_src/tests/fixtures/extensions/emoji-autocorrect.md +94 -0
  224. data/ext/apex_ext/apex_src/tests/fixtures/extensions/emoji_test.md +3 -0
  225. data/ext/apex_ext/apex_src/tests/fixtures/extensions/kbd_test.md +3 -0
  226. data/ext/apex_ext/apex_src/tests/fixtures/ial/bracketed_spans_test.md +74 -0
  227. data/ext/apex_ext/apex_src/tests/fixtures/images/image_and_encoding_test.md +27 -0
  228. data/ext/apex_ext/apex_src/tests/fixtures/images/multimarkdown_image_attributes_test.md +60 -0
  229. data/ext/apex_ext/apex_src/tests/fixtures/images/pandoc_ial_image_test.md +27 -0
  230. data/ext/apex_ext/apex_src/tests/fixtures/images/width_height_conversion_test.md +94 -0
  231. data/ext/apex_ext/apex_src/tests/fixtures/img-in-div.md +16 -0
  232. data/ext/apex_ext/apex_src/tests/fixtures/includes/code.py +4 -0
  233. data/ext/apex_ext/apex_src/tests/fixtures/includes/data.csv +5 -0
  234. data/ext/apex_ext/apex_src/tests/fixtures/includes/data.tsv +5 -0
  235. data/ext/apex_ext/apex_src/tests/fixtures/includes/image.png +2 -0
  236. data/ext/apex_ext/apex_src/tests/fixtures/includes/metadata_options.yml +11 -0
  237. data/ext/apex_ext/apex_src/tests/fixtures/includes/nested.md +8 -0
  238. data/ext/apex_ext/apex_src/tests/fixtures/includes/raw.html +4 -0
  239. data/ext/apex_ext/apex_src/tests/fixtures/includes/simple.md +7 -0
  240. data/ext/apex_ext/apex_src/tests/fixtures/includes/test_image.png +0 -0
  241. data/ext/apex_ext/apex_src/tests/fixtures/large_doc.md +1094 -0
  242. data/ext/apex_ext/apex_src/tests/fixtures/metadata_options.yml +11 -0
  243. data/ext/apex_ext/apex_src/tests/fixtures/output/gfm_header_id_test.md +96 -0
  244. data/ext/apex_ext/apex_src/tests/fixtures/output/test_citations.md +43 -0
  245. data/ext/apex_ext/apex_src/tests/fixtures/output/test_def_list_links.md +12 -0
  246. data/ext/apex_ext/apex_src/tests/fixtures/output/test_index_mmark.md +53 -0
  247. data/ext/apex_ext/apex_src/tests/fixtures/output/test_index_textindex.md +37 -0
  248. data/ext/apex_ext/apex_src/tests/fixtures/tables/advanced_tables_test.md +93 -0
  249. data/ext/apex_ext/apex_src/tests/fixtures/tables/inline_tables_test.md +38 -0
  250. data/ext/apex_ext/apex_src/tests/fixtures/tables/relaxed-table.md +12 -0
  251. data/ext/apex_ext/apex_src/tests/fixtures/tables/table_cr_line_endings.md +15 -0
  252. data/ext/apex_ext/apex_src/tests/fixtures/tables/table_no_trailing_newline.md +15 -0
  253. data/ext/apex_ext/apex_src/tests/generate_gfm_ids.sh +105 -0
  254. data/ext/apex_ext/apex_src/tests/generate_ial_demo.sh +143 -0
  255. data/ext/apex_ext/apex_src/tests/gfm_id_comparison_summary.md +96 -0
  256. data/ext/apex_ext/apex_src/tests/gh_api_test.md +6 -0
  257. data/ext/apex_ext/apex_src/tests/ial_demo.html +186 -0
  258. data/ext/apex_ext/apex_src/tests/include_code.py +19 -0
  259. data/ext/apex_ext/apex_src/tests/include_snippet.md +15 -0
  260. data/ext/apex_ext/apex_src/tests/multi_file_cli_test.sh +64 -0
  261. data/ext/apex_ext/apex_src/tests/sample_data.csv +7 -0
  262. data/ext/apex_ext/apex_src/tests/table_escaped_ltlt.md +4 -0
  263. data/ext/apex_ext/apex_src/tests/test_basic.c +74 -0
  264. data/ext/apex_ext/apex_src/tests/test_extensions.c +2116 -0
  265. data/ext/apex_ext/apex_src/tests/test_helpers.c +183 -0
  266. data/ext/apex_ext/apex_src/tests/test_helpers.h +91 -0
  267. data/ext/apex_ext/apex_src/tests/test_ial.c +282 -0
  268. data/ext/apex_ext/apex_src/tests/test_links.c +418 -0
  269. data/ext/apex_ext/apex_src/tests/test_marked_integration.c +265 -0
  270. data/ext/apex_ext/apex_src/tests/test_metadata.c +908 -0
  271. data/ext/apex_ext/apex_src/tests/test_output.c +1118 -0
  272. data/ext/apex_ext/apex_src/tests/test_plugins.c +219 -0
  273. data/ext/apex_ext/apex_src/tests/test_refs.bib +31 -0
  274. data/ext/apex_ext/apex_src/tests/test_runner.c +244 -0
  275. data/ext/apex_ext/apex_src/tests/test_syntax_highlight.c +198 -0
  276. data/ext/apex_ext/apex_src/tests/test_tables.c +862 -0
  277. data/ext/apex_ext/apex_src/tests/update_benchmarks.sh +9 -0
  278. data/ext/apex_ext/apex_src/tests/yaml_test.md +13 -0
  279. data/ext/apex_ext/apex_src/tests.rb +39 -0
  280. data/ext/apex_ext/apex_src/vendor/cmark-gfm/CMakeLists.txt +48 -0
  281. data/ext/apex_ext/apex_src/vendor/cmark-gfm/COPYING +170 -0
  282. data/ext/apex_ext/apex_src/vendor/cmark-gfm/CheckFileOffsetBits.c +14 -0
  283. data/ext/apex_ext/apex_src/vendor/cmark-gfm/CheckFileOffsetBits.cmake +43 -0
  284. data/ext/apex_ext/apex_src/vendor/cmark-gfm/FindAsan.cmake +74 -0
  285. data/ext/apex_ext/apex_src/vendor/cmark-gfm/Makefile.nmake +38 -0
  286. data/ext/apex_ext/apex_src/vendor/cmark-gfm/README.md +206 -0
  287. data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/CMakeLists.txt +30 -0
  288. data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/cplusplus.cpp +15 -0
  289. data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/cplusplus.h +16 -0
  290. data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/harness.c +111 -0
  291. data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/harness.h +35 -0
  292. data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/main.c +1169 -0
  293. data/ext/apex_ext/apex_src/vendor/cmark-gfm/appveyor.yml +21 -0
  294. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-bq-flat.md +16 -0
  295. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-bq-nested.md +13 -0
  296. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-code.md +11 -0
  297. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-fences.md +14 -0
  298. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-heading.md +9 -0
  299. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-hr.md +10 -0
  300. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-html.md +32 -0
  301. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-lheading.md +8 -0
  302. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-list-flat.md +67 -0
  303. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-list-nested.md +36 -0
  304. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-ref-flat.md +15 -0
  305. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-ref-nested.md +17 -0
  306. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-autolink.md +14 -0
  307. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-backticks.md +3 -0
  308. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-flat.md +5 -0
  309. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-nested.md +5 -0
  310. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-worst.md +5 -0
  311. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-entity.md +11 -0
  312. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-escape.md +15 -0
  313. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-html.md +44 -0
  314. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-links-flat.md +23 -0
  315. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-links-nested.md +13 -0
  316. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-newlines.md +24 -0
  317. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/lorem1.md +13 -0
  318. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/rawtabs.md +18 -0
  319. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/statistics.py +595 -0
  320. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/stats.py +19 -0
  321. data/ext/apex_ext/apex_src/vendor/cmark-gfm/benchmarks.md +33 -0
  322. data/ext/apex_ext/apex_src/vendor/cmark-gfm/changelog.txt +1245 -0
  323. data/ext/apex_ext/apex_src/vendor/cmark-gfm/data/CaseFolding.txt +1495 -0
  324. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/CMakeLists.txt +119 -0
  325. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/autolink.c +508 -0
  326. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/autolink.h +8 -0
  327. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/cmark-gfm-core-extensions.h +54 -0
  328. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/core-extensions.c +27 -0
  329. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/ext_scanners.c +879 -0
  330. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/ext_scanners.h +24 -0
  331. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/ext_scanners.re +92 -0
  332. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/strikethrough.c +167 -0
  333. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/strikethrough.h +9 -0
  334. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/table.c +917 -0
  335. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/table.h +12 -0
  336. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tagfilter.c +60 -0
  337. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tagfilter.h +8 -0
  338. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tasklist.c +156 -0
  339. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tasklist.h +8 -0
  340. data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/CMakeLists.txt +22 -0
  341. data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/README.md +12 -0
  342. data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzz_quadratic.c +91 -0
  343. data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzz_quadratic_brackets.c +110 -0
  344. data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzzloop.sh +28 -0
  345. data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/CMakeLists.txt +10 -0
  346. data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/make_man_page.py +133 -0
  347. data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/man1/cmark-gfm.1 +78 -0
  348. data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/man3/cmark-gfm.3 +1041 -0
  349. data/ext/apex_ext/apex_src/vendor/cmark-gfm/nmake.bat +1 -0
  350. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/CMakeLists.txt +230 -0
  351. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/arena.c +104 -0
  352. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/blocks.c +1622 -0
  353. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/buffer.c +278 -0
  354. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/buffer.h +116 -0
  355. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/case_fold_switch.inc +4327 -0
  356. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/chunk.h +135 -0
  357. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark-gfm-extension_api.h +737 -0
  358. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark-gfm.h +833 -0
  359. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark-gfm_version.h.in +7 -0
  360. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark.c +55 -0
  361. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark_ctype.c +44 -0
  362. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark_ctype.h +33 -0
  363. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/commonmark.c +514 -0
  364. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/config.h.in +76 -0
  365. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/entities.inc +2138 -0
  366. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/footnotes.c +63 -0
  367. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/footnotes.h +27 -0
  368. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini.h +57 -0
  369. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini_href_e.c +100 -0
  370. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini_html_e.c +66 -0
  371. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini_html_u.c +149 -0
  372. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/html.c +502 -0
  373. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/html.h +27 -0
  374. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/inlines.c +1788 -0
  375. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/inlines.h +29 -0
  376. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/iterator.c +159 -0
  377. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/iterator.h +26 -0
  378. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/latex.c +468 -0
  379. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/libcmark-gfm.pc.in +10 -0
  380. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/linked_list.c +37 -0
  381. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/main.c +328 -0
  382. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/man.c +274 -0
  383. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/map.c +129 -0
  384. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/map.h +44 -0
  385. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/node.c +1045 -0
  386. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/node.h +167 -0
  387. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/parser.h +59 -0
  388. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/plaintext.c +218 -0
  389. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/plugin.c +36 -0
  390. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/plugin.h +34 -0
  391. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/references.c +43 -0
  392. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/references.h +26 -0
  393. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/registry.c +63 -0
  394. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/registry.h +24 -0
  395. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/render.c +213 -0
  396. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/render.h +62 -0
  397. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/scanners.c +14056 -0
  398. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/scanners.h +70 -0
  399. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/scanners.re +365 -0
  400. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/syntax_extension.c +149 -0
  401. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/syntax_extension.h +34 -0
  402. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/utf8.c +317 -0
  403. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/utf8.h +35 -0
  404. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/xml.c +182 -0
  405. data/ext/apex_ext/apex_src/vendor/cmark-gfm/suppressions +10 -0
  406. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/CMakeLists.txt +114 -0
  407. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/afl_test_cases/test.md +49 -0
  408. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/cmark-fuzz.c +58 -0
  409. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/cmark.py +105 -0
  410. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/entity_tests.py +67 -0
  411. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions-full-info-string.txt +0 -0
  412. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions-table-prefer-style-attributes.txt +38 -0
  413. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions.txt +920 -0
  414. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/fuzzing_dictionary +67 -0
  415. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/normalize.py +194 -0
  416. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/pathological_tests.py +160 -0
  417. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/regression.txt +375 -0
  418. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/roundtrip_tests.py +50 -0
  419. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/run-cmark-fuzz +4 -0
  420. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/smart_punct.txt +177 -0
  421. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/spec.txt +10212 -0
  422. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/spec_tests.py +152 -0
  423. data/ext/apex_ext/apex_src/vendor/cmark-gfm/toolchain-mingw32.cmake +17 -0
  424. data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/Dockerfile +41 -0
  425. data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/appveyor-build.bat +13 -0
  426. data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/make_entities_inc.py +32 -0
  427. data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/mkcasefold.pl +22 -0
  428. data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/xml2md.xsl +319 -0
  429. data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/xml2md_gfm.xsl +80 -0
  430. data/ext/apex_ext/apex_src/vendor/cmark-gfm/why-cmark-and-not-x.md +104 -0
  431. data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.js +6 -0
  432. data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.py +37 -0
  433. data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.rb +15 -0
  434. data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.rkt +208 -0
  435. data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper_ext.py +109 -0
  436. data/ext/apex_ext/apex_src/vendor/libyaml/CMakeLists.txt +160 -0
  437. data/ext/apex_ext/apex_src/vendor/libyaml/Changes +372 -0
  438. data/ext/apex_ext/apex_src/vendor/libyaml/License +20 -0
  439. data/ext/apex_ext/apex_src/vendor/libyaml/Makefile.am +51 -0
  440. data/ext/apex_ext/apex_src/vendor/libyaml/ReadMe.md +46 -0
  441. data/ext/apex_ext/apex_src/vendor/libyaml/announcement.msg +89 -0
  442. data/ext/apex_ext/apex_src/vendor/libyaml/bootstrap +3 -0
  443. data/ext/apex_ext/apex_src/vendor/libyaml/cmake/config.h.in +4 -0
  444. data/ext/apex_ext/apex_src/vendor/libyaml/configure.ac +73 -0
  445. data/ext/apex_ext/apex_src/vendor/libyaml/doc/doxygen.cfg +222 -0
  446. data/ext/apex_ext/apex_src/vendor/libyaml/docker/README.mkd +17 -0
  447. data/ext/apex_ext/apex_src/vendor/libyaml/docker/alpine-3.7 +26 -0
  448. data/ext/apex_ext/apex_src/vendor/libyaml/docker/fedora-25 +26 -0
  449. data/ext/apex_ext/apex_src/vendor/libyaml/docker/ubuntu-14.04 +29 -0
  450. data/ext/apex_ext/apex_src/vendor/libyaml/docker/ubuntu-16.04 +24 -0
  451. data/ext/apex_ext/apex_src/vendor/libyaml/examples/anchors.yaml +10 -0
  452. data/ext/apex_ext/apex_src/vendor/libyaml/examples/array.yaml +2 -0
  453. data/ext/apex_ext/apex_src/vendor/libyaml/examples/global-tag.yaml +14 -0
  454. data/ext/apex_ext/apex_src/vendor/libyaml/examples/json.yaml +1 -0
  455. data/ext/apex_ext/apex_src/vendor/libyaml/examples/mapping.yaml +2 -0
  456. data/ext/apex_ext/apex_src/vendor/libyaml/examples/numbers.yaml +1 -0
  457. data/ext/apex_ext/apex_src/vendor/libyaml/examples/strings.yaml +7 -0
  458. data/ext/apex_ext/apex_src/vendor/libyaml/examples/tags.yaml +7 -0
  459. data/ext/apex_ext/apex_src/vendor/libyaml/examples/yaml-version.yaml +3 -0
  460. data/ext/apex_ext/apex_src/vendor/libyaml/include/Makefile.am +17 -0
  461. data/ext/apex_ext/apex_src/vendor/libyaml/include/yaml.h +1999 -0
  462. data/ext/apex_ext/apex_src/vendor/libyaml/pkg/ReadMe.md +77 -0
  463. data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/Dockerfile +32 -0
  464. data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/output/ReadMe +1 -0
  465. data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/scripts/libyaml-dist.sh +23 -0
  466. data/ext/apex_ext/apex_src/vendor/libyaml/regression-inputs/clusterfuzz-testcase-minimized-5607885063061504.yml +1 -0
  467. data/ext/apex_ext/apex_src/vendor/libyaml/src/Makefile.am +4 -0
  468. data/ext/apex_ext/apex_src/vendor/libyaml/src/api.c +1393 -0
  469. data/ext/apex_ext/apex_src/vendor/libyaml/src/dumper.c +394 -0
  470. data/ext/apex_ext/apex_src/vendor/libyaml/src/emitter.c +2358 -0
  471. data/ext/apex_ext/apex_src/vendor/libyaml/src/loader.c +544 -0
  472. data/ext/apex_ext/apex_src/vendor/libyaml/src/parser.c +1416 -0
  473. data/ext/apex_ext/apex_src/vendor/libyaml/src/reader.c +469 -0
  474. data/ext/apex_ext/apex_src/vendor/libyaml/src/scanner.c +3598 -0
  475. data/ext/apex_ext/apex_src/vendor/libyaml/src/writer.c +141 -0
  476. data/ext/apex_ext/apex_src/vendor/libyaml/src/yaml_private.h +684 -0
  477. data/ext/apex_ext/apex_src/vendor/libyaml/tests/CMakeLists.txt +27 -0
  478. data/ext/apex_ext/apex_src/vendor/libyaml/tests/Makefile.am +9 -0
  479. data/ext/apex_ext/apex_src/vendor/libyaml/tests/ReadMe.md +63 -0
  480. data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-deconstructor-alt.c +800 -0
  481. data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-deconstructor.c +1127 -0
  482. data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-reformatter-alt.c +217 -0
  483. data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-reformatter.c +202 -0
  484. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-all-tests.sh +29 -0
  485. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-dumper.c +314 -0
  486. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-emitter-test-suite.c +290 -0
  487. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-emitter.c +327 -0
  488. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-loader.c +63 -0
  489. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-parser-test-suite.c +196 -0
  490. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-parser.c +88 -0
  491. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-scanner.c +63 -0
  492. data/ext/apex_ext/apex_src/vendor/libyaml/tests/test-reader.c +354 -0
  493. data/ext/apex_ext/apex_src/vendor/libyaml/tests/test-version.c +29 -0
  494. data/ext/apex_ext/apex_src/vendor/libyaml/yaml-0.1.pc.in +10 -0
  495. data/ext/apex_ext/apex_src/vendor/libyaml/yamlConfig.cmake.in +16 -0
  496. data/ext/apex_ext/extconf.rb +103 -0
  497. data/lib/apex/configurable.rb +46 -0
  498. data/lib/apex/document.rb +66 -0
  499. data/lib/apex/version.rb +15 -0
  500. data/lib/apex.rb +28 -0
  501. metadata +544 -0
@@ -0,0 +1,1127 @@
1
+
2
+ #include <yaml.h>
3
+
4
+ #include <stdlib.h>
5
+ #include <stdio.h>
6
+
7
+ int
8
+ main(int argc, char *argv[])
9
+ {
10
+ int help = 0;
11
+ int canonical = 0;
12
+ int unicode = 0;
13
+ int k;
14
+ int done = 0;
15
+
16
+ yaml_parser_t parser;
17
+ yaml_emitter_t emitter;
18
+ yaml_event_t input_event;
19
+ yaml_event_t output_event;
20
+
21
+ /* Clear the objects. */
22
+
23
+ memset(&parser, 0, sizeof(parser));
24
+ memset(&emitter, 0, sizeof(emitter));
25
+ memset(&input_event, 0, sizeof(input_event));
26
+ memset(&output_event, 0, sizeof(output_event));
27
+
28
+ /* Analyze command line options. */
29
+
30
+ for (k = 1; k < argc; k ++)
31
+ {
32
+ if (strcmp(argv[k], "-h") == 0
33
+ || strcmp(argv[k], "--help") == 0) {
34
+ help = 1;
35
+ }
36
+
37
+ else if (strcmp(argv[k], "-c") == 0
38
+ || strcmp(argv[k], "--canonical") == 0) {
39
+ canonical = 1;
40
+ }
41
+
42
+ else if (strcmp(argv[k], "-u") == 0
43
+ || strcmp(argv[k], "--unicode") == 0) {
44
+ unicode = 1;
45
+ }
46
+
47
+ else {
48
+ fprintf(stderr, "Unrecognized option: %s\n"
49
+ "Try `%s --help` for more information.\n",
50
+ argv[k], argv[0]);
51
+ return 1;
52
+ }
53
+ }
54
+
55
+ /* Display the help string. */
56
+
57
+ if (help)
58
+ {
59
+ printf("%s <input\n"
60
+ "or\n%s -h | --help\nDeconstruct a YAML stream\n\nOptions:\n"
61
+ "-h, --help\t\tdisplay this help and exit\n"
62
+ "-c, --canonical\t\toutput in the canonical YAML format\n"
63
+ "-u, --unicode\t\toutput unescaped non-ASCII characters\n",
64
+ argv[0], argv[0]);
65
+ return 0;
66
+ }
67
+
68
+ /* Initialize the parser and emitter objects. */
69
+
70
+ if (!yaml_parser_initialize(&parser)) {
71
+ fprintf(stderr, "Could not initialize the parser object\n");
72
+ return 1;
73
+ }
74
+
75
+ if (!yaml_emitter_initialize(&emitter)) {
76
+ yaml_parser_delete(&parser);
77
+ fprintf(stderr, "Could not inialize the emitter object\n");
78
+ return 1;
79
+ }
80
+
81
+ /* Set the parser parameters. */
82
+
83
+ yaml_parser_set_input_file(&parser, stdin);
84
+
85
+ /* Set the emitter parameters. */
86
+
87
+ yaml_emitter_set_output_file(&emitter, stdout);
88
+
89
+ yaml_emitter_set_canonical(&emitter, canonical);
90
+ yaml_emitter_set_unicode(&emitter, unicode);
91
+
92
+ /* Create and emit the STREAM-START event. */
93
+
94
+ if (!yaml_stream_start_event_initialize(&output_event, YAML_UTF8_ENCODING))
95
+ goto event_error;
96
+ if (!yaml_emitter_emit(&emitter, &output_event))
97
+ goto emitter_error;
98
+
99
+ /* Create and emit the DOCUMENT-START event. */
100
+
101
+ if (!yaml_document_start_event_initialize(&output_event,
102
+ NULL, NULL, NULL, 0))
103
+ goto event_error;
104
+ if (!yaml_emitter_emit(&emitter, &output_event))
105
+ goto emitter_error;
106
+
107
+ /* Create and emit the SEQUENCE-START event. */
108
+
109
+ if (!yaml_sequence_start_event_initialize(&output_event,
110
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:seq", 1,
111
+ YAML_BLOCK_SEQUENCE_STYLE))
112
+ goto event_error;
113
+ if (!yaml_emitter_emit(&emitter, &output_event))
114
+ goto emitter_error;
115
+
116
+ /* Loop through the input events. */
117
+
118
+ while (!done)
119
+ {
120
+ /* Get the next event. */
121
+
122
+ if (!yaml_parser_parse(&parser, &input_event))
123
+ goto parser_error;
124
+
125
+ /* Check if this is the stream end. */
126
+
127
+ if (input_event.type == YAML_STREAM_END_EVENT) {
128
+ done = 1;
129
+ }
130
+
131
+ /* Create and emit a MAPPING-START event. */
132
+
133
+ if (!yaml_mapping_start_event_initialize(&output_event,
134
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:map", 1,
135
+ YAML_BLOCK_MAPPING_STYLE))
136
+ goto event_error;
137
+ if (!yaml_emitter_emit(&emitter, &output_event))
138
+ goto emitter_error;
139
+
140
+ /* Analyze the event. */
141
+
142
+ switch (input_event.type)
143
+ {
144
+ case YAML_STREAM_START_EVENT:
145
+
146
+ /* Write 'type'. */
147
+
148
+ if (!yaml_scalar_event_initialize(&output_event,
149
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"type", -1,
150
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
151
+ goto event_error;
152
+ if (!yaml_emitter_emit(&emitter, &output_event))
153
+ goto emitter_error;
154
+
155
+ /* Write 'STREAM-START'. */
156
+
157
+ if (!yaml_scalar_event_initialize(&output_event,
158
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"STREAM-START", -1,
159
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
160
+ goto event_error;
161
+ if (!yaml_emitter_emit(&emitter, &output_event))
162
+ goto emitter_error;
163
+
164
+ /* Display encoding information. */
165
+
166
+ if (input_event.data.stream_start.encoding)
167
+ {
168
+ yaml_encoding_t encoding
169
+ = input_event.data.stream_start.encoding;
170
+
171
+ /* Write 'encoding'. */
172
+
173
+ if (!yaml_scalar_event_initialize(&output_event,
174
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"encoding", -1,
175
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
176
+ goto event_error;
177
+ if (!yaml_emitter_emit(&emitter, &output_event))
178
+ goto emitter_error;
179
+
180
+ /* Write the stream encoding. */
181
+
182
+ if (!yaml_scalar_event_initialize(&output_event,
183
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str",
184
+ (yaml_char_t *)(encoding == YAML_UTF8_ENCODING ? "utf-8" :
185
+ encoding == YAML_UTF16LE_ENCODING ? "utf-16-le" :
186
+ encoding == YAML_UTF16BE_ENCODING ? "utf-16-be" :
187
+ "unknown"), -1,
188
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
189
+ goto event_error;
190
+ if (!yaml_emitter_emit(&emitter, &output_event))
191
+ goto emitter_error;
192
+ }
193
+
194
+ break;
195
+
196
+ case YAML_STREAM_END_EVENT:
197
+
198
+ /* Write 'type'. */
199
+
200
+ if (!yaml_scalar_event_initialize(&output_event,
201
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"type", -1,
202
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
203
+ goto event_error;
204
+ if (!yaml_emitter_emit(&emitter, &output_event))
205
+ goto emitter_error;
206
+
207
+ /* Write 'STREAM-END'. */
208
+
209
+ if (!yaml_scalar_event_initialize(&output_event,
210
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"STREAM-END", -1,
211
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
212
+ goto event_error;
213
+ if (!yaml_emitter_emit(&emitter, &output_event))
214
+ goto emitter_error;
215
+
216
+ break;
217
+
218
+ case YAML_DOCUMENT_START_EVENT:
219
+
220
+ /* Write 'type'. */
221
+
222
+ if (!yaml_scalar_event_initialize(&output_event,
223
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"type", -1,
224
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
225
+ goto event_error;
226
+ if (!yaml_emitter_emit(&emitter, &output_event))
227
+ goto emitter_error;
228
+
229
+ /* Write 'DOCUMENT-START'. */
230
+
231
+ if (!yaml_scalar_event_initialize(&output_event,
232
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"DOCUMENT-START", -1,
233
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
234
+ goto event_error;
235
+ if (!yaml_emitter_emit(&emitter, &output_event))
236
+ goto emitter_error;
237
+
238
+ /* Display the document version numbers. */
239
+
240
+ if (input_event.data.document_start.version_directive)
241
+ {
242
+ yaml_version_directive_t *version
243
+ = input_event.data.document_start.version_directive;
244
+ char number[64];
245
+
246
+ /* Write 'version'. */
247
+
248
+ if (!yaml_scalar_event_initialize(&output_event,
249
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"version", -1,
250
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
251
+ goto event_error;
252
+ if (!yaml_emitter_emit(&emitter, &output_event))
253
+ goto emitter_error;
254
+
255
+ /* Write '{'. */
256
+
257
+ if (!yaml_mapping_start_event_initialize(&output_event,
258
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:map", 1,
259
+ YAML_FLOW_MAPPING_STYLE))
260
+ goto event_error;
261
+ if (!yaml_emitter_emit(&emitter, &output_event))
262
+ goto emitter_error;
263
+
264
+ /* Write 'major'. */
265
+
266
+ if (!yaml_scalar_event_initialize(&output_event,
267
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"major", -1,
268
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
269
+ goto event_error;
270
+ if (!yaml_emitter_emit(&emitter, &output_event))
271
+ goto emitter_error;
272
+
273
+ /* Write a number. */
274
+
275
+ sprintf(number, "%d", version->major);
276
+ if (!yaml_scalar_event_initialize(&output_event,
277
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:int", (yaml_char_t *)number, -1,
278
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
279
+ goto event_error;
280
+ if (!yaml_emitter_emit(&emitter, &output_event))
281
+ goto emitter_error;
282
+
283
+ /* Write 'minor'. */
284
+
285
+ if (!yaml_scalar_event_initialize(&output_event,
286
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"minor", -1,
287
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
288
+ goto event_error;
289
+ if (!yaml_emitter_emit(&emitter, &output_event))
290
+ goto emitter_error;
291
+
292
+ /* Write a number. */
293
+
294
+ sprintf(number, "%d", version->minor);
295
+ if (!yaml_scalar_event_initialize(&output_event,
296
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:int", (yaml_char_t *)number, -1,
297
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
298
+ goto event_error;
299
+ if (!yaml_emitter_emit(&emitter, &output_event))
300
+ goto emitter_error;
301
+
302
+ /* Write '}'. */
303
+
304
+ if (!yaml_mapping_end_event_initialize(&output_event))
305
+ goto event_error;
306
+ if (!yaml_emitter_emit(&emitter, &output_event))
307
+ goto emitter_error;
308
+ }
309
+
310
+ /* Display the document tag directives. */
311
+
312
+ if (input_event.data.document_start.tag_directives.start
313
+ != input_event.data.document_start.tag_directives.end)
314
+ {
315
+ yaml_tag_directive_t *tag;
316
+
317
+ /* Write 'tags'. */
318
+
319
+ if (!yaml_scalar_event_initialize(&output_event,
320
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"tags", -1,
321
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
322
+ goto event_error;
323
+ if (!yaml_emitter_emit(&emitter, &output_event))
324
+ goto emitter_error;
325
+
326
+ /* Start a block sequence. */
327
+
328
+ if (!yaml_sequence_start_event_initialize(&output_event,
329
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:seq", 1,
330
+ YAML_BLOCK_SEQUENCE_STYLE))
331
+ goto event_error;
332
+ if (!yaml_emitter_emit(&emitter, &output_event))
333
+ goto emitter_error;
334
+
335
+ for (tag = input_event.data.document_start.tag_directives.start;
336
+ tag != input_event.data.document_start.tag_directives.end;
337
+ tag ++)
338
+ {
339
+ /* Write '{'. */
340
+
341
+ if (!yaml_mapping_start_event_initialize(&output_event,
342
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:map", 1,
343
+ YAML_FLOW_MAPPING_STYLE))
344
+ goto event_error;
345
+ if (!yaml_emitter_emit(&emitter, &output_event))
346
+ goto emitter_error;
347
+
348
+ /* Write 'handle'. */
349
+
350
+ if (!yaml_scalar_event_initialize(&output_event,
351
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"handle", -1,
352
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
353
+ goto event_error;
354
+ if (!yaml_emitter_emit(&emitter, &output_event))
355
+ goto emitter_error;
356
+
357
+ /* Write the tag directive handle. */
358
+
359
+ if (!yaml_scalar_event_initialize(&output_event,
360
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str",
361
+ tag->handle, -1,
362
+ 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))
363
+ goto event_error;
364
+ if (!yaml_emitter_emit(&emitter, &output_event))
365
+ goto emitter_error;
366
+
367
+ /* Write 'prefix'. */
368
+
369
+ if (!yaml_scalar_event_initialize(&output_event,
370
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"prefix", -1,
371
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
372
+ goto event_error;
373
+ if (!yaml_emitter_emit(&emitter, &output_event))
374
+ goto emitter_error;
375
+
376
+ /* Write the tag directive prefix. */
377
+
378
+ if (!yaml_scalar_event_initialize(&output_event,
379
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str",
380
+ tag->prefix, -1,
381
+ 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))
382
+ goto event_error;
383
+ if (!yaml_emitter_emit(&emitter, &output_event))
384
+ goto emitter_error;
385
+
386
+ /* Write '}'. */
387
+
388
+ if (!yaml_mapping_end_event_initialize(&output_event))
389
+ goto event_error;
390
+ if (!yaml_emitter_emit(&emitter, &output_event))
391
+ goto emitter_error;
392
+ }
393
+
394
+ /* End a block sequence. */
395
+
396
+ if (!yaml_sequence_end_event_initialize(&output_event))
397
+ goto event_error;
398
+ if (!yaml_emitter_emit(&emitter, &output_event))
399
+ goto emitter_error;
400
+ }
401
+
402
+ /* Write 'implicit'. */
403
+
404
+ if (!yaml_scalar_event_initialize(&output_event,
405
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"implicit", -1,
406
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
407
+ goto event_error;
408
+ if (!yaml_emitter_emit(&emitter, &output_event))
409
+ goto emitter_error;
410
+
411
+ /* Write if the document is implicit. */
412
+
413
+ if (!yaml_scalar_event_initialize(&output_event,
414
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:bool",
415
+ (yaml_char_t *)(input_event.data.document_start.implicit ?
416
+ "true" : "false"), -1,
417
+ 1, 0, YAML_PLAIN_SCALAR_STYLE))
418
+ goto event_error;
419
+ if (!yaml_emitter_emit(&emitter, &output_event))
420
+ goto emitter_error;
421
+
422
+ break;
423
+
424
+ case YAML_DOCUMENT_END_EVENT:
425
+
426
+ /* Write 'type'. */
427
+
428
+ if (!yaml_scalar_event_initialize(&output_event,
429
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"type", -1,
430
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
431
+ goto event_error;
432
+ if (!yaml_emitter_emit(&emitter, &output_event))
433
+ goto emitter_error;
434
+
435
+ /* Write 'DOCUMENT-END'. */
436
+
437
+ if (!yaml_scalar_event_initialize(&output_event,
438
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"DOCUMENT-END", -1,
439
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
440
+ goto event_error;
441
+ if (!yaml_emitter_emit(&emitter, &output_event))
442
+ goto emitter_error;
443
+
444
+ /* Write 'implicit'. */
445
+
446
+ if (!yaml_scalar_event_initialize(&output_event,
447
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"implicit", -1,
448
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
449
+ goto event_error;
450
+ if (!yaml_emitter_emit(&emitter, &output_event))
451
+ goto emitter_error;
452
+
453
+ /* Write if the document is implicit. */
454
+
455
+ if (!yaml_scalar_event_initialize(&output_event,
456
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:bool",
457
+ (yaml_char_t *)(input_event.data.document_end.implicit ?
458
+ "true" : "false"), -1,
459
+ 1, 0, YAML_PLAIN_SCALAR_STYLE))
460
+ goto event_error;
461
+ if (!yaml_emitter_emit(&emitter, &output_event))
462
+ goto emitter_error;
463
+
464
+ break;
465
+
466
+ case YAML_ALIAS_EVENT:
467
+
468
+ /* Write 'type'. */
469
+
470
+ if (!yaml_scalar_event_initialize(&output_event,
471
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"type", -1,
472
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
473
+ goto event_error;
474
+ if (!yaml_emitter_emit(&emitter, &output_event))
475
+ goto emitter_error;
476
+
477
+ /* Write 'ALIAS'. */
478
+
479
+ if (!yaml_scalar_event_initialize(&output_event,
480
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"ALIAS", -1,
481
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
482
+ goto event_error;
483
+ if (!yaml_emitter_emit(&emitter, &output_event))
484
+ goto emitter_error;
485
+
486
+ /* Write 'anchor'. */
487
+
488
+ if (!yaml_scalar_event_initialize(&output_event,
489
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"anchor", -1,
490
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
491
+ goto event_error;
492
+ if (!yaml_emitter_emit(&emitter, &output_event))
493
+ goto emitter_error;
494
+
495
+ /* Write the alias anchor. */
496
+
497
+ if (!yaml_scalar_event_initialize(&output_event,
498
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str",
499
+ input_event.data.alias.anchor, -1,
500
+ 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))
501
+ goto event_error;
502
+ if (!yaml_emitter_emit(&emitter, &output_event))
503
+ goto emitter_error;
504
+
505
+ break;
506
+
507
+ case YAML_SCALAR_EVENT:
508
+
509
+ /* Write 'type'. */
510
+
511
+ if (!yaml_scalar_event_initialize(&output_event,
512
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"type", -1,
513
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
514
+ goto event_error;
515
+ if (!yaml_emitter_emit(&emitter, &output_event))
516
+ goto emitter_error;
517
+
518
+ /* Write 'SCALAR'. */
519
+
520
+ if (!yaml_scalar_event_initialize(&output_event,
521
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"SCALAR", -1,
522
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
523
+ goto event_error;
524
+ if (!yaml_emitter_emit(&emitter, &output_event))
525
+ goto emitter_error;
526
+
527
+ /* Display the scalar anchor. */
528
+
529
+ if (input_event.data.scalar.anchor)
530
+ {
531
+ /* Write 'anchor'. */
532
+
533
+ if (!yaml_scalar_event_initialize(&output_event,
534
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"anchor", -1,
535
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
536
+ goto event_error;
537
+ if (!yaml_emitter_emit(&emitter, &output_event))
538
+ goto emitter_error;
539
+
540
+ /* Write the scalar anchor. */
541
+
542
+ if (!yaml_scalar_event_initialize(&output_event,
543
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str",
544
+ input_event.data.scalar.anchor, -1,
545
+ 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))
546
+ goto event_error;
547
+ if (!yaml_emitter_emit(&emitter, &output_event))
548
+ goto emitter_error;
549
+ }
550
+
551
+ /* Display the scalar tag. */
552
+
553
+ if (input_event.data.scalar.tag)
554
+ {
555
+ /* Write 'tag'. */
556
+
557
+ if (!yaml_scalar_event_initialize(&output_event,
558
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"tag", -1,
559
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
560
+ goto event_error;
561
+ if (!yaml_emitter_emit(&emitter, &output_event))
562
+ goto emitter_error;
563
+
564
+ /* Write the scalar tag. */
565
+
566
+ if (!yaml_scalar_event_initialize(&output_event,
567
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str",
568
+ input_event.data.scalar.tag, -1,
569
+ 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))
570
+ goto event_error;
571
+ if (!yaml_emitter_emit(&emitter, &output_event))
572
+ goto emitter_error;
573
+ }
574
+
575
+ /* Display the scalar value. */
576
+
577
+ /* Write 'value'. */
578
+
579
+ if (!yaml_scalar_event_initialize(&output_event,
580
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"value", -1,
581
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
582
+ goto event_error;
583
+ if (!yaml_emitter_emit(&emitter, &output_event))
584
+ goto emitter_error;
585
+
586
+ /* Write the scalar value. */
587
+
588
+ if (!yaml_scalar_event_initialize(&output_event,
589
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str",
590
+ input_event.data.scalar.value,
591
+ input_event.data.scalar.length,
592
+ 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))
593
+ goto event_error;
594
+ if (!yaml_emitter_emit(&emitter, &output_event))
595
+ goto emitter_error;
596
+
597
+ /* Display if the scalar tag is implicit. */
598
+
599
+ /* Write 'implicit'. */
600
+
601
+ if (!yaml_scalar_event_initialize(&output_event,
602
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"implicit", -1,
603
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
604
+ goto event_error;
605
+ if (!yaml_emitter_emit(&emitter, &output_event))
606
+ goto emitter_error;
607
+
608
+ /* Write '{'. */
609
+
610
+ if (!yaml_mapping_start_event_initialize(&output_event,
611
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:map", 1,
612
+ YAML_FLOW_MAPPING_STYLE))
613
+ goto event_error;
614
+ if (!yaml_emitter_emit(&emitter, &output_event))
615
+ goto emitter_error;
616
+
617
+ /* Write 'plain'. */
618
+
619
+ if (!yaml_scalar_event_initialize(&output_event,
620
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"plain", -1,
621
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
622
+ goto event_error;
623
+ if (!yaml_emitter_emit(&emitter, &output_event))
624
+ goto emitter_error;
625
+
626
+ /* Write if the scalar is implicit in the plain style. */
627
+
628
+ if (!yaml_scalar_event_initialize(&output_event,
629
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:bool",
630
+ (yaml_char_t * )(input_event.data.scalar.plain_implicit ?
631
+ "true" : "false"), -1,
632
+ 1, 0, YAML_PLAIN_SCALAR_STYLE))
633
+ goto event_error;
634
+ if (!yaml_emitter_emit(&emitter, &output_event))
635
+ goto emitter_error;
636
+
637
+ /* Write 'quoted'. */
638
+
639
+ if (!yaml_scalar_event_initialize(&output_event,
640
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"non-plain", -1,
641
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
642
+ goto event_error;
643
+ if (!yaml_emitter_emit(&emitter, &output_event))
644
+ goto emitter_error;
645
+
646
+ /* Write if the scalar is implicit in a non-plain style. */
647
+
648
+ if (!yaml_scalar_event_initialize(&output_event,
649
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:bool",
650
+ (yaml_char_t *)(input_event.data.scalar.quoted_implicit ?
651
+ "true" : "false"), -1,
652
+ 1, 0, YAML_PLAIN_SCALAR_STYLE))
653
+ goto event_error;
654
+ if (!yaml_emitter_emit(&emitter, &output_event))
655
+ goto emitter_error;
656
+
657
+ /* Write '}'. */
658
+
659
+ if (!yaml_mapping_end_event_initialize(&output_event))
660
+ goto event_error;
661
+ if (!yaml_emitter_emit(&emitter, &output_event))
662
+ goto emitter_error;
663
+
664
+ /* Display the style information. */
665
+
666
+ if (input_event.data.scalar.style)
667
+ {
668
+ yaml_scalar_style_t style = input_event.data.scalar.style;
669
+
670
+ /* Write 'style'. */
671
+
672
+ if (!yaml_scalar_event_initialize(&output_event,
673
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"style", -1,
674
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
675
+ goto event_error;
676
+ if (!yaml_emitter_emit(&emitter, &output_event))
677
+ goto emitter_error;
678
+
679
+ /* Write the scalar style. */
680
+
681
+ if (!yaml_scalar_event_initialize(&output_event,
682
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str",
683
+ (yaml_char_t *)(style == YAML_PLAIN_SCALAR_STYLE ? "plain" :
684
+ style == YAML_SINGLE_QUOTED_SCALAR_STYLE ?
685
+ "single-quoted" :
686
+ style == YAML_DOUBLE_QUOTED_SCALAR_STYLE ?
687
+ "double-quoted" :
688
+ style == YAML_LITERAL_SCALAR_STYLE ? "literal" :
689
+ style == YAML_FOLDED_SCALAR_STYLE ? "folded" :
690
+ "unknown"), -1,
691
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
692
+ goto event_error;
693
+ if (!yaml_emitter_emit(&emitter, &output_event))
694
+ goto emitter_error;
695
+ }
696
+
697
+ break;
698
+
699
+ case YAML_SEQUENCE_START_EVENT:
700
+
701
+ /* Write 'type'. */
702
+
703
+ if (!yaml_scalar_event_initialize(&output_event,
704
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"type", -1,
705
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
706
+ goto event_error;
707
+ if (!yaml_emitter_emit(&emitter, &output_event))
708
+ goto emitter_error;
709
+
710
+ /* Write 'SEQUENCE-START'. */
711
+
712
+ if (!yaml_scalar_event_initialize(&output_event,
713
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"SEQUENCE-START", -1,
714
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
715
+ goto event_error;
716
+ if (!yaml_emitter_emit(&emitter, &output_event))
717
+ goto emitter_error;
718
+
719
+ /* Display the sequence anchor. */
720
+
721
+ if (input_event.data.sequence_start.anchor)
722
+ {
723
+ /* Write 'anchor'. */
724
+
725
+ if (!yaml_scalar_event_initialize(&output_event,
726
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"anchor", -1,
727
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
728
+ goto event_error;
729
+ if (!yaml_emitter_emit(&emitter, &output_event))
730
+ goto emitter_error;
731
+
732
+ /* Write the sequence anchor. */
733
+
734
+ if (!yaml_scalar_event_initialize(&output_event,
735
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str",
736
+ input_event.data.sequence_start.anchor, -1,
737
+ 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))
738
+ goto event_error;
739
+ if (!yaml_emitter_emit(&emitter, &output_event))
740
+ goto emitter_error;
741
+ }
742
+
743
+ /* Display the sequence tag. */
744
+
745
+ if (input_event.data.sequence_start.tag)
746
+ {
747
+ /* Write 'tag'. */
748
+
749
+ if (!yaml_scalar_event_initialize(&output_event,
750
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"tag", -1,
751
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
752
+ goto event_error;
753
+ if (!yaml_emitter_emit(&emitter, &output_event))
754
+ goto emitter_error;
755
+
756
+ /* Write the sequence tag. */
757
+
758
+ if (!yaml_scalar_event_initialize(&output_event,
759
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str",
760
+ input_event.data.sequence_start.tag, -1,
761
+ 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))
762
+ goto event_error;
763
+ if (!yaml_emitter_emit(&emitter, &output_event))
764
+ goto emitter_error;
765
+ }
766
+
767
+ /* Write 'implicit'. */
768
+
769
+ if (!yaml_scalar_event_initialize(&output_event,
770
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"implicit", -1,
771
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
772
+ goto event_error;
773
+ if (!yaml_emitter_emit(&emitter, &output_event))
774
+ goto emitter_error;
775
+
776
+ /* Write if the sequence tag is implicit. */
777
+
778
+ if (!yaml_scalar_event_initialize(&output_event,
779
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:bool",
780
+ (yaml_char_t *)(input_event.data.sequence_start.implicit ?
781
+ "true" : "false"), -1,
782
+ 1, 0, YAML_PLAIN_SCALAR_STYLE))
783
+ goto event_error;
784
+ if (!yaml_emitter_emit(&emitter, &output_event))
785
+ goto emitter_error;
786
+
787
+ /* Display the style information. */
788
+
789
+ if (input_event.data.sequence_start.style)
790
+ {
791
+ yaml_sequence_style_t style
792
+ = input_event.data.sequence_start.style;
793
+
794
+ /* Write 'style'. */
795
+
796
+ if (!yaml_scalar_event_initialize(&output_event,
797
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"style", -1,
798
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
799
+ goto event_error;
800
+ if (!yaml_emitter_emit(&emitter, &output_event))
801
+ goto emitter_error;
802
+
803
+ /* Write the scalar style. */
804
+
805
+ if (!yaml_scalar_event_initialize(&output_event,
806
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str",
807
+ (yaml_char_t *)(style == YAML_BLOCK_SEQUENCE_STYLE ? "block" :
808
+ style == YAML_FLOW_SEQUENCE_STYLE ? "flow" :
809
+ "unknown"), -1,
810
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
811
+ goto event_error;
812
+ if (!yaml_emitter_emit(&emitter, &output_event))
813
+ goto emitter_error;
814
+ }
815
+
816
+ break;
817
+
818
+ case YAML_SEQUENCE_END_EVENT:
819
+
820
+ /* Write 'type'. */
821
+
822
+ if (!yaml_scalar_event_initialize(&output_event,
823
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"type", -1,
824
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
825
+ goto event_error;
826
+ if (!yaml_emitter_emit(&emitter, &output_event))
827
+ goto emitter_error;
828
+
829
+ /* Write 'SEQUENCE-END'. */
830
+
831
+ if (!yaml_scalar_event_initialize(&output_event,
832
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"SEQUENCE-END", -1,
833
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
834
+ goto event_error;
835
+ if (!yaml_emitter_emit(&emitter, &output_event))
836
+ goto emitter_error;
837
+
838
+ break;
839
+
840
+ case YAML_MAPPING_START_EVENT:
841
+
842
+ /* Write 'type'. */
843
+
844
+ if (!yaml_scalar_event_initialize(&output_event,
845
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"type", -1,
846
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
847
+ goto event_error;
848
+ if (!yaml_emitter_emit(&emitter, &output_event))
849
+ goto emitter_error;
850
+
851
+ /* Write 'MAPPING-START'. */
852
+
853
+ if (!yaml_scalar_event_initialize(&output_event,
854
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"MAPPING-START", -1,
855
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
856
+ goto event_error;
857
+ if (!yaml_emitter_emit(&emitter, &output_event))
858
+ goto emitter_error;
859
+
860
+ /* Display the mapping anchor. */
861
+
862
+ if (input_event.data.mapping_start.anchor)
863
+ {
864
+ /* Write 'anchor'. */
865
+
866
+ if (!yaml_scalar_event_initialize(&output_event,
867
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"anchor", -1,
868
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
869
+ goto event_error;
870
+ if (!yaml_emitter_emit(&emitter, &output_event))
871
+ goto emitter_error;
872
+
873
+ /* Write the mapping anchor. */
874
+
875
+ if (!yaml_scalar_event_initialize(&output_event,
876
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str",
877
+ input_event.data.mapping_start.anchor, -1,
878
+ 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))
879
+ goto event_error;
880
+ if (!yaml_emitter_emit(&emitter, &output_event))
881
+ goto emitter_error;
882
+ }
883
+
884
+ /* Display the mapping tag. */
885
+
886
+ if (input_event.data.mapping_start.tag)
887
+ {
888
+ /* Write 'tag'. */
889
+
890
+ if (!yaml_scalar_event_initialize(&output_event,
891
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"tag", -1,
892
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
893
+ goto event_error;
894
+ if (!yaml_emitter_emit(&emitter, &output_event))
895
+ goto emitter_error;
896
+
897
+ /* Write the mapping tag. */
898
+
899
+ if (!yaml_scalar_event_initialize(&output_event,
900
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str",
901
+ input_event.data.mapping_start.tag, -1,
902
+ 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))
903
+ goto event_error;
904
+ if (!yaml_emitter_emit(&emitter, &output_event))
905
+ goto emitter_error;
906
+ }
907
+
908
+ /* Write 'implicit'. */
909
+
910
+ if (!yaml_scalar_event_initialize(&output_event,
911
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"implicit", -1,
912
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
913
+ goto event_error;
914
+ if (!yaml_emitter_emit(&emitter, &output_event))
915
+ goto emitter_error;
916
+
917
+ /* Write if the mapping tag is implicit. */
918
+
919
+ if (!yaml_scalar_event_initialize(&output_event,
920
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:bool",
921
+ (yaml_char_t *)(input_event.data.mapping_start.implicit ?
922
+ "true" : "false"), -1,
923
+ 1, 0, YAML_PLAIN_SCALAR_STYLE))
924
+ goto event_error;
925
+ if (!yaml_emitter_emit(&emitter, &output_event))
926
+ goto emitter_error;
927
+
928
+ /* Display the style information. */
929
+
930
+ if (input_event.data.mapping_start.style)
931
+ {
932
+ yaml_mapping_style_t style
933
+ = input_event.data.mapping_start.style;
934
+
935
+ /* Write 'style'. */
936
+
937
+ if (!yaml_scalar_event_initialize(&output_event,
938
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"style", -1,
939
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
940
+ goto event_error;
941
+ if (!yaml_emitter_emit(&emitter, &output_event))
942
+ goto emitter_error;
943
+
944
+ /* Write the scalar style. */
945
+
946
+ if (!yaml_scalar_event_initialize(&output_event,
947
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str",
948
+ (yaml_char_t *)(style == YAML_BLOCK_MAPPING_STYLE ? "block" :
949
+ style == YAML_FLOW_MAPPING_STYLE ? "flow" :
950
+ "unknown"), -1,
951
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
952
+ goto event_error;
953
+ if (!yaml_emitter_emit(&emitter, &output_event))
954
+ goto emitter_error;
955
+ }
956
+
957
+ break;
958
+
959
+ case YAML_MAPPING_END_EVENT:
960
+
961
+ /* Write 'type'. */
962
+
963
+ if (!yaml_scalar_event_initialize(&output_event,
964
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"type", -1,
965
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
966
+ goto event_error;
967
+ if (!yaml_emitter_emit(&emitter, &output_event))
968
+ goto emitter_error;
969
+
970
+ /* Write 'MAPPING-END'. */
971
+
972
+ if (!yaml_scalar_event_initialize(&output_event,
973
+ NULL, (yaml_char_t *)"tag:yaml.org,2002:str", (yaml_char_t *)"MAPPING-END", -1,
974
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
975
+ goto event_error;
976
+ if (!yaml_emitter_emit(&emitter, &output_event))
977
+ goto emitter_error;
978
+
979
+ break;
980
+
981
+ default:
982
+ /* It couldn't really happen. */
983
+ break;
984
+ }
985
+
986
+ /* Delete the event object. */
987
+
988
+ yaml_event_delete(&input_event);
989
+
990
+ /* Create and emit a MAPPING-END event. */
991
+
992
+ if (!yaml_mapping_end_event_initialize(&output_event))
993
+ goto event_error;
994
+ if (!yaml_emitter_emit(&emitter, &output_event))
995
+ goto emitter_error;
996
+ }
997
+
998
+ /* Create and emit the SEQUENCE-END event. */
999
+
1000
+ if (!yaml_sequence_end_event_initialize(&output_event))
1001
+ goto event_error;
1002
+ if (!yaml_emitter_emit(&emitter, &output_event))
1003
+ goto emitter_error;
1004
+
1005
+ /* Create and emit the DOCUMENT-END event. */
1006
+
1007
+ if (!yaml_document_end_event_initialize(&output_event, 0))
1008
+ goto event_error;
1009
+ if (!yaml_emitter_emit(&emitter, &output_event))
1010
+ goto emitter_error;
1011
+
1012
+ /* Create and emit the STREAM-END event. */
1013
+
1014
+ if (!yaml_stream_end_event_initialize(&output_event))
1015
+ goto event_error;
1016
+ if (!yaml_emitter_emit(&emitter, &output_event))
1017
+ goto emitter_error;
1018
+
1019
+ yaml_parser_delete(&parser);
1020
+ yaml_emitter_delete(&emitter);
1021
+
1022
+ return 0;
1023
+
1024
+ parser_error:
1025
+
1026
+ /* Display a parser error message. */
1027
+
1028
+ switch (parser.error)
1029
+ {
1030
+ case YAML_MEMORY_ERROR:
1031
+ fprintf(stderr, "Memory error: Not enough memory for parsing\n");
1032
+ break;
1033
+
1034
+ case YAML_READER_ERROR:
1035
+ if (parser.problem_value != -1) {
1036
+ fprintf(stderr, "Reader error: %s: #%X at %ld\n", parser.problem,
1037
+ parser.problem_value, (long)parser.problem_offset);
1038
+ }
1039
+ else {
1040
+ fprintf(stderr, "Reader error: %s at %ld\n", parser.problem,
1041
+ (long)parser.problem_offset);
1042
+ }
1043
+ break;
1044
+
1045
+ case YAML_SCANNER_ERROR:
1046
+ if (parser.context) {
1047
+ fprintf(stderr, "Scanner error: %s at line %d, column %d\n"
1048
+ "%s at line %d, column %d\n", parser.context,
1049
+ (int)parser.context_mark.line+1, (int)parser.context_mark.column+1,
1050
+ parser.problem, (int)parser.problem_mark.line+1,
1051
+ (int)parser.problem_mark.column+1);
1052
+ }
1053
+ else {
1054
+ fprintf(stderr, "Scanner error: %s at line %d, column %d\n",
1055
+ parser.problem, (int)parser.problem_mark.line+1,
1056
+ (int)parser.problem_mark.column+1);
1057
+ }
1058
+ break;
1059
+
1060
+ case YAML_PARSER_ERROR:
1061
+ if (parser.context) {
1062
+ fprintf(stderr, "Parser error: %s at line %d, column %d\n"
1063
+ "%s at line %d, column %d\n", parser.context,
1064
+ (int)parser.context_mark.line+1, (int)parser.context_mark.column+1,
1065
+ parser.problem, (int)parser.problem_mark.line+1,
1066
+ (int)parser.problem_mark.column+1);
1067
+ }
1068
+ else {
1069
+ fprintf(stderr, "Parser error: %s at line %d, column %d\n",
1070
+ parser.problem, (int)parser.problem_mark.line+1,
1071
+ (int)parser.problem_mark.column+1);
1072
+ }
1073
+ break;
1074
+
1075
+ default:
1076
+ /* Couldn't happen. */
1077
+ fprintf(stderr, "Internal error\n");
1078
+ break;
1079
+ }
1080
+
1081
+ yaml_event_delete(&input_event);
1082
+ yaml_parser_delete(&parser);
1083
+ yaml_emitter_delete(&emitter);
1084
+
1085
+ return 1;
1086
+
1087
+ emitter_error:
1088
+
1089
+ /* Display an emitter error message. */
1090
+
1091
+ switch (emitter.error)
1092
+ {
1093
+ case YAML_MEMORY_ERROR:
1094
+ fprintf(stderr, "Memory error: Not enough memory for emitting\n");
1095
+ break;
1096
+
1097
+ case YAML_WRITER_ERROR:
1098
+ fprintf(stderr, "Writer error: %s\n", emitter.problem);
1099
+ break;
1100
+
1101
+ case YAML_EMITTER_ERROR:
1102
+ fprintf(stderr, "Emitter error: %s\n", emitter.problem);
1103
+ break;
1104
+
1105
+ default:
1106
+ /* Couldn't happen. */
1107
+ fprintf(stderr, "Internal error\n");
1108
+ break;
1109
+ }
1110
+
1111
+ yaml_event_delete(&input_event);
1112
+ yaml_parser_delete(&parser);
1113
+ yaml_emitter_delete(&emitter);
1114
+
1115
+ return 1;
1116
+
1117
+ event_error:
1118
+
1119
+ fprintf(stderr, "Memory error: Not enough memory for creating an event\n");
1120
+
1121
+ yaml_event_delete(&input_event);
1122
+ yaml_parser_delete(&parser);
1123
+ yaml_emitter_delete(&emitter);
1124
+
1125
+ return 1;
1126
+ }
1127
+