commonmarker 0.0.1

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

Potentially problematic release.


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

Files changed (291) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +8 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.md +119 -0
  5. data/Rakefile +39 -0
  6. data/bin/commonmarker +41 -0
  7. data/commonmarker.gemspec +30 -0
  8. data/ext/commonmarker/cmark/CMakeLists.txt +25 -0
  9. data/ext/commonmarker/cmark/COPYING +192 -0
  10. data/ext/commonmarker/cmark/FindAsan.cmake +74 -0
  11. data/ext/commonmarker/cmark/Makefile +170 -0
  12. data/ext/commonmarker/cmark/Makefile.nmake +36 -0
  13. data/ext/commonmarker/cmark/README.md +169 -0
  14. data/ext/commonmarker/cmark/api_test/CMakeLists.txt +25 -0
  15. data/ext/commonmarker/cmark/api_test/cplusplus.cpp +15 -0
  16. data/ext/commonmarker/cmark/api_test/cplusplus.h +17 -0
  17. data/ext/commonmarker/cmark/api_test/harness.c +102 -0
  18. data/ext/commonmarker/cmark/api_test/harness.h +42 -0
  19. data/ext/commonmarker/cmark/api_test/main.c +700 -0
  20. data/ext/commonmarker/cmark/appveyor.yml +15 -0
  21. data/ext/commonmarker/cmark/bench/statistics.py +595 -0
  22. data/ext/commonmarker/cmark/bench/stats.py +19 -0
  23. data/ext/commonmarker/cmark/benchmarks.md +33 -0
  24. data/ext/commonmarker/cmark/build/CMakeCache.txt +362 -0
  25. data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CMakeCCompiler.cmake +63 -0
  26. data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CMakeCXXCompiler.cmake +64 -0
  27. data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CMakeDetermineCompilerABI_C.bin +0 -0
  28. data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CMakeDetermineCompilerABI_CXX.bin +0 -0
  29. data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CMakeSystem.cmake +15 -0
  30. data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CompilerIdC/CMakeCCompilerId.c +499 -0
  31. data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CompilerIdC/a.out +0 -0
  32. data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CompilerIdCXX/CMakeCXXCompilerId.cpp +489 -0
  33. data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CompilerIdCXX/a.out +0 -0
  34. data/ext/commonmarker/cmark/build/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  35. data/ext/commonmarker/cmark/build/CMakeFiles/CMakeError.log +30 -0
  36. data/ext/commonmarker/cmark/build/CMakeFiles/CMakeOutput.log +598 -0
  37. data/ext/commonmarker/cmark/build/CMakeFiles/Makefile.cmake +77 -0
  38. data/ext/commonmarker/cmark/build/CMakeFiles/Makefile2 +268 -0
  39. data/ext/commonmarker/cmark/build/CMakeFiles/TargetDirectories.txt +4 -0
  40. data/ext/commonmarker/cmark/build/CMakeFiles/cmake.check_cache +1 -0
  41. data/ext/commonmarker/cmark/build/CMakeFiles/feature_tests.bin +0 -0
  42. data/ext/commonmarker/cmark/build/CMakeFiles/feature_tests.c +34 -0
  43. data/ext/commonmarker/cmark/build/CMakeFiles/feature_tests.cxx +405 -0
  44. data/ext/commonmarker/cmark/build/CMakeFiles/progress.marks +1 -0
  45. data/ext/commonmarker/cmark/build/CTestTestfile.cmake +10 -0
  46. data/ext/commonmarker/cmark/build/Makefile +237 -0
  47. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  48. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/C.includecache +92 -0
  49. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/CXX.includecache +36 -0
  50. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/DependInfo.cmake +29 -0
  51. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/build.make +155 -0
  52. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/cmake_clean.cmake +12 -0
  53. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/cplusplus.cpp.o +0 -0
  54. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/depend.internal +25 -0
  55. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/depend.make +25 -0
  56. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/flags.make +13 -0
  57. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/harness.c.o +0 -0
  58. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/link.txt +1 -0
  59. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/main.c.o +0 -0
  60. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/progress.make +4 -0
  61. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/progress.marks +1 -0
  62. data/ext/commonmarker/cmark/build/api_test/Makefile +277 -0
  63. data/ext/commonmarker/cmark/build/api_test/api_test +0 -0
  64. data/ext/commonmarker/cmark/build/api_test/cmake_install.cmake +29 -0
  65. data/ext/commonmarker/cmark/build/cmake_install.cmake +48 -0
  66. data/ext/commonmarker/cmark/build/man/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  67. data/ext/commonmarker/cmark/build/man/CMakeFiles/progress.marks +1 -0
  68. data/ext/commonmarker/cmark/build/man/Makefile +181 -0
  69. data/ext/commonmarker/cmark/build/man/cmake_install.cmake +37 -0
  70. data/ext/commonmarker/cmark/build/src/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  71. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/C.includecache +422 -0
  72. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/DependInfo.cmake +39 -0
  73. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/blocks.c.o +0 -0
  74. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/buffer.c.o +0 -0
  75. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/build.make +544 -0
  76. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/cmake_clean.cmake +27 -0
  77. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/cmark.c.o +0 -0
  78. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/cmark_ctype.c.o +0 -0
  79. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/commonmark.c.o +0 -0
  80. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/depend.internal +177 -0
  81. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/depend.make +177 -0
  82. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/flags.make +8 -0
  83. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/houdini_href_e.c.o +0 -0
  84. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/houdini_html_e.c.o +0 -0
  85. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/houdini_html_u.c.o +0 -0
  86. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/html.c.o +0 -0
  87. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/inlines.c.o +0 -0
  88. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/iterator.c.o +0 -0
  89. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/link.txt +1 -0
  90. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/main.c.o +0 -0
  91. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/man.c.o +0 -0
  92. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/node.c.o +0 -0
  93. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/progress.make +19 -0
  94. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/references.c.o +0 -0
  95. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/scanners.c.o +0 -0
  96. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/utf8.c.o +0 -0
  97. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/xml.c.o +0 -0
  98. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/C.includecache +394 -0
  99. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/DependInfo.cmake +44 -0
  100. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/blocks.c.o +0 -0
  101. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/buffer.c.o +0 -0
  102. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/build.make +522 -0
  103. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/cmake_clean.cmake +27 -0
  104. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/cmark.c.o +0 -0
  105. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/cmark_ctype.c.o +0 -0
  106. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/commonmark.c.o +0 -0
  107. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/depend.internal +169 -0
  108. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/depend.make +169 -0
  109. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/flags.make +8 -0
  110. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/houdini_href_e.c.o +0 -0
  111. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/houdini_html_e.c.o +0 -0
  112. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/houdini_html_u.c.o +0 -0
  113. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/html.c.o +0 -0
  114. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/inlines.c.o +0 -0
  115. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/iterator.c.o +0 -0
  116. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/link.txt +1 -0
  117. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/man.c.o +0 -0
  118. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/node.c.o +0 -0
  119. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/progress.make +18 -0
  120. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/references.c.o +0 -0
  121. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/scanners.c.o +0 -0
  122. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/utf8.c.o +0 -0
  123. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/xml.c.o +0 -0
  124. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/C.includecache +394 -0
  125. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/DependInfo.cmake +38 -0
  126. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/blocks.c.o +0 -0
  127. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/buffer.c.o +0 -0
  128. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/build.make +519 -0
  129. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/cmake_clean.cmake +26 -0
  130. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/cmake_clean_target.cmake +3 -0
  131. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/cmark.c.o +0 -0
  132. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/cmark_ctype.c.o +0 -0
  133. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/commonmark.c.o +0 -0
  134. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/depend.internal +169 -0
  135. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/depend.make +169 -0
  136. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/flags.make +8 -0
  137. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/houdini_href_e.c.o +0 -0
  138. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/houdini_html_e.c.o +0 -0
  139. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/houdini_html_u.c.o +0 -0
  140. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/html.c.o +0 -0
  141. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/inlines.c.o +0 -0
  142. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/iterator.c.o +0 -0
  143. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/link.txt +2 -0
  144. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/man.c.o +0 -0
  145. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/node.c.o +0 -0
  146. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/progress.make +18 -0
  147. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/references.c.o +0 -0
  148. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/scanners.c.o +0 -0
  149. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/utf8.c.o +0 -0
  150. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/xml.c.o +0 -0
  151. data/ext/commonmarker/cmark/build/src/CMakeFiles/progress.marks +1 -0
  152. data/ext/commonmarker/cmark/build/src/Makefile +814 -0
  153. data/ext/commonmarker/cmark/build/src/cmake_install.cmake +69 -0
  154. data/ext/commonmarker/cmark/build/src/cmark +0 -0
  155. data/ext/commonmarker/cmark/build/src/cmark_export.h +41 -0
  156. data/ext/commonmarker/cmark/build/src/cmark_version.h +7 -0
  157. data/ext/commonmarker/cmark/build/src/config.h +23 -0
  158. data/ext/commonmarker/cmark/build/src/libcmark.0.19.0.dylib +0 -0
  159. data/ext/commonmarker/cmark/build/src/libcmark.a +0 -0
  160. data/ext/commonmarker/cmark/build/src/libcmark.dylib +0 -0
  161. data/ext/commonmarker/cmark/build/src/libcmark.pc +10 -0
  162. data/ext/commonmarker/cmark/build/testdir/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  163. data/ext/commonmarker/cmark/build/testdir/CMakeFiles/progress.marks +1 -0
  164. data/ext/commonmarker/cmark/build/testdir/CTestTestfile.cmake +12 -0
  165. data/ext/commonmarker/cmark/build/testdir/Makefile +181 -0
  166. data/ext/commonmarker/cmark/build/testdir/cmake_install.cmake +29 -0
  167. data/ext/commonmarker/cmark/changelog.txt +153 -0
  168. data/ext/commonmarker/cmark/data/CaseFolding-3.2.0.txt +912 -0
  169. data/ext/commonmarker/cmark/man/CMakeLists.txt +8 -0
  170. data/ext/commonmarker/cmark/man/make_man_page.py +131 -0
  171. data/ext/commonmarker/cmark/man/man1/cmark.1 +54 -0
  172. data/ext/commonmarker/cmark/man/man3/cmark.3 +583 -0
  173. data/ext/commonmarker/cmark/nmake.bat +1 -0
  174. data/ext/commonmarker/cmark/src/CMakeLists.txt +166 -0
  175. data/ext/commonmarker/cmark/src/bench.h +27 -0
  176. data/ext/commonmarker/cmark/src/blocks.c +887 -0
  177. data/ext/commonmarker/cmark/src/buffer.c +381 -0
  178. data/ext/commonmarker/cmark/src/buffer.h +113 -0
  179. data/ext/commonmarker/cmark/src/case_fold_switch.inc +2637 -0
  180. data/ext/commonmarker/cmark/src/chunk.h +110 -0
  181. data/ext/commonmarker/cmark/src/cmark.c +24 -0
  182. data/ext/commonmarker/cmark/src/cmark.h +565 -0
  183. data/ext/commonmarker/cmark/src/cmark_ctype.c +53 -0
  184. data/ext/commonmarker/cmark/src/cmark_ctype.h +24 -0
  185. data/ext/commonmarker/cmark/src/cmark_version.h.in +7 -0
  186. data/ext/commonmarker/cmark/src/commonmark.c +607 -0
  187. data/ext/commonmarker/cmark/src/config.h.in +23 -0
  188. data/ext/commonmarker/cmark/src/debug.h +36 -0
  189. data/ext/commonmarker/cmark/src/houdini.h +52 -0
  190. data/ext/commonmarker/cmark/src/houdini_href_e.c +107 -0
  191. data/ext/commonmarker/cmark/src/houdini_html_e.c +81 -0
  192. data/ext/commonmarker/cmark/src/houdini_html_u.c +116 -0
  193. data/ext/commonmarker/cmark/src/html.c +322 -0
  194. data/ext/commonmarker/cmark/src/html_unescape.gperf +2130 -0
  195. data/ext/commonmarker/cmark/src/html_unescape.h +13375 -0
  196. data/ext/commonmarker/cmark/src/inlines.c +1147 -0
  197. data/ext/commonmarker/cmark/src/inlines.h +19 -0
  198. data/ext/commonmarker/cmark/src/iterator.c +148 -0
  199. data/ext/commonmarker/cmark/src/iterator.h +25 -0
  200. data/ext/commonmarker/cmark/src/libcmark.pc.in +10 -0
  201. data/ext/commonmarker/cmark/src/main.c +191 -0
  202. data/ext/commonmarker/cmark/src/man.c +287 -0
  203. data/ext/commonmarker/cmark/src/node.c +873 -0
  204. data/ext/commonmarker/cmark/src/node.h +82 -0
  205. data/ext/commonmarker/cmark/src/parser.h +29 -0
  206. data/ext/commonmarker/cmark/src/references.c +154 -0
  207. data/ext/commonmarker/cmark/src/references.h +37 -0
  208. data/ext/commonmarker/cmark/src/scanners.c +15291 -0
  209. data/ext/commonmarker/cmark/src/scanners.h +41 -0
  210. data/ext/commonmarker/cmark/src/scanners.re +247 -0
  211. data/ext/commonmarker/cmark/src/utf8.c +452 -0
  212. data/ext/commonmarker/cmark/src/utf8.h +22 -0
  213. data/ext/commonmarker/cmark/src/xml.c +170 -0
  214. data/ext/commonmarker/cmark/test/CMakeLists.txt +53 -0
  215. data/ext/commonmarker/cmark/test/afl_dictionary/asterisk +1 -0
  216. data/ext/commonmarker/cmark/test/afl_dictionary/attr_generic +1 -0
  217. data/ext/commonmarker/cmark/test/afl_dictionary/attr_href +1 -0
  218. data/ext/commonmarker/cmark/test/afl_dictionary/attr_xml_lang +1 -0
  219. data/ext/commonmarker/cmark/test/afl_dictionary/attr_xmlns +1 -0
  220. data/ext/commonmarker/cmark/test/afl_dictionary/backslash +1 -0
  221. data/ext/commonmarker/cmark/test/afl_dictionary/backtick +1 -0
  222. data/ext/commonmarker/cmark/test/afl_dictionary/colon +1 -0
  223. data/ext/commonmarker/cmark/test/afl_dictionary/dashes +1 -0
  224. data/ext/commonmarker/cmark/test/afl_dictionary/double_quote +1 -0
  225. data/ext/commonmarker/cmark/test/afl_dictionary/entity_builtin +1 -0
  226. data/ext/commonmarker/cmark/test/afl_dictionary/entity_decimal +1 -0
  227. data/ext/commonmarker/cmark/test/afl_dictionary/entity_external +1 -0
  228. data/ext/commonmarker/cmark/test/afl_dictionary/entity_hex +1 -0
  229. data/ext/commonmarker/cmark/test/afl_dictionary/equals +1 -0
  230. data/ext/commonmarker/cmark/test/afl_dictionary/exclamation +1 -0
  231. data/ext/commonmarker/cmark/test/afl_dictionary/greater_than +1 -0
  232. data/ext/commonmarker/cmark/test/afl_dictionary/hash +1 -0
  233. data/ext/commonmarker/cmark/test/afl_dictionary/hyphen +0 -0
  234. data/ext/commonmarker/cmark/test/afl_dictionary/indent +1 -0
  235. data/ext/commonmarker/cmark/test/afl_dictionary/left_bracket +1 -0
  236. data/ext/commonmarker/cmark/test/afl_dictionary/left_paren +1 -0
  237. data/ext/commonmarker/cmark/test/afl_dictionary/less_than +1 -0
  238. data/ext/commonmarker/cmark/test/afl_dictionary/plus +1 -0
  239. data/ext/commonmarker/cmark/test/afl_dictionary/right_bracket +1 -0
  240. data/ext/commonmarker/cmark/test/afl_dictionary/right_paren +1 -0
  241. data/ext/commonmarker/cmark/test/afl_dictionary/single_quote +1 -0
  242. data/ext/commonmarker/cmark/test/afl_dictionary/string_any +1 -0
  243. data/ext/commonmarker/cmark/test/afl_dictionary/string_brackets +1 -0
  244. data/ext/commonmarker/cmark/test/afl_dictionary/string_cdata +1 -0
  245. data/ext/commonmarker/cmark/test/afl_dictionary/string_dashes +1 -0
  246. data/ext/commonmarker/cmark/test/afl_dictionary/string_empty_dblquotes +1 -0
  247. data/ext/commonmarker/cmark/test/afl_dictionary/string_empty_quotes +1 -0
  248. data/ext/commonmarker/cmark/test/afl_dictionary/string_idrefs +1 -0
  249. data/ext/commonmarker/cmark/test/afl_dictionary/string_parentheses +1 -0
  250. data/ext/commonmarker/cmark/test/afl_dictionary/string_pcdata +1 -0
  251. data/ext/commonmarker/cmark/test/afl_dictionary/tag_cdata +1 -0
  252. data/ext/commonmarker/cmark/test/afl_dictionary/tag_close +1 -0
  253. data/ext/commonmarker/cmark/test/afl_dictionary/tag_doctype +1 -0
  254. data/ext/commonmarker/cmark/test/afl_dictionary/tag_element +1 -0
  255. data/ext/commonmarker/cmark/test/afl_dictionary/tag_entity +1 -0
  256. data/ext/commonmarker/cmark/test/afl_dictionary/tag_notation +1 -0
  257. data/ext/commonmarker/cmark/test/afl_dictionary/tag_open +1 -0
  258. data/ext/commonmarker/cmark/test/afl_dictionary/tag_open_close +1 -0
  259. data/ext/commonmarker/cmark/test/afl_dictionary/tag_open_exclamation +1 -0
  260. data/ext/commonmarker/cmark/test/afl_dictionary/tag_open_q +1 -0
  261. data/ext/commonmarker/cmark/test/afl_dictionary/tag_sq2_close +1 -0
  262. data/ext/commonmarker/cmark/test/afl_dictionary/tag_xml_q +1 -0
  263. data/ext/commonmarker/cmark/test/afl_dictionary/underscore +1 -0
  264. data/ext/commonmarker/cmark/test/afl_test_cases/test.md +36 -0
  265. data/ext/commonmarker/cmark/test/cmark.py +40 -0
  266. data/ext/commonmarker/cmark/test/normalize.py +179 -0
  267. data/ext/commonmarker/cmark/test/pathological_tests.py +63 -0
  268. data/ext/commonmarker/cmark/test/roundtrip.sh +2 -0
  269. data/ext/commonmarker/cmark/test/smart_punct.txt +96 -0
  270. data/ext/commonmarker/cmark/test/spec.txt +7505 -0
  271. data/ext/commonmarker/cmark/test/spec_tests.py +139 -0
  272. data/ext/commonmarker/cmark/toolchain-mingw32.cmake +17 -0
  273. data/ext/commonmarker/cmark/tools/mkcasefold.pl +22 -0
  274. data/ext/commonmarker/cmark/wrappers/wrapper.lua +239 -0
  275. data/ext/commonmarker/cmark/wrappers/wrapper.py +37 -0
  276. data/ext/commonmarker/cmark/wrappers/wrapper.rb +15 -0
  277. data/ext/commonmarker/cmark/wrappers/wrapper.rkt +190 -0
  278. data/ext/commonmarker/commonmarker.c +165 -0
  279. data/ext/commonmarker/commonmarker.h +11 -0
  280. data/ext/commonmarker/extconf.rb +18 -0
  281. data/lib/commonmarker/config.rb +20 -0
  282. data/lib/commonmarker/version.rb +3 -0
  283. data/lib/commonmarker.rb +588 -0
  284. data/test/benchmark.rb +30 -0
  285. data/test/spec_tests.json +4074 -0
  286. data/test/test_basics.rb +44 -0
  287. data/test/test_helper.rb +5 -0
  288. data/test/test_maliciousness.rb +9 -0
  289. data/test/test_pathological_inputs.rb +52 -0
  290. data/test/test_spec.rb +20 -0
  291. metadata +399 -0
@@ -0,0 +1,499 @@
1
+ #ifdef __cplusplus
2
+ # error "A C++ compiler has been selected for C."
3
+ #endif
4
+
5
+ #if defined(__18CXX)
6
+ # define ID_VOID_MAIN
7
+ #endif
8
+
9
+
10
+ /* Version number components: V=Version, R=Revision, P=Patch
11
+ Version date components: YYYY=Year, MM=Month, DD=Day */
12
+
13
+ #if defined(__INTEL_COMPILER) || defined(__ICC)
14
+ # define COMPILER_ID "Intel"
15
+ # if defined(_MSC_VER)
16
+ # define SIMULATE_ID "MSVC"
17
+ # endif
18
+ /* __INTEL_COMPILER = VRP */
19
+ # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
20
+ # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
21
+ # if defined(__INTEL_COMPILER_UPDATE)
22
+ # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
23
+ # else
24
+ # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
25
+ # endif
26
+ # if defined(__INTEL_COMPILER_BUILD_DATE)
27
+ /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
28
+ # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
29
+ # endif
30
+ # if defined(_MSC_VER)
31
+ /* _MSC_VER = VVRR */
32
+ # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
33
+ # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
34
+ # endif
35
+
36
+ #elif defined(__PATHCC__)
37
+ # define COMPILER_ID "PathScale"
38
+ # define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
39
+ # define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
40
+ # if defined(__PATHCC_PATCHLEVEL__)
41
+ # define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
42
+ # endif
43
+
44
+ #elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
45
+ # define COMPILER_ID "Embarcadero"
46
+ # define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
47
+ # define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
48
+ # define COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__ & 0xFFFF)
49
+
50
+ #elif defined(__BORLANDC__)
51
+ # define COMPILER_ID "Borland"
52
+ /* __BORLANDC__ = 0xVRR */
53
+ # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
54
+ # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
55
+
56
+ #elif defined(__WATCOMC__) && __WATCOMC__ < 1200
57
+ # define COMPILER_ID "Watcom"
58
+ /* __WATCOMC__ = VVRR */
59
+ # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
60
+ # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
61
+ # if (__WATCOMC__ % 10) > 0
62
+ # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
63
+ # endif
64
+
65
+ #elif defined(__WATCOMC__)
66
+ # define COMPILER_ID "OpenWatcom"
67
+ /* __WATCOMC__ = VVRP + 1100 */
68
+ # define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
69
+ # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
70
+ # if (__WATCOMC__ % 10) > 0
71
+ # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
72
+ # endif
73
+
74
+ #elif defined(__SUNPRO_C)
75
+ # define COMPILER_ID "SunPro"
76
+ # if __SUNPRO_C >= 0x5100
77
+ /* __SUNPRO_C = 0xVRRP */
78
+ # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
79
+ # define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
80
+ # define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
81
+ # else
82
+ /* __SUNPRO_CC = 0xVRP */
83
+ # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
84
+ # define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
85
+ # define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
86
+ # endif
87
+
88
+ #elif defined(__HP_cc)
89
+ # define COMPILER_ID "HP"
90
+ /* __HP_cc = VVRRPP */
91
+ # define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
92
+ # define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
93
+ # define COMPILER_VERSION_PATCH DEC(__HP_cc % 100)
94
+
95
+ #elif defined(__DECC)
96
+ # define COMPILER_ID "Compaq"
97
+ /* __DECC_VER = VVRRTPPPP */
98
+ # define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
99
+ # define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
100
+ # define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)
101
+
102
+ #elif defined(__IBMC__) && defined(__COMPILER_VER__)
103
+ # define COMPILER_ID "zOS"
104
+ /* __IBMC__ = VRP */
105
+ # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
106
+ # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
107
+ # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
108
+
109
+ #elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800
110
+ # define COMPILER_ID "XL"
111
+ /* __IBMC__ = VRP */
112
+ # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
113
+ # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
114
+ # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
115
+
116
+ #elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800
117
+ # define COMPILER_ID "VisualAge"
118
+ /* __IBMC__ = VRP */
119
+ # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
120
+ # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
121
+ # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
122
+
123
+ #elif defined(__PGI)
124
+ # define COMPILER_ID "PGI"
125
+ # define COMPILER_VERSION_MAJOR DEC(__PGIC__)
126
+ # define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
127
+ # if defined(__PGIC_PATCHLEVEL__)
128
+ # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
129
+ # endif
130
+
131
+ #elif defined(_CRAYC)
132
+ # define COMPILER_ID "Cray"
133
+ # define COMPILER_VERSION_MAJOR DEC(_RELEASE)
134
+ # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
135
+
136
+ #elif defined(__TI_COMPILER_VERSION__)
137
+ # define COMPILER_ID "TI"
138
+ /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
139
+ # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
140
+ # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
141
+ # define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
142
+
143
+ #elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version)
144
+ # define COMPILER_ID "Fujitsu"
145
+
146
+ #elif defined(__TINYC__)
147
+ # define COMPILER_ID "TinyCC"
148
+
149
+ #elif defined(__SCO_VERSION__)
150
+ # define COMPILER_ID "SCO"
151
+
152
+ #elif defined(__clang__) && defined(__apple_build_version__)
153
+ # define COMPILER_ID "AppleClang"
154
+ # if defined(_MSC_VER)
155
+ # define SIMULATE_ID "MSVC"
156
+ # endif
157
+ # define COMPILER_VERSION_MAJOR DEC(__clang_major__)
158
+ # define COMPILER_VERSION_MINOR DEC(__clang_minor__)
159
+ # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
160
+ # if defined(_MSC_VER)
161
+ /* _MSC_VER = VVRR */
162
+ # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
163
+ # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
164
+ # endif
165
+ # define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
166
+
167
+ #elif defined(__clang__)
168
+ # define COMPILER_ID "Clang"
169
+ # if defined(_MSC_VER)
170
+ # define SIMULATE_ID "MSVC"
171
+ # endif
172
+ # define COMPILER_VERSION_MAJOR DEC(__clang_major__)
173
+ # define COMPILER_VERSION_MINOR DEC(__clang_minor__)
174
+ # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
175
+ # if defined(_MSC_VER)
176
+ /* _MSC_VER = VVRR */
177
+ # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
178
+ # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
179
+ # endif
180
+
181
+ #elif defined(__GNUC__)
182
+ # define COMPILER_ID "GNU"
183
+ # define COMPILER_VERSION_MAJOR DEC(__GNUC__)
184
+ # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
185
+ # if defined(__GNUC_PATCHLEVEL__)
186
+ # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
187
+ # endif
188
+
189
+ #elif defined(_MSC_VER)
190
+ # define COMPILER_ID "MSVC"
191
+ /* _MSC_VER = VVRR */
192
+ # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
193
+ # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
194
+ # if defined(_MSC_FULL_VER)
195
+ # if _MSC_VER >= 1400
196
+ /* _MSC_FULL_VER = VVRRPPPPP */
197
+ # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
198
+ # else
199
+ /* _MSC_FULL_VER = VVRRPPPP */
200
+ # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
201
+ # endif
202
+ # endif
203
+ # if defined(_MSC_BUILD)
204
+ # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
205
+ # endif
206
+
207
+ #elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
208
+ # define COMPILER_ID "ADSP"
209
+ #if defined(__VISUALDSPVERSION__)
210
+ /* __VISUALDSPVERSION__ = 0xVVRRPP00 */
211
+ # define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
212
+ # define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
213
+ # define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
214
+ #endif
215
+
216
+ #elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC)
217
+ # define COMPILER_ID "IAR"
218
+
219
+ #elif defined(SDCC)
220
+ # define COMPILER_ID "SDCC"
221
+ /* SDCC = VRP */
222
+ # define COMPILER_VERSION_MAJOR DEC(SDCC/100)
223
+ # define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
224
+ # define COMPILER_VERSION_PATCH DEC(SDCC % 10)
225
+
226
+ #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
227
+ # define COMPILER_ID "MIPSpro"
228
+ # if defined(_SGI_COMPILER_VERSION)
229
+ /* _SGI_COMPILER_VERSION = VRP */
230
+ # define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100)
231
+ # define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10)
232
+ # define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10)
233
+ # else
234
+ /* _COMPILER_VERSION = VRP */
235
+ # define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100)
236
+ # define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10)
237
+ # define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10)
238
+ # endif
239
+
240
+
241
+ /* These compilers are either not known or too old to define an
242
+ identification macro. Try to identify the platform and guess that
243
+ it is the native compiler. */
244
+ #elif defined(__sgi)
245
+ # define COMPILER_ID "MIPSpro"
246
+
247
+ #elif defined(__hpux) || defined(__hpua)
248
+ # define COMPILER_ID "HP"
249
+
250
+ #else /* unknown compiler */
251
+ # define COMPILER_ID ""
252
+ #endif
253
+
254
+ /* Construct the string literal in pieces to prevent the source from
255
+ getting matched. Store it in a pointer rather than an array
256
+ because some compilers will just produce instructions to fill the
257
+ array rather than assigning a pointer to a static array. */
258
+ char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
259
+ #ifdef SIMULATE_ID
260
+ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
261
+ #endif
262
+
263
+ #ifdef __QNXNTO__
264
+ char const* qnxnto = "INFO" ":" "qnxnto[]";
265
+ #endif
266
+
267
+ /* Identify known platforms by name. */
268
+ #if defined(__linux) || defined(__linux__) || defined(linux)
269
+ # define PLATFORM_ID "Linux"
270
+
271
+ #elif defined(__CYGWIN__)
272
+ # define PLATFORM_ID "Cygwin"
273
+
274
+ #elif defined(__MINGW32__)
275
+ # define PLATFORM_ID "MinGW"
276
+
277
+ #elif defined(__APPLE__)
278
+ # define PLATFORM_ID "Darwin"
279
+
280
+ #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
281
+ # define PLATFORM_ID "Windows"
282
+
283
+ #elif defined(__FreeBSD__) || defined(__FreeBSD)
284
+ # define PLATFORM_ID "FreeBSD"
285
+
286
+ #elif defined(__NetBSD__) || defined(__NetBSD)
287
+ # define PLATFORM_ID "NetBSD"
288
+
289
+ #elif defined(__OpenBSD__) || defined(__OPENBSD)
290
+ # define PLATFORM_ID "OpenBSD"
291
+
292
+ #elif defined(__sun) || defined(sun)
293
+ # define PLATFORM_ID "SunOS"
294
+
295
+ #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
296
+ # define PLATFORM_ID "AIX"
297
+
298
+ #elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
299
+ # define PLATFORM_ID "IRIX"
300
+
301
+ #elif defined(__hpux) || defined(__hpux__)
302
+ # define PLATFORM_ID "HP-UX"
303
+
304
+ #elif defined(__HAIKU__)
305
+ # define PLATFORM_ID "Haiku"
306
+
307
+ #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
308
+ # define PLATFORM_ID "BeOS"
309
+
310
+ #elif defined(__QNX__) || defined(__QNXNTO__)
311
+ # define PLATFORM_ID "QNX"
312
+
313
+ #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
314
+ # define PLATFORM_ID "Tru64"
315
+
316
+ #elif defined(__riscos) || defined(__riscos__)
317
+ # define PLATFORM_ID "RISCos"
318
+
319
+ #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
320
+ # define PLATFORM_ID "SINIX"
321
+
322
+ #elif defined(__UNIX_SV__)
323
+ # define PLATFORM_ID "UNIX_SV"
324
+
325
+ #elif defined(__bsdos__)
326
+ # define PLATFORM_ID "BSDOS"
327
+
328
+ #elif defined(_MPRAS) || defined(MPRAS)
329
+ # define PLATFORM_ID "MP-RAS"
330
+
331
+ #elif defined(__osf) || defined(__osf__)
332
+ # define PLATFORM_ID "OSF1"
333
+
334
+ #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
335
+ # define PLATFORM_ID "SCO_SV"
336
+
337
+ #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
338
+ # define PLATFORM_ID "ULTRIX"
339
+
340
+ #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
341
+ # define PLATFORM_ID "Xenix"
342
+
343
+ #elif defined(__WATCOMC__)
344
+ # if defined(__LINUX__)
345
+ # define PLATFORM_ID "Linux"
346
+
347
+ # elif defined(__DOS__)
348
+ # define PLATFORM_ID "DOS"
349
+
350
+ # elif defined(__OS2__)
351
+ # define PLATFORM_ID "OS2"
352
+
353
+ # elif defined(__WINDOWS__)
354
+ # define PLATFORM_ID "Windows3x"
355
+
356
+ # else /* unknown platform */
357
+ # define PLATFORM_ID ""
358
+ # endif
359
+
360
+ #else /* unknown platform */
361
+ # define PLATFORM_ID ""
362
+
363
+ #endif
364
+
365
+ /* For windows compilers MSVC and Intel we can determine
366
+ the architecture of the compiler being used. This is because
367
+ the compilers do not have flags that can change the architecture,
368
+ but rather depend on which compiler is being used
369
+ */
370
+ #if defined(_WIN32) && defined(_MSC_VER)
371
+ # if defined(_M_IA64)
372
+ # define ARCHITECTURE_ID "IA64"
373
+
374
+ # elif defined(_M_X64) || defined(_M_AMD64)
375
+ # define ARCHITECTURE_ID "x64"
376
+
377
+ # elif defined(_M_IX86)
378
+ # define ARCHITECTURE_ID "X86"
379
+
380
+ # elif defined(_M_ARM)
381
+ # define ARCHITECTURE_ID "ARM"
382
+
383
+ # elif defined(_M_MIPS)
384
+ # define ARCHITECTURE_ID "MIPS"
385
+
386
+ # elif defined(_M_SH)
387
+ # define ARCHITECTURE_ID "SHx"
388
+
389
+ # else /* unknown architecture */
390
+ # define ARCHITECTURE_ID ""
391
+ # endif
392
+
393
+ #elif defined(__WATCOMC__)
394
+ # if defined(_M_I86)
395
+ # define ARCHITECTURE_ID "I86"
396
+
397
+ # elif defined(_M_IX86)
398
+ # define ARCHITECTURE_ID "X86"
399
+
400
+ # else /* unknown architecture */
401
+ # define ARCHITECTURE_ID ""
402
+ # endif
403
+
404
+ #else
405
+ # define ARCHITECTURE_ID ""
406
+ #endif
407
+
408
+ /* Convert integer to decimal digit literals. */
409
+ #define DEC(n) \
410
+ ('0' + (((n) / 10000000)%10)), \
411
+ ('0' + (((n) / 1000000)%10)), \
412
+ ('0' + (((n) / 100000)%10)), \
413
+ ('0' + (((n) / 10000)%10)), \
414
+ ('0' + (((n) / 1000)%10)), \
415
+ ('0' + (((n) / 100)%10)), \
416
+ ('0' + (((n) / 10)%10)), \
417
+ ('0' + ((n) % 10))
418
+
419
+ /* Convert integer to hex digit literals. */
420
+ #define HEX(n) \
421
+ ('0' + ((n)>>28 & 0xF)), \
422
+ ('0' + ((n)>>24 & 0xF)), \
423
+ ('0' + ((n)>>20 & 0xF)), \
424
+ ('0' + ((n)>>16 & 0xF)), \
425
+ ('0' + ((n)>>12 & 0xF)), \
426
+ ('0' + ((n)>>8 & 0xF)), \
427
+ ('0' + ((n)>>4 & 0xF)), \
428
+ ('0' + ((n) & 0xF))
429
+
430
+ /* Construct a string literal encoding the version number components. */
431
+ #ifdef COMPILER_VERSION_MAJOR
432
+ char const info_version[] = {
433
+ 'I', 'N', 'F', 'O', ':',
434
+ 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
435
+ COMPILER_VERSION_MAJOR,
436
+ # ifdef COMPILER_VERSION_MINOR
437
+ '.', COMPILER_VERSION_MINOR,
438
+ # ifdef COMPILER_VERSION_PATCH
439
+ '.', COMPILER_VERSION_PATCH,
440
+ # ifdef COMPILER_VERSION_TWEAK
441
+ '.', COMPILER_VERSION_TWEAK,
442
+ # endif
443
+ # endif
444
+ # endif
445
+ ']','\0'};
446
+ #endif
447
+
448
+ /* Construct a string literal encoding the version number components. */
449
+ #ifdef SIMULATE_VERSION_MAJOR
450
+ char const info_simulate_version[] = {
451
+ 'I', 'N', 'F', 'O', ':',
452
+ 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
453
+ SIMULATE_VERSION_MAJOR,
454
+ # ifdef SIMULATE_VERSION_MINOR
455
+ '.', SIMULATE_VERSION_MINOR,
456
+ # ifdef SIMULATE_VERSION_PATCH
457
+ '.', SIMULATE_VERSION_PATCH,
458
+ # ifdef SIMULATE_VERSION_TWEAK
459
+ '.', SIMULATE_VERSION_TWEAK,
460
+ # endif
461
+ # endif
462
+ # endif
463
+ ']','\0'};
464
+ #endif
465
+
466
+ /* Construct the string literal in pieces to prevent the source from
467
+ getting matched. Store it in a pointer rather than an array
468
+ because some compilers will just produce instructions to fill the
469
+ array rather than assigning a pointer to a static array. */
470
+ char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
471
+ char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
472
+
473
+
474
+
475
+
476
+ /*--------------------------------------------------------------------------*/
477
+
478
+ #ifdef ID_VOID_MAIN
479
+ void main() {}
480
+ #else
481
+ int main(int argc, char* argv[])
482
+ {
483
+ int require = 0;
484
+ require += info_compiler[argc];
485
+ require += info_platform[argc];
486
+ require += info_arch[argc];
487
+ #ifdef COMPILER_VERSION_MAJOR
488
+ require += info_version[argc];
489
+ #endif
490
+ #ifdef SIMULATE_ID
491
+ require += info_simulate[argc];
492
+ #endif
493
+ #ifdef SIMULATE_VERSION_MAJOR
494
+ require += info_simulate_version[argc];
495
+ #endif
496
+ (void)argv;
497
+ return require;
498
+ }
499
+ #endif