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
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d4ec2bb7c16570771c0279632f3ae1ca75e9992e
4
+ data.tar.gz: 13336a705368ecd04c44d46ea8cb993fbc077686
5
+ SHA512:
6
+ metadata.gz: ac3b3dcac098515d983d7946597c2909259a1b746e832a3d0bacd8d1bffa9eaffbf538dc306f9b6a9f4c2ae9e48f45965fab3c083021e6332b0ceab8bfc2ec03
7
+ data.tar.gz: 682de7709c675bca6355a282073d13454781fdb250fd6ec892dc508d3ee69a544eba6e2993ed6aa456baa08577dc7f1b7cedb0d6b930cb564abf8c6b59fcfdd5
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org/"
2
+
3
+ gemspec
4
+
5
+ group :benchmark do
6
+ gem "redcarpet", "~> 3.2.1"
7
+ gem "kramdown", "~> 1.0.2"
8
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Garen J. Torikian
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,119 @@
1
+ commonmarker
2
+ ============
3
+
4
+ Ruby wrapper for [libcmark](https://github.com/jgm/CommonMark),
5
+ the reference parser for CommonMark. The gem assumes you have
6
+ installed libcmark. It would be nice to have the gem build the
7
+ library as a ruby extension, but I leave that for someone with
8
+ more knowledge of ruby extensions to implement.
9
+
10
+ Note that the library currently does not pass all tests. It's
11
+ a work in progress, and you shouldn't use it for anything serious.
12
+
13
+ The parser returns a `Node` object that wraps pointers to the
14
+ structures allocated by libcmark. Access to libcmark's fast
15
+ HTML renderer is provided (the `to_html` method). For
16
+ more flexibility, a ruby `HtmlRenderer` class is also provided,
17
+ which can be customized through subclassing. New renderers for
18
+ any output format can easily be added.
19
+
20
+ To install:
21
+
22
+ rake install
23
+
24
+ or
25
+
26
+ gem build commonmarker.gemspec
27
+ gem install commonmark-VERSION.gem
28
+
29
+ Simple usage example:
30
+
31
+ ``` ruby
32
+ require 'commonmarker'
33
+
34
+ doc = CommonMarker::Node.parse_string("*Hello* world")
35
+ print(doc.to_html)
36
+ doc.free
37
+ ```
38
+
39
+ Some rough benchmarks:
40
+
41
+ ```
42
+ input size = 10031600 bytes
43
+
44
+ redcarpet 0.13 s
45
+ commonmarker with to_html 0.17 s
46
+ commonmarker with ruby HtmlRenderer 2.58 s
47
+ kramdown 14.21 s
48
+ ```
49
+
50
+ The library also includes a `walk` function for walking the
51
+ AST produced by the parser, and either transforming it or
52
+ extracting information. So, for example, you can easily print out all
53
+ the URLs linked to in a document, or change all the links to plain text,
54
+ or demote level 5 headers to regular paragraphs.
55
+
56
+ More complex usage example:
57
+
58
+ ``` ruby
59
+ require 'commonmarker'
60
+ include CommonMarker
61
+
62
+ # parse the files specified on the command line
63
+ doc = Node.parse_file(ARGF)
64
+
65
+ # Walk tree and print out URLs for links
66
+ doc.walk do |node|
67
+ if node.type == :link
68
+ printf("URL = %s\n", node.url)
69
+ end
70
+ end
71
+
72
+ # Capitalize all regular text in headers
73
+ doc.walk do |node|
74
+ if node.type == :header
75
+ node.walk do |subnode|
76
+ if subnode.type == :text
77
+ subnode.string_content = subnode.string_content.upcase
78
+ end
79
+ end
80
+ end
81
+ end
82
+
83
+ # Transform links to regular text
84
+ doc.walk do |node|
85
+ if node.type == :link
86
+ node.insert_before(node.first_child)
87
+ node.delete
88
+ end
89
+ end
90
+
91
+ # Create a custom renderer.
92
+ class MyHtmlRenderer < HtmlRenderer
93
+ def initialize
94
+ super
95
+ @headerid = 1
96
+ end
97
+ def header(node)
98
+ block do
99
+ self.out("<h", node.header_level, " id=\"", @headerid, "\">",
100
+ :children, "</h", node.header_level, ">")
101
+ @headerid += 1
102
+ end
103
+ end
104
+ end
105
+
106
+ # this renderer prints directly to STDOUT, instead
107
+ # of returning a string
108
+ myrenderer = MyHtmlRenderer.new
109
+ print(myrenderer.render(doc))
110
+
111
+ # Print any warnings to STDERR
112
+ renderer.warnings.each do |w|
113
+ STDERR.write(w)
114
+ STDERR.write("\n")
115
+ end
116
+
117
+ # free allocated memory when you're done
118
+ doc.free
119
+ ```
data/Rakefile ADDED
@@ -0,0 +1,39 @@
1
+ require 'date'
2
+ require 'rake/clean'
3
+ require 'rake/extensiontask'
4
+ require 'digest/md5'
5
+
6
+ task :default => [:test]
7
+
8
+ # Gem Spec
9
+ gem_spec = Gem::Specification.load('commonmarker.gemspec')
10
+
11
+ # Ruby Extension
12
+ Rake::ExtensionTask.new('commonmarker', gem_spec) do |ext|
13
+ ext.lib_dir = File.join('lib', 'commonmarker')
14
+ end
15
+
16
+ # Packaging
17
+ require 'bundler/gem_tasks'
18
+
19
+ # Testing
20
+ require 'rake/testtask'
21
+
22
+ Rake::TestTask.new('test:unit') do |t|
23
+ t.libs << 'lib'
24
+ t.libs << 'test'
25
+ t.pattern = 'test/test_*.rb'
26
+ t.verbose = true
27
+ t.warning = false
28
+ end
29
+
30
+ task 'test:unit' => :compile
31
+
32
+ desc 'Run unit and conformance tests'
33
+ task :test => %w[test:unit]
34
+
35
+ desc 'Run benchmarks'
36
+ task :benchmark => :compile do |t|
37
+ $:.unshift 'lib'
38
+ load 'test/benchmark.rb'
39
+ end
data/bin/commonmarker ADDED
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env ruby
2
+ # Usage: commonmarker [--html-renderer] [FILE..]
3
+ # Convert one or more CommonMark files to HTML and write to standard output.
4
+ # If no FILE argument is provided, text will be read from STDIN.
5
+ # With --html-renderer, use the HtmlRenderer renderer rather than the native C
6
+ # renderer.
7
+ if ARGV.include?('--help') or ARGV.include?('-h')
8
+ File.read(__FILE__).split("\n").grep(/^# /).each do |line|
9
+ puts line[2..-1]
10
+ end
11
+ exit 0
12
+ end
13
+
14
+ require 'commonmarker'
15
+
16
+ if ARGV.include?('--version') or ARGV.include?('-v')
17
+ puts "commonmarker #{CommonMarker::VERSION}"
18
+ exit 0
19
+ end
20
+
21
+ root = File.expand_path('../../', __FILE__)
22
+ $:.unshift File.expand_path('lib', root)
23
+
24
+ renderer = nil
25
+ ARGV.delete_if do |arg|
26
+ if arg =~ /^--html-renderer$/
27
+ renderer = CommonMarker::HtmlRenderer.new
28
+ true
29
+ else
30
+ false
31
+ end
32
+ end
33
+
34
+ doc = CommonMarker::Node.parse_file(ARGF)
35
+
36
+ if renderer
37
+ STDOUT.write(renderer.render(doc))
38
+ else
39
+ STDOUT.write(doc.to_html)
40
+ end
41
+ doc.free
@@ -0,0 +1,30 @@
1
+ # encoding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'commonmarker/version'
5
+ Gem::Specification.new do |s|
6
+ s.name = 'commonmarker'
7
+ s.version = CommonMarker::VERSION
8
+ s.summary = "CommonMark parser and renderer. Written in C, wrapped in Ruby"
9
+ s.description = "A fast, safe, extensible parser for CommonMark"
10
+ s.authors = ['Garen Torikian']
11
+ s.email = ['gjtorikian@gmail.com']
12
+ s.homepage = 'http://github.com/gjtorikian/commonmarker'
13
+ s.license = 'MIT'
14
+ s.required_ruby_version = '>= 2.0.0'
15
+ # = MANIFEST =
16
+ s.files = %w(LICENSE.txt README.md Rakefile commonmarker.gemspec Gemfile bin/commonmarker)
17
+ s.files += Dir.glob('lib/**/*.rb')
18
+ s.files += Dir.glob('ext/**/*')
19
+ s.test_files = Dir.glob('test/**/*')
20
+ s.extensions = ['ext/commonmarker/extconf.rb']
21
+ # = MANIFEST =
22
+ s.test_files = s.files.grep(%r{^test/})
23
+ s.executables = ["commonmarker"]
24
+ s.require_paths = %w(lib ext)
25
+
26
+ s.add_dependency 'ruby-enum', '~> 0.4'
27
+ s.add_development_dependency "rake-compiler", "~> 0.9"
28
+ s.add_development_dependency "bundler", "~> 1.9"
29
+ s.add_development_dependency "json", "~> 1.8.1"
30
+ end
@@ -0,0 +1,25 @@
1
+ project(cmark)
2
+ cmake_minimum_required(VERSION 2.8.9)
3
+ include("FindAsan.cmake")
4
+
5
+ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
6
+ message(FATAL_ERROR "Do not build in-source.\nPlease remove CMakeCache.txt and the CMakeFiles/ directory.\nThen: mkdir build ; cd build ; cmake .. ; make")
7
+ endif()
8
+
9
+ set(PROJECT_NAME "cmark")
10
+
11
+ set(PROJECT_VERSION_MAJOR 0)
12
+ set(PROJECT_VERSION_MINOR 19)
13
+ set(PROJECT_VERSION_PATCH 0)
14
+ set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} )
15
+
16
+ add_subdirectory(src)
17
+ add_subdirectory(api_test)
18
+ add_subdirectory(man)
19
+ enable_testing()
20
+ add_subdirectory(test testdir)
21
+
22
+ if(NOT CMAKE_BUILD_TYPE)
23
+ set(CMAKE_BUILD_TYPE "Release" CACHE STRING
24
+ "Choose the type of build, options are: Debug Profile Release." FORCE)
25
+ endif(NOT CMAKE_BUILD_TYPE)
@@ -0,0 +1,192 @@
1
+ Copyright (c) 2014, John MacFarlane
2
+
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ * Redistributions of source code must retain the above copyright
9
+ notice, this list of conditions and the following disclaimer.
10
+
11
+ * Redistributions in binary form must reproduce the above
12
+ copyright notice, this list of conditions and the following
13
+ disclaimer in the documentation and/or other materials provided
14
+ with the distribution.
15
+
16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ -----
29
+
30
+ houdini.h, houdini_href_e.c, houdini_html_e.c, houdini_html_u.c,
31
+ html_unescape.gperf, html_unescape.h
32
+
33
+ derive from https://github.com/vmg/houdini (with some modifications)
34
+
35
+ Copyright (C) 2012 Vicent Martí
36
+
37
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
38
+ this software and associated documentation files (the "Software"), to deal in
39
+ the Software without restriction, including without limitation the rights to
40
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
41
+ of the Software, and to permit persons to whom the Software is furnished to do
42
+ so, subject to the following conditions:
43
+
44
+ The above copyright notice and this permission notice shall be included in all
45
+ copies or substantial portions of the Software.
46
+
47
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
48
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
49
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
50
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
51
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
52
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
53
+ SOFTWARE.
54
+
55
+ -----
56
+
57
+ buffer.h, buffer.c, chunk.h
58
+
59
+ are derived from code (C) 2012 Github, Inc.
60
+
61
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
62
+ this software and associated documentation files (the "Software"), to deal in
63
+ the Software without restriction, including without limitation the rights to
64
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
65
+ of the Software, and to permit persons to whom the Software is furnished to do
66
+ so, subject to the following conditions:
67
+
68
+ The above copyright notice and this permission notice shall be included in all
69
+ copies or substantial portions of the Software.
70
+
71
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
72
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
73
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
74
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
75
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
76
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
77
+ SOFTWARE.
78
+
79
+ -----
80
+
81
+ utf8.c and utf8.c
82
+
83
+ are derived from utf8proc
84
+ (<http://www.public-software-group.org/utf8proc>),
85
+ (C) 2009 Public Software Group e. V., Berlin, Germany.
86
+
87
+ Permission is hereby granted, free of charge, to any person obtaining a
88
+ copy of this software and associated documentation files (the "Software"),
89
+ to deal in the Software without restriction, including without limitation
90
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
91
+ and/or sell copies of the Software, and to permit persons to whom the
92
+ Software is furnished to do so, subject to the following conditions:
93
+
94
+ The above copyright notice and this permission notice shall be included in
95
+ all copies or substantial portions of the Software.
96
+
97
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
98
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
99
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
100
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
101
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
102
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
103
+ DEALINGS IN THE SOFTWARE.
104
+
105
+ -----
106
+
107
+ The normalization code in runtests.py was derived from the
108
+ markdowntest project, Copyright 2013 Karl Dubost:
109
+
110
+ The MIT License (MIT)
111
+
112
+ Copyright (c) 2013 Karl Dubost
113
+
114
+ Permission is hereby granted, free of charge, to any person obtaining
115
+ a copy of this software and associated documentation files (the
116
+ "Software"), to deal in the Software without restriction, including
117
+ without limitation the rights to use, copy, modify, merge, publish,
118
+ distribute, sublicense, and/or sell copies of the Software, and to
119
+ permit persons to whom the Software is furnished to do so, subject to
120
+ the following conditions:
121
+
122
+ The above copyright notice and this permission notice shall be
123
+ included in all copies or substantial portions of the Software.
124
+
125
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
126
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
127
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
128
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
129
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
130
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
131
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
132
+
133
+ -----
134
+
135
+ The CommonMark spec (test/spec.txt) is
136
+
137
+ Copyright (C) 2014-15 John MacFarlane
138
+
139
+ Released under the Creative Commons CC-BY-SA 4.0 license:
140
+ <http://creativecommons.org/licenses/by-sa/4.0/>.
141
+
142
+ -----
143
+
144
+ The test software in test/ is
145
+
146
+ Copyright (c) 2014, John MacFarlane
147
+
148
+ All rights reserved.
149
+
150
+ Redistribution and use in source and binary forms, with or without
151
+ modification, are permitted provided that the following conditions are met:
152
+
153
+ * Redistributions of source code must retain the above copyright
154
+ notice, this list of conditions and the following disclaimer.
155
+
156
+ * Redistributions in binary form must reproduce the above
157
+ copyright notice, this list of conditions and the following
158
+ disclaimer in the documentation and/or other materials provided
159
+ with the distribution.
160
+
161
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
162
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
163
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
164
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
165
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
166
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
167
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
168
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
169
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
170
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
171
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
172
+
173
+ -----
174
+
175
+ The normalization code in runtests.py was derived from the
176
+ markdowntest project, Copyright 2013 Karl Dubost:
177
+
178
+ The MIT License (MIT)
179
+
180
+ Copyright (c) 2013 Karl Dubost
181
+
182
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
183
+
184
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
185
+
186
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
187
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
188
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
189
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
190
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
191
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
192
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,74 @@
1
+ #
2
+ # The MIT License (MIT)
3
+ #
4
+ # Copyright (c) 2013 Matthew Arsenault
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ # of this software and associated documentation files (the "Software"), to deal
8
+ # in the Software without restriction, including without limitation the rights
9
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ # copies of the Software, and to permit persons to whom the Software is
11
+ # furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in
14
+ # all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ # THE SOFTWARE.
23
+ #
24
+ # This module tests if address sanitizer is supported by the compiler,
25
+ # and creates a ASan build type (i.e. set CMAKE_BUILD_TYPE=ASan to use
26
+ # it). This sets the following variables:
27
+ #
28
+ # CMAKE_C_FLAGS_ASAN - Flags to use for C with asan
29
+ # CMAKE_CXX_FLAGS_ASAN - Flags to use for C++ with asan
30
+ # HAVE_ADDRESS_SANITIZER - True or false if the ASan build type is available
31
+
32
+ include(CheckCCompilerFlag)
33
+
34
+ # Set -Werror to catch "argument unused during compilation" warnings
35
+ set(CMAKE_REQUIRED_FLAGS "-Werror -faddress-sanitizer") # Also needs to be a link flag for test to pass
36
+ check_c_compiler_flag("-faddress-sanitizer" HAVE_FLAG_ADDRESS_SANITIZER)
37
+
38
+ set(CMAKE_REQUIRED_FLAGS "-Werror -fsanitize=address") # Also needs to be a link flag for test to pass
39
+ check_c_compiler_flag("-fsanitize=address" HAVE_FLAG_SANITIZE_ADDRESS)
40
+
41
+ unset(CMAKE_REQUIRED_FLAGS)
42
+
43
+ if(HAVE_FLAG_SANITIZE_ADDRESS)
44
+ # Clang 3.2+ use this version
45
+ set(ADDRESS_SANITIZER_FLAG "-fsanitize=address")
46
+ elseif(HAVE_FLAG_ADDRESS_SANITIZER)
47
+ # Older deprecated flag for ASan
48
+ set(ADDRESS_SANITIZER_FLAG "-faddress-sanitizer")
49
+ endif()
50
+
51
+ if(NOT ADDRESS_SANITIZER_FLAG)
52
+ return()
53
+ else(NOT ADDRESS_SANITIZER_FLAG)
54
+ set(HAVE_ADDRESS_SANITIZER FALSE)
55
+ endif()
56
+
57
+ set(HAVE_ADDRESS_SANITIZER TRUE)
58
+
59
+ set(CMAKE_C_FLAGS_ASAN "-O1 -g ${ADDRESS_SANITIZER_FLAG} -fno-omit-frame-pointer -fno-optimize-sibling-calls"
60
+ CACHE STRING "Flags used by the C compiler during ASan builds."
61
+ FORCE)
62
+ set(CMAKE_CXX_FLAGS_ASAN "-O1 -g ${ADDRESS_SANITIZER_FLAG} -fno-omit-frame-pointer -fno-optimize-sibling-calls"
63
+ CACHE STRING "Flags used by the C++ compiler during ASan builds."
64
+ FORCE)
65
+ set(CMAKE_EXE_LINKER_FLAGS_ASAN "${ADDRESS_SANITIZER_FLAG}"
66
+ CACHE STRING "Flags used for linking binaries during ASan builds."
67
+ FORCE)
68
+ set(CMAKE_SHARED_LINKER_FLAGS_ASAN "${ADDRESS_SANITIZER_FLAG}"
69
+ CACHE STRING "Flags used by the shared libraries linker during ASan builds."
70
+ FORCE)
71
+ mark_as_advanced(CMAKE_C_FLAGS_ASAN
72
+ CMAKE_CXX_FLAGS_ASAN
73
+ CMAKE_EXE_LINKER_FLAGS_ASAN
74
+ CMAKE_SHARED_LINKER_FLAGS_ASAN)