rj_schema 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (299) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +18 -0
  3. data/ext/rj_schema/extconf.rb +7 -0
  4. data/ext/rj_schema/rapidjson/CHANGELOG.md +158 -0
  5. data/ext/rj_schema/rapidjson/CMakeLists.txt +221 -0
  6. data/ext/rj_schema/rapidjson/CMakeModules/FindGTestSrc.cmake +30 -0
  7. data/ext/rj_schema/rapidjson/RapidJSON.pc.in +7 -0
  8. data/ext/rj_schema/rapidjson/RapidJSONConfig.cmake.in +15 -0
  9. data/ext/rj_schema/rapidjson/RapidJSONConfigVersion.cmake.in +10 -0
  10. data/ext/rj_schema/rapidjson/appveyor.yml +41 -0
  11. data/ext/rj_schema/rapidjson/bin/data/glossary.json +22 -0
  12. data/ext/rj_schema/rapidjson/bin/data/menu.json +27 -0
  13. data/ext/rj_schema/rapidjson/bin/data/readme.txt +1 -0
  14. data/ext/rj_schema/rapidjson/bin/data/sample.json +3315 -0
  15. data/ext/rj_schema/rapidjson/bin/data/webapp.json +88 -0
  16. data/ext/rj_schema/rapidjson/bin/data/widget.json +26 -0
  17. data/ext/rj_schema/rapidjson/bin/draft-04/schema +150 -0
  18. data/ext/rj_schema/rapidjson/bin/encodings/utf16be.json +0 -0
  19. data/ext/rj_schema/rapidjson/bin/encodings/utf16bebom.json +0 -0
  20. data/ext/rj_schema/rapidjson/bin/encodings/utf16le.json +0 -0
  21. data/ext/rj_schema/rapidjson/bin/encodings/utf16lebom.json +0 -0
  22. data/ext/rj_schema/rapidjson/bin/encodings/utf32be.json +0 -0
  23. data/ext/rj_schema/rapidjson/bin/encodings/utf32bebom.json +0 -0
  24. data/ext/rj_schema/rapidjson/bin/encodings/utf32le.json +0 -0
  25. data/ext/rj_schema/rapidjson/bin/encodings/utf32lebom.json +0 -0
  26. data/ext/rj_schema/rapidjson/bin/encodings/utf8.json +7 -0
  27. data/ext/rj_schema/rapidjson/bin/encodings/utf8bom.json +7 -0
  28. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail1.json +1 -0
  29. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail10.json +1 -0
  30. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail11.json +1 -0
  31. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail12.json +1 -0
  32. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail13.json +1 -0
  33. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail14.json +1 -0
  34. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail15.json +1 -0
  35. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail16.json +1 -0
  36. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail17.json +1 -0
  37. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail18.json +1 -0
  38. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail19.json +1 -0
  39. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail2.json +1 -0
  40. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail20.json +1 -0
  41. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail21.json +1 -0
  42. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail22.json +1 -0
  43. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail23.json +1 -0
  44. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail24.json +1 -0
  45. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail25.json +1 -0
  46. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail26.json +1 -0
  47. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail27.json +2 -0
  48. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail28.json +2 -0
  49. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail29.json +1 -0
  50. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail3.json +1 -0
  51. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail30.json +1 -0
  52. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail31.json +1 -0
  53. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail32.json +1 -0
  54. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail33.json +1 -0
  55. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail4.json +1 -0
  56. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail5.json +1 -0
  57. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail6.json +1 -0
  58. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail7.json +1 -0
  59. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail8.json +1 -0
  60. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail9.json +1 -0
  61. data/ext/rj_schema/rapidjson/bin/jsonchecker/pass1.json +58 -0
  62. data/ext/rj_schema/rapidjson/bin/jsonchecker/pass2.json +1 -0
  63. data/ext/rj_schema/rapidjson/bin/jsonchecker/pass3.json +6 -0
  64. data/ext/rj_schema/rapidjson/bin/jsonchecker/readme.txt +3 -0
  65. data/ext/rj_schema/rapidjson/bin/jsonschema/LICENSE +19 -0
  66. data/ext/rj_schema/rapidjson/bin/jsonschema/README.md +148 -0
  67. data/ext/rj_schema/rapidjson/bin/jsonschema/bin/jsonschema_suite +283 -0
  68. data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json +3 -0
  69. data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/integer.json +3 -0
  70. data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/subSchemas.json +8 -0
  71. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json +82 -0
  72. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json +88 -0
  73. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/default.json +49 -0
  74. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/dependencies.json +108 -0
  75. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/disallow.json +80 -0
  76. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json +60 -0
  77. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/enum.json +71 -0
  78. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/extends.json +94 -0
  79. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/items.json +46 -0
  80. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maxItems.json +28 -0
  81. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maxLength.json +33 -0
  82. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maximum.json +42 -0
  83. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minItems.json +28 -0
  84. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minLength.json +33 -0
  85. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minimum.json +42 -0
  86. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json +107 -0
  87. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/format.json +222 -0
  88. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json +18 -0
  89. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json +15 -0
  90. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/pattern.json +34 -0
  91. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json +110 -0
  92. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/properties.json +92 -0
  93. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/ref.json +159 -0
  94. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/refRemote.json +74 -0
  95. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/required.json +53 -0
  96. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/type.json +474 -0
  97. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json +79 -0
  98. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json +82 -0
  99. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json +88 -0
  100. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/allOf.json +112 -0
  101. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/anyOf.json +68 -0
  102. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/default.json +49 -0
  103. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/definitions.json +32 -0
  104. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/dependencies.json +113 -0
  105. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/enum.json +72 -0
  106. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/items.json +46 -0
  107. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxItems.json +28 -0
  108. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxLength.json +33 -0
  109. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json +28 -0
  110. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maximum.json +42 -0
  111. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minItems.json +28 -0
  112. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minLength.json +33 -0
  113. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minProperties.json +28 -0
  114. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minimum.json +42 -0
  115. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json +60 -0
  116. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/not.json +96 -0
  117. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/oneOf.json +68 -0
  118. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json +107 -0
  119. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/format.json +148 -0
  120. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json +15 -0
  121. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/pattern.json +34 -0
  122. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json +110 -0
  123. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/properties.json +92 -0
  124. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/ref.json +159 -0
  125. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/refRemote.json +74 -0
  126. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/required.json +39 -0
  127. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/type.json +330 -0
  128. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json +79 -0
  129. data/ext/rj_schema/rapidjson/bin/jsonschema/tox.ini +8 -0
  130. data/ext/rj_schema/rapidjson/bin/types/booleans.json +102 -0
  131. data/ext/rj_schema/rapidjson/bin/types/floats.json +102 -0
  132. data/ext/rj_schema/rapidjson/bin/types/guids.json +102 -0
  133. data/ext/rj_schema/rapidjson/bin/types/integers.json +102 -0
  134. data/ext/rj_schema/rapidjson/bin/types/mixed.json +592 -0
  135. data/ext/rj_schema/rapidjson/bin/types/nulls.json +102 -0
  136. data/ext/rj_schema/rapidjson/bin/types/paragraphs.json +102 -0
  137. data/ext/rj_schema/rapidjson/bin/types/readme.txt +1 -0
  138. data/ext/rj_schema/rapidjson/contrib/natvis/LICENSE +45 -0
  139. data/ext/rj_schema/rapidjson/contrib/natvis/README.md +7 -0
  140. data/ext/rj_schema/rapidjson/contrib/natvis/rapidjson.natvis +38 -0
  141. data/ext/rj_schema/rapidjson/doc/CMakeLists.txt +27 -0
  142. data/ext/rj_schema/rapidjson/doc/Doxyfile.in +2369 -0
  143. data/ext/rj_schema/rapidjson/doc/Doxyfile.zh-cn.in +2369 -0
  144. data/ext/rj_schema/rapidjson/doc/diagram/architecture.dot +50 -0
  145. data/ext/rj_schema/rapidjson/doc/diagram/architecture.png +0 -0
  146. data/ext/rj_schema/rapidjson/doc/diagram/insituparsing.dot +65 -0
  147. data/ext/rj_schema/rapidjson/doc/diagram/insituparsing.png +0 -0
  148. data/ext/rj_schema/rapidjson/doc/diagram/iterative-parser-states-diagram.dot +62 -0
  149. data/ext/rj_schema/rapidjson/doc/diagram/iterative-parser-states-diagram.png +0 -0
  150. data/ext/rj_schema/rapidjson/doc/diagram/makefile +8 -0
  151. data/ext/rj_schema/rapidjson/doc/diagram/move1.dot +47 -0
  152. data/ext/rj_schema/rapidjson/doc/diagram/move1.png +0 -0
  153. data/ext/rj_schema/rapidjson/doc/diagram/move2.dot +62 -0
  154. data/ext/rj_schema/rapidjson/doc/diagram/move2.png +0 -0
  155. data/ext/rj_schema/rapidjson/doc/diagram/move3.dot +60 -0
  156. data/ext/rj_schema/rapidjson/doc/diagram/move3.png +0 -0
  157. data/ext/rj_schema/rapidjson/doc/diagram/normalparsing.dot +56 -0
  158. data/ext/rj_schema/rapidjson/doc/diagram/normalparsing.png +0 -0
  159. data/ext/rj_schema/rapidjson/doc/diagram/simpledom.dot +54 -0
  160. data/ext/rj_schema/rapidjson/doc/diagram/simpledom.png +0 -0
  161. data/ext/rj_schema/rapidjson/doc/diagram/tutorial.dot +58 -0
  162. data/ext/rj_schema/rapidjson/doc/diagram/tutorial.png +0 -0
  163. data/ext/rj_schema/rapidjson/doc/diagram/utilityclass.dot +73 -0
  164. data/ext/rj_schema/rapidjson/doc/diagram/utilityclass.png +0 -0
  165. data/ext/rj_schema/rapidjson/doc/dom.md +280 -0
  166. data/ext/rj_schema/rapidjson/doc/dom.zh-cn.md +284 -0
  167. data/ext/rj_schema/rapidjson/doc/encoding.md +146 -0
  168. data/ext/rj_schema/rapidjson/doc/encoding.zh-cn.md +152 -0
  169. data/ext/rj_schema/rapidjson/doc/faq.md +289 -0
  170. data/ext/rj_schema/rapidjson/doc/faq.zh-cn.md +290 -0
  171. data/ext/rj_schema/rapidjson/doc/features.md +104 -0
  172. data/ext/rj_schema/rapidjson/doc/features.zh-cn.md +103 -0
  173. data/ext/rj_schema/rapidjson/doc/internals.md +368 -0
  174. data/ext/rj_schema/rapidjson/doc/internals.zh-cn.md +363 -0
  175. data/ext/rj_schema/rapidjson/doc/logo/rapidjson.png +0 -0
  176. data/ext/rj_schema/rapidjson/doc/logo/rapidjson.svg +119 -0
  177. data/ext/rj_schema/rapidjson/doc/misc/DoxygenLayout.xml +194 -0
  178. data/ext/rj_schema/rapidjson/doc/misc/doxygenextra.css +274 -0
  179. data/ext/rj_schema/rapidjson/doc/misc/footer.html +11 -0
  180. data/ext/rj_schema/rapidjson/doc/misc/header.html +24 -0
  181. data/ext/rj_schema/rapidjson/doc/npm.md +31 -0
  182. data/ext/rj_schema/rapidjson/doc/performance.md +26 -0
  183. data/ext/rj_schema/rapidjson/doc/performance.zh-cn.md +26 -0
  184. data/ext/rj_schema/rapidjson/doc/pointer.md +234 -0
  185. data/ext/rj_schema/rapidjson/doc/pointer.zh-cn.md +234 -0
  186. data/ext/rj_schema/rapidjson/doc/sax.md +509 -0
  187. data/ext/rj_schema/rapidjson/doc/sax.zh-cn.md +487 -0
  188. data/ext/rj_schema/rapidjson/doc/schema.md +505 -0
  189. data/ext/rj_schema/rapidjson/doc/schema.zh-cn.md +237 -0
  190. data/ext/rj_schema/rapidjson/doc/stream.md +426 -0
  191. data/ext/rj_schema/rapidjson/doc/stream.zh-cn.md +426 -0
  192. data/ext/rj_schema/rapidjson/doc/tutorial.md +536 -0
  193. data/ext/rj_schema/rapidjson/doc/tutorial.zh-cn.md +534 -0
  194. data/ext/rj_schema/rapidjson/docker/debian/Dockerfile +8 -0
  195. data/ext/rj_schema/rapidjson/example/CMakeLists.txt +45 -0
  196. data/ext/rj_schema/rapidjson/example/archiver/archiver.cpp +292 -0
  197. data/ext/rj_schema/rapidjson/example/archiver/archiver.h +145 -0
  198. data/ext/rj_schema/rapidjson/example/archiver/archivertest.cpp +287 -0
  199. data/ext/rj_schema/rapidjson/example/capitalize/capitalize.cpp +67 -0
  200. data/ext/rj_schema/rapidjson/example/condense/condense.cpp +32 -0
  201. data/ext/rj_schema/rapidjson/example/filterkey/filterkey.cpp +135 -0
  202. data/ext/rj_schema/rapidjson/example/filterkeydom/filterkeydom.cpp +170 -0
  203. data/ext/rj_schema/rapidjson/example/jsonx/jsonx.cpp +207 -0
  204. data/ext/rj_schema/rapidjson/example/lookaheadparser/lookaheadparser.cpp +350 -0
  205. data/ext/rj_schema/rapidjson/example/messagereader/messagereader.cpp +105 -0
  206. data/ext/rj_schema/rapidjson/example/parsebyparts/parsebyparts.cpp +176 -0
  207. data/ext/rj_schema/rapidjson/example/pretty/pretty.cpp +30 -0
  208. data/ext/rj_schema/rapidjson/example/prettyauto/prettyauto.cpp +56 -0
  209. data/ext/rj_schema/rapidjson/example/schemavalidator/schemavalidator.cpp +78 -0
  210. data/ext/rj_schema/rapidjson/example/serialize/serialize.cpp +173 -0
  211. data/ext/rj_schema/rapidjson/example/simpledom/simpledom.cpp +29 -0
  212. data/ext/rj_schema/rapidjson/example/simplepullreader/simplepullreader.cpp +53 -0
  213. data/ext/rj_schema/rapidjson/example/simplereader/simplereader.cpp +42 -0
  214. data/ext/rj_schema/rapidjson/example/simplewriter/simplewriter.cpp +36 -0
  215. data/ext/rj_schema/rapidjson/example/tutorial/tutorial.cpp +151 -0
  216. data/ext/rj_schema/rapidjson/include/rapidjson/allocators.h +271 -0
  217. data/ext/rj_schema/rapidjson/include/rapidjson/cursorstreamwrapper.h +78 -0
  218. data/ext/rj_schema/rapidjson/include/rapidjson/document.h +2630 -0
  219. data/ext/rj_schema/rapidjson/include/rapidjson/encodedstream.h +299 -0
  220. data/ext/rj_schema/rapidjson/include/rapidjson/encodings.h +716 -0
  221. data/ext/rj_schema/rapidjson/include/rapidjson/error/en.h +74 -0
  222. data/ext/rj_schema/rapidjson/include/rapidjson/error/error.h +161 -0
  223. data/ext/rj_schema/rapidjson/include/rapidjson/filereadstream.h +99 -0
  224. data/ext/rj_schema/rapidjson/include/rapidjson/filewritestream.h +104 -0
  225. data/ext/rj_schema/rapidjson/include/rapidjson/fwd.h +151 -0
  226. data/ext/rj_schema/rapidjson/include/rapidjson/internal/biginteger.h +290 -0
  227. data/ext/rj_schema/rapidjson/include/rapidjson/internal/diyfp.h +258 -0
  228. data/ext/rj_schema/rapidjson/include/rapidjson/internal/dtoa.h +245 -0
  229. data/ext/rj_schema/rapidjson/include/rapidjson/internal/ieee754.h +78 -0
  230. data/ext/rj_schema/rapidjson/include/rapidjson/internal/itoa.h +304 -0
  231. data/ext/rj_schema/rapidjson/include/rapidjson/internal/meta.h +181 -0
  232. data/ext/rj_schema/rapidjson/include/rapidjson/internal/pow10.h +55 -0
  233. data/ext/rj_schema/rapidjson/include/rapidjson/internal/regex.h +734 -0
  234. data/ext/rj_schema/rapidjson/include/rapidjson/internal/stack.h +231 -0
  235. data/ext/rj_schema/rapidjson/include/rapidjson/internal/strfunc.h +69 -0
  236. data/ext/rj_schema/rapidjson/include/rapidjson/internal/strtod.h +269 -0
  237. data/ext/rj_schema/rapidjson/include/rapidjson/internal/swap.h +46 -0
  238. data/ext/rj_schema/rapidjson/include/rapidjson/istreamwrapper.h +115 -0
  239. data/ext/rj_schema/rapidjson/include/rapidjson/memorybuffer.h +70 -0
  240. data/ext/rj_schema/rapidjson/include/rapidjson/memorystream.h +71 -0
  241. data/ext/rj_schema/rapidjson/include/rapidjson/msinttypes/inttypes.h +316 -0
  242. data/ext/rj_schema/rapidjson/include/rapidjson/msinttypes/stdint.h +300 -0
  243. data/ext/rj_schema/rapidjson/include/rapidjson/ostreamwrapper.h +81 -0
  244. data/ext/rj_schema/rapidjson/include/rapidjson/pointer.h +1363 -0
  245. data/ext/rj_schema/rapidjson/include/rapidjson/prettywriter.h +277 -0
  246. data/ext/rj_schema/rapidjson/include/rapidjson/rapidjson.h +628 -0
  247. data/ext/rj_schema/rapidjson/include/rapidjson/reader.h +2222 -0
  248. data/ext/rj_schema/rapidjson/include/rapidjson/schema.h +2479 -0
  249. data/ext/rj_schema/rapidjson/include/rapidjson/stream.h +223 -0
  250. data/ext/rj_schema/rapidjson/include/rapidjson/stringbuffer.h +121 -0
  251. data/ext/rj_schema/rapidjson/include/rapidjson/writer.h +716 -0
  252. data/ext/rj_schema/rapidjson/include_dirs.js +2 -0
  253. data/ext/rj_schema/rapidjson/library.json +15 -0
  254. data/ext/rj_schema/rapidjson/license.txt +57 -0
  255. data/ext/rj_schema/rapidjson/package.json +24 -0
  256. data/ext/rj_schema/rapidjson/rapidjson.autopkg +77 -0
  257. data/ext/rj_schema/rapidjson/readme.md +160 -0
  258. data/ext/rj_schema/rapidjson/readme.zh-cn.md +152 -0
  259. data/ext/rj_schema/rapidjson/test/CMakeLists.txt +20 -0
  260. data/ext/rj_schema/rapidjson/test/perftest/CMakeLists.txt +28 -0
  261. data/ext/rj_schema/rapidjson/test/perftest/misctest.cpp +974 -0
  262. data/ext/rj_schema/rapidjson/test/perftest/perftest.cpp +24 -0
  263. data/ext/rj_schema/rapidjson/test/perftest/perftest.h +185 -0
  264. data/ext/rj_schema/rapidjson/test/perftest/platformtest.cpp +166 -0
  265. data/ext/rj_schema/rapidjson/test/perftest/rapidjsontest.cpp +472 -0
  266. data/ext/rj_schema/rapidjson/test/perftest/schematest.cpp +216 -0
  267. data/ext/rj_schema/rapidjson/test/unittest/CMakeLists.txt +92 -0
  268. data/ext/rj_schema/rapidjson/test/unittest/allocatorstest.cpp +102 -0
  269. data/ext/rj_schema/rapidjson/test/unittest/bigintegertest.cpp +133 -0
  270. data/ext/rj_schema/rapidjson/test/unittest/cursorstreamwrappertest.cpp +115 -0
  271. data/ext/rj_schema/rapidjson/test/unittest/documenttest.cpp +672 -0
  272. data/ext/rj_schema/rapidjson/test/unittest/dtoatest.cpp +98 -0
  273. data/ext/rj_schema/rapidjson/test/unittest/encodedstreamtest.cpp +313 -0
  274. data/ext/rj_schema/rapidjson/test/unittest/encodingstest.cpp +451 -0
  275. data/ext/rj_schema/rapidjson/test/unittest/filestreamtest.cpp +112 -0
  276. data/ext/rj_schema/rapidjson/test/unittest/fwdtest.cpp +230 -0
  277. data/ext/rj_schema/rapidjson/test/unittest/istreamwrappertest.cpp +181 -0
  278. data/ext/rj_schema/rapidjson/test/unittest/itoatest.cpp +160 -0
  279. data/ext/rj_schema/rapidjson/test/unittest/jsoncheckertest.cpp +143 -0
  280. data/ext/rj_schema/rapidjson/test/unittest/namespacetest.cpp +70 -0
  281. data/ext/rj_schema/rapidjson/test/unittest/ostreamwrappertest.cpp +92 -0
  282. data/ext/rj_schema/rapidjson/test/unittest/pointertest.cpp +1529 -0
  283. data/ext/rj_schema/rapidjson/test/unittest/prettywritertest.cpp +344 -0
  284. data/ext/rj_schema/rapidjson/test/unittest/readertest.cpp +1895 -0
  285. data/ext/rj_schema/rapidjson/test/unittest/regextest.cpp +638 -0
  286. data/ext/rj_schema/rapidjson/test/unittest/schematest.cpp +2009 -0
  287. data/ext/rj_schema/rapidjson/test/unittest/simdtest.cpp +219 -0
  288. data/ext/rj_schema/rapidjson/test/unittest/strfunctest.cpp +30 -0
  289. data/ext/rj_schema/rapidjson/test/unittest/stringbuffertest.cpp +192 -0
  290. data/ext/rj_schema/rapidjson/test/unittest/strtodtest.cpp +132 -0
  291. data/ext/rj_schema/rapidjson/test/unittest/unittest.cpp +51 -0
  292. data/ext/rj_schema/rapidjson/test/unittest/unittest.h +140 -0
  293. data/ext/rj_schema/rapidjson/test/unittest/valuetest.cpp +1829 -0
  294. data/ext/rj_schema/rapidjson/test/unittest/writertest.cpp +598 -0
  295. data/ext/rj_schema/rapidjson/test/valgrind.supp +17 -0
  296. data/ext/rj_schema/rapidjson/travis-doxygen.sh +121 -0
  297. data/ext/rj_schema/rj_schema.cpp +136 -0
  298. data/lib/rj_schema.rb +7 -0
  299. metadata +371 -0
@@ -0,0 +1,181 @@
1
+ // Tencent is pleased to support the open source community by making RapidJSON available.
2
+ //
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4
+ //
5
+ // Licensed under the MIT License (the "License"); you may not use this file except
6
+ // in compliance with the License. You may obtain a copy of the License at
7
+ //
8
+ // http://opensource.org/licenses/MIT
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software distributed
11
+ // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12
+ // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13
+ // specific language governing permissions and limitations under the License.
14
+
15
+ #ifndef RAPIDJSON_INTERNAL_META_H_
16
+ #define RAPIDJSON_INTERNAL_META_H_
17
+
18
+ #include "../rapidjson.h"
19
+
20
+ #ifdef __GNUC__
21
+ RAPIDJSON_DIAG_PUSH
22
+ RAPIDJSON_DIAG_OFF(effc++)
23
+ #endif
24
+ #if defined(_MSC_VER)
25
+ RAPIDJSON_DIAG_PUSH
26
+ RAPIDJSON_DIAG_OFF(6334)
27
+ #endif
28
+
29
+ #if RAPIDJSON_HAS_CXX11_TYPETRAITS
30
+ #include <type_traits>
31
+ #endif
32
+
33
+ //@cond RAPIDJSON_INTERNAL
34
+ RAPIDJSON_NAMESPACE_BEGIN
35
+ namespace internal {
36
+
37
+ // Helper to wrap/convert arbitrary types to void, useful for arbitrary type matching
38
+ template <typename T> struct Void { typedef void Type; };
39
+
40
+ ///////////////////////////////////////////////////////////////////////////////
41
+ // BoolType, TrueType, FalseType
42
+ //
43
+ template <bool Cond> struct BoolType {
44
+ static const bool Value = Cond;
45
+ typedef BoolType Type;
46
+ };
47
+ typedef BoolType<true> TrueType;
48
+ typedef BoolType<false> FalseType;
49
+
50
+
51
+ ///////////////////////////////////////////////////////////////////////////////
52
+ // SelectIf, BoolExpr, NotExpr, AndExpr, OrExpr
53
+ //
54
+
55
+ template <bool C> struct SelectIfImpl { template <typename T1, typename T2> struct Apply { typedef T1 Type; }; };
56
+ template <> struct SelectIfImpl<false> { template <typename T1, typename T2> struct Apply { typedef T2 Type; }; };
57
+ template <bool C, typename T1, typename T2> struct SelectIfCond : SelectIfImpl<C>::template Apply<T1,T2> {};
58
+ template <typename C, typename T1, typename T2> struct SelectIf : SelectIfCond<C::Value, T1, T2> {};
59
+
60
+ template <bool Cond1, bool Cond2> struct AndExprCond : FalseType {};
61
+ template <> struct AndExprCond<true, true> : TrueType {};
62
+ template <bool Cond1, bool Cond2> struct OrExprCond : TrueType {};
63
+ template <> struct OrExprCond<false, false> : FalseType {};
64
+
65
+ template <typename C> struct BoolExpr : SelectIf<C,TrueType,FalseType>::Type {};
66
+ template <typename C> struct NotExpr : SelectIf<C,FalseType,TrueType>::Type {};
67
+ template <typename C1, typename C2> struct AndExpr : AndExprCond<C1::Value, C2::Value>::Type {};
68
+ template <typename C1, typename C2> struct OrExpr : OrExprCond<C1::Value, C2::Value>::Type {};
69
+
70
+
71
+ ///////////////////////////////////////////////////////////////////////////////
72
+ // AddConst, MaybeAddConst, RemoveConst
73
+ template <typename T> struct AddConst { typedef const T Type; };
74
+ template <bool Constify, typename T> struct MaybeAddConst : SelectIfCond<Constify, const T, T> {};
75
+ template <typename T> struct RemoveConst { typedef T Type; };
76
+ template <typename T> struct RemoveConst<const T> { typedef T Type; };
77
+
78
+
79
+ ///////////////////////////////////////////////////////////////////////////////
80
+ // IsSame, IsConst, IsMoreConst, IsPointer
81
+ //
82
+ template <typename T, typename U> struct IsSame : FalseType {};
83
+ template <typename T> struct IsSame<T, T> : TrueType {};
84
+
85
+ template <typename T> struct IsConst : FalseType {};
86
+ template <typename T> struct IsConst<const T> : TrueType {};
87
+
88
+ template <typename CT, typename T>
89
+ struct IsMoreConst
90
+ : AndExpr<IsSame<typename RemoveConst<CT>::Type, typename RemoveConst<T>::Type>,
91
+ BoolType<IsConst<CT>::Value >= IsConst<T>::Value> >::Type {};
92
+
93
+ template <typename T> struct IsPointer : FalseType {};
94
+ template <typename T> struct IsPointer<T*> : TrueType {};
95
+
96
+ ///////////////////////////////////////////////////////////////////////////////
97
+ // IsBaseOf
98
+ //
99
+ #if RAPIDJSON_HAS_CXX11_TYPETRAITS
100
+
101
+ template <typename B, typename D> struct IsBaseOf
102
+ : BoolType< ::std::is_base_of<B,D>::value> {};
103
+
104
+ #else // simplified version adopted from Boost
105
+
106
+ template<typename B, typename D> struct IsBaseOfImpl {
107
+ RAPIDJSON_STATIC_ASSERT(sizeof(B) != 0);
108
+ RAPIDJSON_STATIC_ASSERT(sizeof(D) != 0);
109
+
110
+ typedef char (&Yes)[1];
111
+ typedef char (&No) [2];
112
+
113
+ template <typename T>
114
+ static Yes Check(const D*, T);
115
+ static No Check(const B*, int);
116
+
117
+ struct Host {
118
+ operator const B*() const;
119
+ operator const D*();
120
+ };
121
+
122
+ enum { Value = (sizeof(Check(Host(), 0)) == sizeof(Yes)) };
123
+ };
124
+
125
+ template <typename B, typename D> struct IsBaseOf
126
+ : OrExpr<IsSame<B, D>, BoolExpr<IsBaseOfImpl<B, D> > >::Type {};
127
+
128
+ #endif // RAPIDJSON_HAS_CXX11_TYPETRAITS
129
+
130
+
131
+ //////////////////////////////////////////////////////////////////////////
132
+ // EnableIf / DisableIf
133
+ //
134
+ template <bool Condition, typename T = void> struct EnableIfCond { typedef T Type; };
135
+ template <typename T> struct EnableIfCond<false, T> { /* empty */ };
136
+
137
+ template <bool Condition, typename T = void> struct DisableIfCond { typedef T Type; };
138
+ template <typename T> struct DisableIfCond<true, T> { /* empty */ };
139
+
140
+ template <typename Condition, typename T = void>
141
+ struct EnableIf : EnableIfCond<Condition::Value, T> {};
142
+
143
+ template <typename Condition, typename T = void>
144
+ struct DisableIf : DisableIfCond<Condition::Value, T> {};
145
+
146
+ // SFINAE helpers
147
+ struct SfinaeTag {};
148
+ template <typename T> struct RemoveSfinaeTag;
149
+ template <typename T> struct RemoveSfinaeTag<SfinaeTag&(*)(T)> { typedef T Type; };
150
+
151
+ #define RAPIDJSON_REMOVEFPTR_(type) \
152
+ typename ::RAPIDJSON_NAMESPACE::internal::RemoveSfinaeTag \
153
+ < ::RAPIDJSON_NAMESPACE::internal::SfinaeTag&(*) type>::Type
154
+
155
+ #define RAPIDJSON_ENABLEIF(cond) \
156
+ typename ::RAPIDJSON_NAMESPACE::internal::EnableIf \
157
+ <RAPIDJSON_REMOVEFPTR_(cond)>::Type * = NULL
158
+
159
+ #define RAPIDJSON_DISABLEIF(cond) \
160
+ typename ::RAPIDJSON_NAMESPACE::internal::DisableIf \
161
+ <RAPIDJSON_REMOVEFPTR_(cond)>::Type * = NULL
162
+
163
+ #define RAPIDJSON_ENABLEIF_RETURN(cond,returntype) \
164
+ typename ::RAPIDJSON_NAMESPACE::internal::EnableIf \
165
+ <RAPIDJSON_REMOVEFPTR_(cond), \
166
+ RAPIDJSON_REMOVEFPTR_(returntype)>::Type
167
+
168
+ #define RAPIDJSON_DISABLEIF_RETURN(cond,returntype) \
169
+ typename ::RAPIDJSON_NAMESPACE::internal::DisableIf \
170
+ <RAPIDJSON_REMOVEFPTR_(cond), \
171
+ RAPIDJSON_REMOVEFPTR_(returntype)>::Type
172
+
173
+ } // namespace internal
174
+ RAPIDJSON_NAMESPACE_END
175
+ //@endcond
176
+
177
+ #if defined(__GNUC__) || defined(_MSC_VER)
178
+ RAPIDJSON_DIAG_POP
179
+ #endif
180
+
181
+ #endif // RAPIDJSON_INTERNAL_META_H_
@@ -0,0 +1,55 @@
1
+ // Tencent is pleased to support the open source community by making RapidJSON available.
2
+ //
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4
+ //
5
+ // Licensed under the MIT License (the "License"); you may not use this file except
6
+ // in compliance with the License. You may obtain a copy of the License at
7
+ //
8
+ // http://opensource.org/licenses/MIT
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software distributed
11
+ // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12
+ // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13
+ // specific language governing permissions and limitations under the License.
14
+
15
+ #ifndef RAPIDJSON_POW10_
16
+ #define RAPIDJSON_POW10_
17
+
18
+ #include "../rapidjson.h"
19
+
20
+ RAPIDJSON_NAMESPACE_BEGIN
21
+ namespace internal {
22
+
23
+ //! Computes integer powers of 10 in double (10.0^n).
24
+ /*! This function uses lookup table for fast and accurate results.
25
+ \param n non-negative exponent. Must <= 308.
26
+ \return 10.0^n
27
+ */
28
+ inline double Pow10(int n) {
29
+ static const double e[] = { // 1e-0...1e308: 309 * 8 bytes = 2472 bytes
30
+ 1e+0,
31
+ 1e+1, 1e+2, 1e+3, 1e+4, 1e+5, 1e+6, 1e+7, 1e+8, 1e+9, 1e+10, 1e+11, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20,
32
+ 1e+21, 1e+22, 1e+23, 1e+24, 1e+25, 1e+26, 1e+27, 1e+28, 1e+29, 1e+30, 1e+31, 1e+32, 1e+33, 1e+34, 1e+35, 1e+36, 1e+37, 1e+38, 1e+39, 1e+40,
33
+ 1e+41, 1e+42, 1e+43, 1e+44, 1e+45, 1e+46, 1e+47, 1e+48, 1e+49, 1e+50, 1e+51, 1e+52, 1e+53, 1e+54, 1e+55, 1e+56, 1e+57, 1e+58, 1e+59, 1e+60,
34
+ 1e+61, 1e+62, 1e+63, 1e+64, 1e+65, 1e+66, 1e+67, 1e+68, 1e+69, 1e+70, 1e+71, 1e+72, 1e+73, 1e+74, 1e+75, 1e+76, 1e+77, 1e+78, 1e+79, 1e+80,
35
+ 1e+81, 1e+82, 1e+83, 1e+84, 1e+85, 1e+86, 1e+87, 1e+88, 1e+89, 1e+90, 1e+91, 1e+92, 1e+93, 1e+94, 1e+95, 1e+96, 1e+97, 1e+98, 1e+99, 1e+100,
36
+ 1e+101,1e+102,1e+103,1e+104,1e+105,1e+106,1e+107,1e+108,1e+109,1e+110,1e+111,1e+112,1e+113,1e+114,1e+115,1e+116,1e+117,1e+118,1e+119,1e+120,
37
+ 1e+121,1e+122,1e+123,1e+124,1e+125,1e+126,1e+127,1e+128,1e+129,1e+130,1e+131,1e+132,1e+133,1e+134,1e+135,1e+136,1e+137,1e+138,1e+139,1e+140,
38
+ 1e+141,1e+142,1e+143,1e+144,1e+145,1e+146,1e+147,1e+148,1e+149,1e+150,1e+151,1e+152,1e+153,1e+154,1e+155,1e+156,1e+157,1e+158,1e+159,1e+160,
39
+ 1e+161,1e+162,1e+163,1e+164,1e+165,1e+166,1e+167,1e+168,1e+169,1e+170,1e+171,1e+172,1e+173,1e+174,1e+175,1e+176,1e+177,1e+178,1e+179,1e+180,
40
+ 1e+181,1e+182,1e+183,1e+184,1e+185,1e+186,1e+187,1e+188,1e+189,1e+190,1e+191,1e+192,1e+193,1e+194,1e+195,1e+196,1e+197,1e+198,1e+199,1e+200,
41
+ 1e+201,1e+202,1e+203,1e+204,1e+205,1e+206,1e+207,1e+208,1e+209,1e+210,1e+211,1e+212,1e+213,1e+214,1e+215,1e+216,1e+217,1e+218,1e+219,1e+220,
42
+ 1e+221,1e+222,1e+223,1e+224,1e+225,1e+226,1e+227,1e+228,1e+229,1e+230,1e+231,1e+232,1e+233,1e+234,1e+235,1e+236,1e+237,1e+238,1e+239,1e+240,
43
+ 1e+241,1e+242,1e+243,1e+244,1e+245,1e+246,1e+247,1e+248,1e+249,1e+250,1e+251,1e+252,1e+253,1e+254,1e+255,1e+256,1e+257,1e+258,1e+259,1e+260,
44
+ 1e+261,1e+262,1e+263,1e+264,1e+265,1e+266,1e+267,1e+268,1e+269,1e+270,1e+271,1e+272,1e+273,1e+274,1e+275,1e+276,1e+277,1e+278,1e+279,1e+280,
45
+ 1e+281,1e+282,1e+283,1e+284,1e+285,1e+286,1e+287,1e+288,1e+289,1e+290,1e+291,1e+292,1e+293,1e+294,1e+295,1e+296,1e+297,1e+298,1e+299,1e+300,
46
+ 1e+301,1e+302,1e+303,1e+304,1e+305,1e+306,1e+307,1e+308
47
+ };
48
+ RAPIDJSON_ASSERT(n >= 0 && n <= 308);
49
+ return e[n];
50
+ }
51
+
52
+ } // namespace internal
53
+ RAPIDJSON_NAMESPACE_END
54
+
55
+ #endif // RAPIDJSON_POW10_
@@ -0,0 +1,734 @@
1
+ // Tencent is pleased to support the open source community by making RapidJSON available.
2
+ //
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4
+ //
5
+ // Licensed under the MIT License (the "License"); you may not use this file except
6
+ // in compliance with the License. You may obtain a copy of the License at
7
+ //
8
+ // http://opensource.org/licenses/MIT
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software distributed
11
+ // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12
+ // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13
+ // specific language governing permissions and limitations under the License.
14
+
15
+ #ifndef RAPIDJSON_INTERNAL_REGEX_H_
16
+ #define RAPIDJSON_INTERNAL_REGEX_H_
17
+
18
+ #include "../allocators.h"
19
+ #include "../stream.h"
20
+ #include "stack.h"
21
+
22
+ #ifdef __clang__
23
+ RAPIDJSON_DIAG_PUSH
24
+ RAPIDJSON_DIAG_OFF(padded)
25
+ RAPIDJSON_DIAG_OFF(switch-enum)
26
+ RAPIDJSON_DIAG_OFF(implicit-fallthrough)
27
+ #endif
28
+
29
+ #ifdef __GNUC__
30
+ RAPIDJSON_DIAG_PUSH
31
+ RAPIDJSON_DIAG_OFF(effc++)
32
+ #if __GNUC__ >= 7
33
+ RAPIDJSON_DIAG_OFF(implicit-fallthrough)
34
+ #endif
35
+ #endif
36
+
37
+ #ifdef _MSC_VER
38
+ RAPIDJSON_DIAG_PUSH
39
+ RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated
40
+ #endif
41
+
42
+ #ifndef RAPIDJSON_REGEX_VERBOSE
43
+ #define RAPIDJSON_REGEX_VERBOSE 0
44
+ #endif
45
+
46
+ RAPIDJSON_NAMESPACE_BEGIN
47
+ namespace internal {
48
+
49
+ ///////////////////////////////////////////////////////////////////////////////
50
+ // DecodedStream
51
+
52
+ template <typename SourceStream, typename Encoding>
53
+ class DecodedStream {
54
+ public:
55
+ DecodedStream(SourceStream& ss) : ss_(ss), codepoint_() { Decode(); }
56
+ unsigned Peek() { return codepoint_; }
57
+ unsigned Take() {
58
+ unsigned c = codepoint_;
59
+ if (c) // No further decoding when '\0'
60
+ Decode();
61
+ return c;
62
+ }
63
+
64
+ private:
65
+ void Decode() {
66
+ if (!Encoding::Decode(ss_, &codepoint_))
67
+ codepoint_ = 0;
68
+ }
69
+
70
+ SourceStream& ss_;
71
+ unsigned codepoint_;
72
+ };
73
+
74
+ ///////////////////////////////////////////////////////////////////////////////
75
+ // GenericRegex
76
+
77
+ static const SizeType kRegexInvalidState = ~SizeType(0); //!< Represents an invalid index in GenericRegex::State::out, out1
78
+ static const SizeType kRegexInvalidRange = ~SizeType(0);
79
+
80
+ template <typename Encoding, typename Allocator>
81
+ class GenericRegexSearch;
82
+
83
+ //! Regular expression engine with subset of ECMAscript grammar.
84
+ /*!
85
+ Supported regular expression syntax:
86
+ - \c ab Concatenation
87
+ - \c a|b Alternation
88
+ - \c a? Zero or one
89
+ - \c a* Zero or more
90
+ - \c a+ One or more
91
+ - \c a{3} Exactly 3 times
92
+ - \c a{3,} At least 3 times
93
+ - \c a{3,5} 3 to 5 times
94
+ - \c (ab) Grouping
95
+ - \c ^a At the beginning
96
+ - \c a$ At the end
97
+ - \c . Any character
98
+ - \c [abc] Character classes
99
+ - \c [a-c] Character class range
100
+ - \c [a-z0-9_] Character class combination
101
+ - \c [^abc] Negated character classes
102
+ - \c [^a-c] Negated character class range
103
+ - \c [\b] Backspace (U+0008)
104
+ - \c \\| \\\\ ... Escape characters
105
+ - \c \\f Form feed (U+000C)
106
+ - \c \\n Line feed (U+000A)
107
+ - \c \\r Carriage return (U+000D)
108
+ - \c \\t Tab (U+0009)
109
+ - \c \\v Vertical tab (U+000B)
110
+
111
+ \note This is a Thompson NFA engine, implemented with reference to
112
+ Cox, Russ. "Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby,...).",
113
+ https://swtch.com/~rsc/regexp/regexp1.html
114
+ */
115
+ template <typename Encoding, typename Allocator = CrtAllocator>
116
+ class GenericRegex {
117
+ public:
118
+ typedef Encoding EncodingType;
119
+ typedef typename Encoding::Ch Ch;
120
+ template <typename, typename> friend class GenericRegexSearch;
121
+
122
+ GenericRegex(const Ch* source, Allocator* allocator = 0) :
123
+ states_(allocator, 256), ranges_(allocator, 256), root_(kRegexInvalidState), stateCount_(), rangeCount_(),
124
+ anchorBegin_(), anchorEnd_()
125
+ {
126
+ GenericStringStream<Encoding> ss(source);
127
+ DecodedStream<GenericStringStream<Encoding>, Encoding> ds(ss);
128
+ Parse(ds);
129
+ }
130
+
131
+ ~GenericRegex() {}
132
+
133
+ bool IsValid() const {
134
+ return root_ != kRegexInvalidState;
135
+ }
136
+
137
+ private:
138
+ enum Operator {
139
+ kZeroOrOne,
140
+ kZeroOrMore,
141
+ kOneOrMore,
142
+ kConcatenation,
143
+ kAlternation,
144
+ kLeftParenthesis
145
+ };
146
+
147
+ static const unsigned kAnyCharacterClass = 0xFFFFFFFF; //!< For '.'
148
+ static const unsigned kRangeCharacterClass = 0xFFFFFFFE;
149
+ static const unsigned kRangeNegationFlag = 0x80000000;
150
+
151
+ struct Range {
152
+ unsigned start; //
153
+ unsigned end;
154
+ SizeType next;
155
+ };
156
+
157
+ struct State {
158
+ SizeType out; //!< Equals to kInvalid for matching state
159
+ SizeType out1; //!< Equals to non-kInvalid for split
160
+ SizeType rangeStart;
161
+ unsigned codepoint;
162
+ };
163
+
164
+ struct Frag {
165
+ Frag(SizeType s, SizeType o, SizeType m) : start(s), out(o), minIndex(m) {}
166
+ SizeType start;
167
+ SizeType out; //!< link-list of all output states
168
+ SizeType minIndex;
169
+ };
170
+
171
+ State& GetState(SizeType index) {
172
+ RAPIDJSON_ASSERT(index < stateCount_);
173
+ return states_.template Bottom<State>()[index];
174
+ }
175
+
176
+ const State& GetState(SizeType index) const {
177
+ RAPIDJSON_ASSERT(index < stateCount_);
178
+ return states_.template Bottom<State>()[index];
179
+ }
180
+
181
+ Range& GetRange(SizeType index) {
182
+ RAPIDJSON_ASSERT(index < rangeCount_);
183
+ return ranges_.template Bottom<Range>()[index];
184
+ }
185
+
186
+ const Range& GetRange(SizeType index) const {
187
+ RAPIDJSON_ASSERT(index < rangeCount_);
188
+ return ranges_.template Bottom<Range>()[index];
189
+ }
190
+
191
+ template <typename InputStream>
192
+ void Parse(DecodedStream<InputStream, Encoding>& ds) {
193
+ Allocator allocator;
194
+ Stack<Allocator> operandStack(&allocator, 256); // Frag
195
+ Stack<Allocator> operatorStack(&allocator, 256); // Operator
196
+ Stack<Allocator> atomCountStack(&allocator, 256); // unsigned (Atom per parenthesis)
197
+
198
+ *atomCountStack.template Push<unsigned>() = 0;
199
+
200
+ unsigned codepoint;
201
+ while (ds.Peek() != 0) {
202
+ switch (codepoint = ds.Take()) {
203
+ case '^':
204
+ anchorBegin_ = true;
205
+ break;
206
+
207
+ case '$':
208
+ anchorEnd_ = true;
209
+ break;
210
+
211
+ case '|':
212
+ while (!operatorStack.Empty() && *operatorStack.template Top<Operator>() < kAlternation)
213
+ if (!Eval(operandStack, *operatorStack.template Pop<Operator>(1)))
214
+ return;
215
+ *operatorStack.template Push<Operator>() = kAlternation;
216
+ *atomCountStack.template Top<unsigned>() = 0;
217
+ break;
218
+
219
+ case '(':
220
+ *operatorStack.template Push<Operator>() = kLeftParenthesis;
221
+ *atomCountStack.template Push<unsigned>() = 0;
222
+ break;
223
+
224
+ case ')':
225
+ while (!operatorStack.Empty() && *operatorStack.template Top<Operator>() != kLeftParenthesis)
226
+ if (!Eval(operandStack, *operatorStack.template Pop<Operator>(1)))
227
+ return;
228
+ if (operatorStack.Empty())
229
+ return;
230
+ operatorStack.template Pop<Operator>(1);
231
+ atomCountStack.template Pop<unsigned>(1);
232
+ ImplicitConcatenation(atomCountStack, operatorStack);
233
+ break;
234
+
235
+ case '?':
236
+ if (!Eval(operandStack, kZeroOrOne))
237
+ return;
238
+ break;
239
+
240
+ case '*':
241
+ if (!Eval(operandStack, kZeroOrMore))
242
+ return;
243
+ break;
244
+
245
+ case '+':
246
+ if (!Eval(operandStack, kOneOrMore))
247
+ return;
248
+ break;
249
+
250
+ case '{':
251
+ {
252
+ unsigned n, m;
253
+ if (!ParseUnsigned(ds, &n))
254
+ return;
255
+
256
+ if (ds.Peek() == ',') {
257
+ ds.Take();
258
+ if (ds.Peek() == '}')
259
+ m = kInfinityQuantifier;
260
+ else if (!ParseUnsigned(ds, &m) || m < n)
261
+ return;
262
+ }
263
+ else
264
+ m = n;
265
+
266
+ if (!EvalQuantifier(operandStack, n, m) || ds.Peek() != '}')
267
+ return;
268
+ ds.Take();
269
+ }
270
+ break;
271
+
272
+ case '.':
273
+ PushOperand(operandStack, kAnyCharacterClass);
274
+ ImplicitConcatenation(atomCountStack, operatorStack);
275
+ break;
276
+
277
+ case '[':
278
+ {
279
+ SizeType range;
280
+ if (!ParseRange(ds, &range))
281
+ return;
282
+ SizeType s = NewState(kRegexInvalidState, kRegexInvalidState, kRangeCharacterClass);
283
+ GetState(s).rangeStart = range;
284
+ *operandStack.template Push<Frag>() = Frag(s, s, s);
285
+ }
286
+ ImplicitConcatenation(atomCountStack, operatorStack);
287
+ break;
288
+
289
+ case '\\': // Escape character
290
+ if (!CharacterEscape(ds, &codepoint))
291
+ return; // Unsupported escape character
292
+ // fall through to default
293
+
294
+ default: // Pattern character
295
+ PushOperand(operandStack, codepoint);
296
+ ImplicitConcatenation(atomCountStack, operatorStack);
297
+ }
298
+ }
299
+
300
+ while (!operatorStack.Empty())
301
+ if (!Eval(operandStack, *operatorStack.template Pop<Operator>(1)))
302
+ return;
303
+
304
+ // Link the operand to matching state.
305
+ if (operandStack.GetSize() == sizeof(Frag)) {
306
+ Frag* e = operandStack.template Pop<Frag>(1);
307
+ Patch(e->out, NewState(kRegexInvalidState, kRegexInvalidState, 0));
308
+ root_ = e->start;
309
+
310
+ #if RAPIDJSON_REGEX_VERBOSE
311
+ printf("root: %d\n", root_);
312
+ for (SizeType i = 0; i < stateCount_ ; i++) {
313
+ State& s = GetState(i);
314
+ printf("[%2d] out: %2d out1: %2d c: '%c'\n", i, s.out, s.out1, (char)s.codepoint);
315
+ }
316
+ printf("\n");
317
+ #endif
318
+ }
319
+ }
320
+
321
+ SizeType NewState(SizeType out, SizeType out1, unsigned codepoint) {
322
+ State* s = states_.template Push<State>();
323
+ s->out = out;
324
+ s->out1 = out1;
325
+ s->codepoint = codepoint;
326
+ s->rangeStart = kRegexInvalidRange;
327
+ return stateCount_++;
328
+ }
329
+
330
+ void PushOperand(Stack<Allocator>& operandStack, unsigned codepoint) {
331
+ SizeType s = NewState(kRegexInvalidState, kRegexInvalidState, codepoint);
332
+ *operandStack.template Push<Frag>() = Frag(s, s, s);
333
+ }
334
+
335
+ void ImplicitConcatenation(Stack<Allocator>& atomCountStack, Stack<Allocator>& operatorStack) {
336
+ if (*atomCountStack.template Top<unsigned>())
337
+ *operatorStack.template Push<Operator>() = kConcatenation;
338
+ (*atomCountStack.template Top<unsigned>())++;
339
+ }
340
+
341
+ SizeType Append(SizeType l1, SizeType l2) {
342
+ SizeType old = l1;
343
+ while (GetState(l1).out != kRegexInvalidState)
344
+ l1 = GetState(l1).out;
345
+ GetState(l1).out = l2;
346
+ return old;
347
+ }
348
+
349
+ void Patch(SizeType l, SizeType s) {
350
+ for (SizeType next; l != kRegexInvalidState; l = next) {
351
+ next = GetState(l).out;
352
+ GetState(l).out = s;
353
+ }
354
+ }
355
+
356
+ bool Eval(Stack<Allocator>& operandStack, Operator op) {
357
+ switch (op) {
358
+ case kConcatenation:
359
+ RAPIDJSON_ASSERT(operandStack.GetSize() >= sizeof(Frag) * 2);
360
+ {
361
+ Frag e2 = *operandStack.template Pop<Frag>(1);
362
+ Frag e1 = *operandStack.template Pop<Frag>(1);
363
+ Patch(e1.out, e2.start);
364
+ *operandStack.template Push<Frag>() = Frag(e1.start, e2.out, Min(e1.minIndex, e2.minIndex));
365
+ }
366
+ return true;
367
+
368
+ case kAlternation:
369
+ if (operandStack.GetSize() >= sizeof(Frag) * 2) {
370
+ Frag e2 = *operandStack.template Pop<Frag>(1);
371
+ Frag e1 = *operandStack.template Pop<Frag>(1);
372
+ SizeType s = NewState(e1.start, e2.start, 0);
373
+ *operandStack.template Push<Frag>() = Frag(s, Append(e1.out, e2.out), Min(e1.minIndex, e2.minIndex));
374
+ return true;
375
+ }
376
+ return false;
377
+
378
+ case kZeroOrOne:
379
+ if (operandStack.GetSize() >= sizeof(Frag)) {
380
+ Frag e = *operandStack.template Pop<Frag>(1);
381
+ SizeType s = NewState(kRegexInvalidState, e.start, 0);
382
+ *operandStack.template Push<Frag>() = Frag(s, Append(e.out, s), e.minIndex);
383
+ return true;
384
+ }
385
+ return false;
386
+
387
+ case kZeroOrMore:
388
+ if (operandStack.GetSize() >= sizeof(Frag)) {
389
+ Frag e = *operandStack.template Pop<Frag>(1);
390
+ SizeType s = NewState(kRegexInvalidState, e.start, 0);
391
+ Patch(e.out, s);
392
+ *operandStack.template Push<Frag>() = Frag(s, s, e.minIndex);
393
+ return true;
394
+ }
395
+ return false;
396
+
397
+ default:
398
+ RAPIDJSON_ASSERT(op == kOneOrMore);
399
+ if (operandStack.GetSize() >= sizeof(Frag)) {
400
+ Frag e = *operandStack.template Pop<Frag>(1);
401
+ SizeType s = NewState(kRegexInvalidState, e.start, 0);
402
+ Patch(e.out, s);
403
+ *operandStack.template Push<Frag>() = Frag(e.start, s, e.minIndex);
404
+ return true;
405
+ }
406
+ return false;
407
+ }
408
+ }
409
+
410
+ bool EvalQuantifier(Stack<Allocator>& operandStack, unsigned n, unsigned m) {
411
+ RAPIDJSON_ASSERT(n <= m);
412
+ RAPIDJSON_ASSERT(operandStack.GetSize() >= sizeof(Frag));
413
+
414
+ if (n == 0) {
415
+ if (m == 0) // a{0} not support
416
+ return false;
417
+ else if (m == kInfinityQuantifier)
418
+ Eval(operandStack, kZeroOrMore); // a{0,} -> a*
419
+ else {
420
+ Eval(operandStack, kZeroOrOne); // a{0,5} -> a?
421
+ for (unsigned i = 0; i < m - 1; i++)
422
+ CloneTopOperand(operandStack); // a{0,5} -> a? a? a? a? a?
423
+ for (unsigned i = 0; i < m - 1; i++)
424
+ Eval(operandStack, kConcatenation); // a{0,5} -> a?a?a?a?a?
425
+ }
426
+ return true;
427
+ }
428
+
429
+ for (unsigned i = 0; i < n - 1; i++) // a{3} -> a a a
430
+ CloneTopOperand(operandStack);
431
+
432
+ if (m == kInfinityQuantifier)
433
+ Eval(operandStack, kOneOrMore); // a{3,} -> a a a+
434
+ else if (m > n) {
435
+ CloneTopOperand(operandStack); // a{3,5} -> a a a a
436
+ Eval(operandStack, kZeroOrOne); // a{3,5} -> a a a a?
437
+ for (unsigned i = n; i < m - 1; i++)
438
+ CloneTopOperand(operandStack); // a{3,5} -> a a a a? a?
439
+ for (unsigned i = n; i < m; i++)
440
+ Eval(operandStack, kConcatenation); // a{3,5} -> a a aa?a?
441
+ }
442
+
443
+ for (unsigned i = 0; i < n - 1; i++)
444
+ Eval(operandStack, kConcatenation); // a{3} -> aaa, a{3,} -> aaa+, a{3.5} -> aaaa?a?
445
+
446
+ return true;
447
+ }
448
+
449
+ static SizeType Min(SizeType a, SizeType b) { return a < b ? a : b; }
450
+
451
+ void CloneTopOperand(Stack<Allocator>& operandStack) {
452
+ const Frag src = *operandStack.template Top<Frag>(); // Copy constructor to prevent invalidation
453
+ SizeType count = stateCount_ - src.minIndex; // Assumes top operand contains states in [src->minIndex, stateCount_)
454
+ State* s = states_.template Push<State>(count);
455
+ memcpy(s, &GetState(src.minIndex), count * sizeof(State));
456
+ for (SizeType j = 0; j < count; j++) {
457
+ if (s[j].out != kRegexInvalidState)
458
+ s[j].out += count;
459
+ if (s[j].out1 != kRegexInvalidState)
460
+ s[j].out1 += count;
461
+ }
462
+ *operandStack.template Push<Frag>() = Frag(src.start + count, src.out + count, src.minIndex + count);
463
+ stateCount_ += count;
464
+ }
465
+
466
+ template <typename InputStream>
467
+ bool ParseUnsigned(DecodedStream<InputStream, Encoding>& ds, unsigned* u) {
468
+ unsigned r = 0;
469
+ if (ds.Peek() < '0' || ds.Peek() > '9')
470
+ return false;
471
+ while (ds.Peek() >= '0' && ds.Peek() <= '9') {
472
+ if (r >= 429496729 && ds.Peek() > '5') // 2^32 - 1 = 4294967295
473
+ return false; // overflow
474
+ r = r * 10 + (ds.Take() - '0');
475
+ }
476
+ *u = r;
477
+ return true;
478
+ }
479
+
480
+ template <typename InputStream>
481
+ bool ParseRange(DecodedStream<InputStream, Encoding>& ds, SizeType* range) {
482
+ bool isBegin = true;
483
+ bool negate = false;
484
+ int step = 0;
485
+ SizeType start = kRegexInvalidRange;
486
+ SizeType current = kRegexInvalidRange;
487
+ unsigned codepoint;
488
+ while ((codepoint = ds.Take()) != 0) {
489
+ if (isBegin) {
490
+ isBegin = false;
491
+ if (codepoint == '^') {
492
+ negate = true;
493
+ continue;
494
+ }
495
+ }
496
+
497
+ switch (codepoint) {
498
+ case ']':
499
+ if (start == kRegexInvalidRange)
500
+ return false; // Error: nothing inside []
501
+ if (step == 2) { // Add trailing '-'
502
+ SizeType r = NewRange('-');
503
+ RAPIDJSON_ASSERT(current != kRegexInvalidRange);
504
+ GetRange(current).next = r;
505
+ }
506
+ if (negate)
507
+ GetRange(start).start |= kRangeNegationFlag;
508
+ *range = start;
509
+ return true;
510
+
511
+ case '\\':
512
+ if (ds.Peek() == 'b') {
513
+ ds.Take();
514
+ codepoint = 0x0008; // Escape backspace character
515
+ }
516
+ else if (!CharacterEscape(ds, &codepoint))
517
+ return false;
518
+ // fall through to default
519
+
520
+ default:
521
+ switch (step) {
522
+ case 1:
523
+ if (codepoint == '-') {
524
+ step++;
525
+ break;
526
+ }
527
+ // fall through to step 0 for other characters
528
+
529
+ case 0:
530
+ {
531
+ SizeType r = NewRange(codepoint);
532
+ if (current != kRegexInvalidRange)
533
+ GetRange(current).next = r;
534
+ if (start == kRegexInvalidRange)
535
+ start = r;
536
+ current = r;
537
+ }
538
+ step = 1;
539
+ break;
540
+
541
+ default:
542
+ RAPIDJSON_ASSERT(step == 2);
543
+ GetRange(current).end = codepoint;
544
+ step = 0;
545
+ }
546
+ }
547
+ }
548
+ return false;
549
+ }
550
+
551
+ SizeType NewRange(unsigned codepoint) {
552
+ Range* r = ranges_.template Push<Range>();
553
+ r->start = r->end = codepoint;
554
+ r->next = kRegexInvalidRange;
555
+ return rangeCount_++;
556
+ }
557
+
558
+ template <typename InputStream>
559
+ bool CharacterEscape(DecodedStream<InputStream, Encoding>& ds, unsigned* escapedCodepoint) {
560
+ unsigned codepoint;
561
+ switch (codepoint = ds.Take()) {
562
+ case '^':
563
+ case '$':
564
+ case '|':
565
+ case '(':
566
+ case ')':
567
+ case '?':
568
+ case '*':
569
+ case '+':
570
+ case '.':
571
+ case '[':
572
+ case ']':
573
+ case '{':
574
+ case '}':
575
+ case '\\':
576
+ *escapedCodepoint = codepoint; return true;
577
+ case 'f': *escapedCodepoint = 0x000C; return true;
578
+ case 'n': *escapedCodepoint = 0x000A; return true;
579
+ case 'r': *escapedCodepoint = 0x000D; return true;
580
+ case 't': *escapedCodepoint = 0x0009; return true;
581
+ case 'v': *escapedCodepoint = 0x000B; return true;
582
+ default:
583
+ return false; // Unsupported escape character
584
+ }
585
+ }
586
+
587
+ Stack<Allocator> states_;
588
+ Stack<Allocator> ranges_;
589
+ SizeType root_;
590
+ SizeType stateCount_;
591
+ SizeType rangeCount_;
592
+
593
+ static const unsigned kInfinityQuantifier = ~0u;
594
+
595
+ // For SearchWithAnchoring()
596
+ bool anchorBegin_;
597
+ bool anchorEnd_;
598
+ };
599
+
600
+ template <typename RegexType, typename Allocator = CrtAllocator>
601
+ class GenericRegexSearch {
602
+ public:
603
+ typedef typename RegexType::EncodingType Encoding;
604
+ typedef typename Encoding::Ch Ch;
605
+
606
+ GenericRegexSearch(const RegexType& regex, Allocator* allocator = 0) :
607
+ regex_(regex), allocator_(allocator), ownAllocator_(0),
608
+ state0_(allocator, 0), state1_(allocator, 0), stateSet_()
609
+ {
610
+ RAPIDJSON_ASSERT(regex_.IsValid());
611
+ if (!allocator_)
612
+ ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)();
613
+ stateSet_ = static_cast<unsigned*>(allocator_->Malloc(GetStateSetSize()));
614
+ state0_.template Reserve<SizeType>(regex_.stateCount_);
615
+ state1_.template Reserve<SizeType>(regex_.stateCount_);
616
+ }
617
+
618
+ ~GenericRegexSearch() {
619
+ Allocator::Free(stateSet_);
620
+ RAPIDJSON_DELETE(ownAllocator_);
621
+ }
622
+
623
+ template <typename InputStream>
624
+ bool Match(InputStream& is) {
625
+ return SearchWithAnchoring(is, true, true);
626
+ }
627
+
628
+ bool Match(const Ch* s) {
629
+ GenericStringStream<Encoding> is(s);
630
+ return Match(is);
631
+ }
632
+
633
+ template <typename InputStream>
634
+ bool Search(InputStream& is) {
635
+ return SearchWithAnchoring(is, regex_.anchorBegin_, regex_.anchorEnd_);
636
+ }
637
+
638
+ bool Search(const Ch* s) {
639
+ GenericStringStream<Encoding> is(s);
640
+ return Search(is);
641
+ }
642
+
643
+ private:
644
+ typedef typename RegexType::State State;
645
+ typedef typename RegexType::Range Range;
646
+
647
+ template <typename InputStream>
648
+ bool SearchWithAnchoring(InputStream& is, bool anchorBegin, bool anchorEnd) {
649
+ DecodedStream<InputStream, Encoding> ds(is);
650
+
651
+ state0_.Clear();
652
+ Stack<Allocator> *current = &state0_, *next = &state1_;
653
+ const size_t stateSetSize = GetStateSetSize();
654
+ std::memset(stateSet_, 0, stateSetSize);
655
+
656
+ bool matched = AddState(*current, regex_.root_);
657
+ unsigned codepoint;
658
+ while (!current->Empty() && (codepoint = ds.Take()) != 0) {
659
+ std::memset(stateSet_, 0, stateSetSize);
660
+ next->Clear();
661
+ matched = false;
662
+ for (const SizeType* s = current->template Bottom<SizeType>(); s != current->template End<SizeType>(); ++s) {
663
+ const State& sr = regex_.GetState(*s);
664
+ if (sr.codepoint == codepoint ||
665
+ sr.codepoint == RegexType::kAnyCharacterClass ||
666
+ (sr.codepoint == RegexType::kRangeCharacterClass && MatchRange(sr.rangeStart, codepoint)))
667
+ {
668
+ matched = AddState(*next, sr.out) || matched;
669
+ if (!anchorEnd && matched)
670
+ return true;
671
+ }
672
+ if (!anchorBegin)
673
+ AddState(*next, regex_.root_);
674
+ }
675
+ internal::Swap(current, next);
676
+ }
677
+
678
+ return matched;
679
+ }
680
+
681
+ size_t GetStateSetSize() const {
682
+ return (regex_.stateCount_ + 31) / 32 * 4;
683
+ }
684
+
685
+ // Return whether the added states is a match state
686
+ bool AddState(Stack<Allocator>& l, SizeType index) {
687
+ RAPIDJSON_ASSERT(index != kRegexInvalidState);
688
+
689
+ const State& s = regex_.GetState(index);
690
+ if (s.out1 != kRegexInvalidState) { // Split
691
+ bool matched = AddState(l, s.out);
692
+ return AddState(l, s.out1) || matched;
693
+ }
694
+ else if (!(stateSet_[index >> 5] & (1u << (index & 31)))) {
695
+ stateSet_[index >> 5] |= (1u << (index & 31));
696
+ *l.template PushUnsafe<SizeType>() = index;
697
+ }
698
+ return s.out == kRegexInvalidState; // by using PushUnsafe() above, we can ensure s is not validated due to reallocation.
699
+ }
700
+
701
+ bool MatchRange(SizeType rangeIndex, unsigned codepoint) const {
702
+ bool yes = (regex_.GetRange(rangeIndex).start & RegexType::kRangeNegationFlag) == 0;
703
+ while (rangeIndex != kRegexInvalidRange) {
704
+ const Range& r = regex_.GetRange(rangeIndex);
705
+ if (codepoint >= (r.start & ~RegexType::kRangeNegationFlag) && codepoint <= r.end)
706
+ return yes;
707
+ rangeIndex = r.next;
708
+ }
709
+ return !yes;
710
+ }
711
+
712
+ const RegexType& regex_;
713
+ Allocator* allocator_;
714
+ Allocator* ownAllocator_;
715
+ Stack<Allocator> state0_;
716
+ Stack<Allocator> state1_;
717
+ uint32_t* stateSet_;
718
+ };
719
+
720
+ typedef GenericRegex<UTF8<> > Regex;
721
+ typedef GenericRegexSearch<Regex> RegexSearch;
722
+
723
+ } // namespace internal
724
+ RAPIDJSON_NAMESPACE_END
725
+
726
+ #ifdef __clang__
727
+ RAPIDJSON_DIAG_POP
728
+ #endif
729
+
730
+ #ifdef _MSC_VER
731
+ RAPIDJSON_DIAG_POP
732
+ #endif
733
+
734
+ #endif // RAPIDJSON_INTERNAL_REGEX_H_