json-model-compiler 2.0b40__tar.gz → 2.0b41__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. {json_model_compiler-2.0b40/site → json_model_compiler-2.0b41}/BACKLOG.md +7 -3
  2. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/BENCH.md +1 -7
  3. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/Makefile +24 -5
  4. {json_model_compiler-2.0b40/json_model_compiler.egg-info → json_model_compiler-2.0b41}/PKG-INFO +1 -1
  5. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/perl_entry.pl +7 -0
  6. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/perl_pkg.pl +1 -1
  7. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/javascript.py +2 -1
  8. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/optim.py +108 -41
  9. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/js/main.js +1 -1
  10. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/pl/lib/JSON/JsonModel.pm +1 -1
  11. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/script.py +5 -0
  12. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/xstatic.py +101 -57
  13. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41/json_model_compiler.egg-info}/PKG-INFO +1 -1
  14. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model_compiler.egg-info/SOURCES.txt +4 -22
  15. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/pyproject.toml +1 -1
  16. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41/site}/BACKLOG.md +7 -3
  17. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/BENCH.md +1 -7
  18. json_model_compiler-2.0b41/site/benchmarks/2026031300.csv +171 -0
  19. json_model_compiler-2.0b41/site/benchmarks/2026031300.json +296 -0
  20. json_model_compiler-2.0b41/site/benchmarks/2026031300.md +216 -0
  21. json_model_compiler-2.0b40/site/benchmarks/2026010600.csv +0 -172
  22. json_model_compiler-2.0b40/site/benchmarks/2026010600.json +0 -296
  23. json_model_compiler-2.0b40/site/benchmarks/2026010600.md +0 -215
  24. json_model_compiler-2.0b40/site/benchmarks/2026010900.csv +0 -172
  25. json_model_compiler-2.0b40/site/benchmarks/2026010900.json +0 -296
  26. json_model_compiler-2.0b40/site/benchmarks/2026010900.md +0 -215
  27. json_model_compiler-2.0b40/site/benchmarks/2026011500.csv +0 -172
  28. json_model_compiler-2.0b40/site/benchmarks/2026011500.json +0 -296
  29. json_model_compiler-2.0b40/site/benchmarks/2026011500.md +0 -215
  30. json_model_compiler-2.0b40/site/benchmarks/2026012000.csv +0 -172
  31. json_model_compiler-2.0b40/site/benchmarks/2026012000.json +0 -296
  32. json_model_compiler-2.0b40/site/benchmarks/2026012000.md +0 -215
  33. json_model_compiler-2.0b40/site/benchmarks/2026012200.csv +0 -173
  34. json_model_compiler-2.0b40/site/benchmarks/2026012200.json +0 -296
  35. json_model_compiler-2.0b40/site/benchmarks/2026012200.md +0 -216
  36. json_model_compiler-2.0b40/site/benchmarks/2026012400.csv +0 -173
  37. json_model_compiler-2.0b40/site/benchmarks/2026012400.json +0 -296
  38. json_model_compiler-2.0b40/site/benchmarks/2026012400.md +0 -216
  39. json_model_compiler-2.0b40/site/benchmarks/2026012700.csv +0 -173
  40. json_model_compiler-2.0b40/site/benchmarks/2026012700.json +0 -296
  41. json_model_compiler-2.0b40/site/benchmarks/2026012700.md +0 -216
  42. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/.gitignore +0 -0
  43. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/.gitmodules +0 -0
  44. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/API.md +0 -0
  45. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/DESIGN.md +0 -0
  46. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/DEV.md +0 -0
  47. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/DOC.md +0 -0
  48. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/HOWTO.md +0 -0
  49. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/INTEGRATION.md +0 -0
  50. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/MANIFEST.in +0 -0
  51. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/PUBS.md +0 -0
  52. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/README.md +0 -0
  53. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/SPEC.md +0 -0
  54. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/TUTO.md +0 -0
  55. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/about.sh +0 -0
  56. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/container/.dockerignore +0 -0
  57. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/container/.gitignore +0 -0
  58. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/container/Containerfile +0 -0
  59. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/container/Makefile +0 -0
  60. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/container/README.md +0 -0
  61. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/container/jmc +0 -0
  62. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/README.md +0 -0
  63. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/__init__.py +0 -0
  64. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/analyze.py +0 -0
  65. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/clang.py +0 -0
  66. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/convert.py +0 -0
  67. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/clang_entry.c +0 -0
  68. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/clang_free.c +0 -0
  69. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/clang_init.c +0 -0
  70. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/clang_pcre2_fun.c +0 -0
  71. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/clang_re2_fun.c +0 -0
  72. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/java_free.java +0 -0
  73. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/java_init.java +0 -0
  74. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/javascript_exe.js +0 -0
  75. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/javascript_foot.js +0 -0
  76. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/javascript_free.js +0 -0
  77. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/javascript_head.js +0 -0
  78. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/javascript_init.js +0 -0
  79. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/javascript_main.js +0 -0
  80. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/jmc.pod +0 -0
  81. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/perl_exe.pl +0 -0
  82. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/perl_free.pl +0 -0
  83. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/perl_init.pl +0 -0
  84. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/perl_main.pl +0 -0
  85. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/plpgsql_entry.sql +0 -0
  86. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/python_entry.py +0 -0
  87. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/python_exe.py +0 -0
  88. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/python_free.py +0 -0
  89. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/python_init.py +0 -0
  90. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/data/python_main.py +0 -0
  91. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/export.py +0 -0
  92. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/irep.py +0 -0
  93. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/java.py +0 -0
  94. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/language.py +0 -0
  95. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/model.py +0 -0
  96. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/mtypes.py +0 -0
  97. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/objmerge.py +0 -0
  98. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/perl.py +0 -0
  99. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/plpgsql.py +0 -0
  100. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/python.py +0 -0
  101. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/recurse.py +0 -0
  102. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/resolver.py +0 -0
  103. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/Makefile +0 -0
  104. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/__init__.py +0 -0
  105. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/c/Makefile +0 -0
  106. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/c/json-model.c +0 -0
  107. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/c/json-model.h +0 -0
  108. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/c/main.c +0 -0
  109. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/java/.gitignore +0 -0
  110. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/java/Makefile +0 -0
  111. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/java/README.md +0 -0
  112. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/java/env.bash +0 -0
  113. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/java/json_model/Checker.java +0 -0
  114. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/java/json_model/GSON.java +0 -0
  115. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/java/json_model/JSON.java +0 -0
  116. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/java/json_model/JSONP.java +0 -0
  117. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/java/json_model/Jackson.java +0 -0
  118. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/java/json_model/Main.java +0 -0
  119. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/java/json_model/ModelChecker.java +0 -0
  120. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/java/json_model/Path.java +0 -0
  121. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/java/json_model/Report.java +0 -0
  122. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/java/json_model/Runtime.java +0 -0
  123. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/java/pom.xml +0 -0
  124. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/js/README.md +0 -0
  125. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/js/index.js +0 -0
  126. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/js/package.json +0 -0
  127. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/pl/.gitignore +0 -0
  128. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/pl/Changes +0 -0
  129. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/pl/LICENSE +0 -0
  130. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/pl/MANIFEST +0 -0
  131. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/pl/Makefile.PL +0 -0
  132. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/pl/README +0 -0
  133. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/pl/env.bash +0 -0
  134. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/pl/ignore.txt +0 -0
  135. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/pl/t/00-load.t +0 -0
  136. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/pl/t/manifest.t +0 -0
  137. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/pl/t/pod-coverage.t +0 -0
  138. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/pl/t/pod.t +0 -0
  139. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/pl/xt/boilerplate.t +0 -0
  140. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/sql/META.json +0 -0
  141. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/sql/Makefile +0 -0
  142. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/sql/json_model--2.0.sql +0 -0
  143. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/sql/json_model.control +0 -0
  144. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/support.py +0 -0
  145. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/runtime/types.py +0 -0
  146. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/url_cache.py +0 -0
  147. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model/utils.py +0 -0
  148. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model_compiler.egg-info/dependency_links.txt +0 -0
  149. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model_compiler.egg-info/entry_points.txt +0 -0
  150. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model_compiler.egg-info/requires.txt +0 -0
  151. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/json_model_compiler.egg-info/top_level.txt +0 -0
  152. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/ansiblelint-meta.model.json +0 -0
  153. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/cypress.model.json +0 -0
  154. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/diploma-arrete.model.json +0 -0
  155. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/diploma-export.model.json +0 -0
  156. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/everything.model.json +0 -0
  157. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/fresq.model.json +0 -0
  158. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/geo-easy.model.json +0 -0
  159. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/geo.model.json +0 -0
  160. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/jmc-ir.model.json +0 -0
  161. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-model-latest.model.json +0 -0
  162. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-model-moschin.model.json +0 -0
  163. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-model-no-merge.model.json +0 -0
  164. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-model-v1.model.json +0 -0
  165. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-model-v2-en.model.json +0 -0
  166. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-model-v2.model.json +0 -0
  167. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-model.model.json +0 -0
  168. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-01-fuzzy.model.json +0 -0
  169. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-01-nesting.model.json +0 -0
  170. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-01.model.json +0 -0
  171. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-02-fuzzy.model.json +0 -0
  172. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-02-nesting.model.json +0 -0
  173. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-02.model.json +0 -0
  174. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-03-fuzzy.model.json +0 -0
  175. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-03-nesting.model.json +0 -0
  176. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-03.model.json +0 -0
  177. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-04-fuzzy.model.json +0 -0
  178. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-04-mongodb.model.json +0 -0
  179. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-04-nesting.model.json +0 -0
  180. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-04.model.json +0 -0
  181. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-06-fuzzy.model.json +0 -0
  182. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-06.model.json +0 -0
  183. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-07-fuzzy.model.json +0 -0
  184. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-07.model.json +0 -0
  185. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-2019-09-fuzzy.model.json +0 -0
  186. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-2019-09.model.json +0 -0
  187. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-2020-12-fuzzy.model.json +0 -0
  188. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-2020-12-tight.model.json +0 -0
  189. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-2020-12.model.json +0 -0
  190. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-next-fuzzy.model.json +0 -0
  191. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-next.model.json +0 -0
  192. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-tight.model.json +0 -0
  193. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-tighter-loose.model.json +0 -0
  194. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-draft-tighter.model.json +0 -0
  195. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/json-schema-linter.model.json +0 -0
  196. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/jsound.model.json +0 -0
  197. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/l10n.model.json +0 -0
  198. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/lazygit.model.json +0 -0
  199. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/openapi-311-fuzzy.model.json +0 -0
  200. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/openapi-311-models.model.json +0 -0
  201. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/openapi-311.model.json +0 -0
  202. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/person.model.json +0 -0
  203. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/person2.model.json +0 -0
  204. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/pgxn.model.json +0 -0
  205. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/models/test-schema.model.json +0 -0
  206. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/package.json +0 -0
  207. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/setup.cfg +0 -0
  208. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/API.md +0 -0
  209. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/DEV.md +0 -0
  210. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/DOC.md +0 -0
  211. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/HOWTO.md +0 -0
  212. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/PUBS.md +0 -0
  213. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/README.md +0 -0
  214. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/SPEC.md +0 -0
  215. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/TUTO.md +0 -0
  216. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026020500.csv +0 -0
  217. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026020500.json +0 -0
  218. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026020500.md +0 -0
  219. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026020600.csv +0 -0
  220. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026020600.json +0 -0
  221. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026020600.md +0 -0
  222. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026021000.csv +0 -0
  223. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026021000.json +0 -0
  224. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026021000.md +0 -0
  225. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026021300.csv +0 -0
  226. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026021300.json +0 -0
  227. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026021300.md +0 -0
  228. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026021700.csv +0 -0
  229. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026021700.json +0 -0
  230. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026021700.md +0 -0
  231. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026021701.csv +0 -0
  232. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026021701.json +0 -0
  233. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026021701.md +0 -0
  234. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026021702.csv +0 -0
  235. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026021702.json +0 -0
  236. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026021702.md +0 -0
  237. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026021900.csv +0 -0
  238. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026021900.json +0 -0
  239. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026021900.md +0 -0
  240. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026022000.csv +0 -0
  241. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026022000.json +0 -0
  242. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026022000.md +0 -0
  243. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026022400.csv +0 -0
  244. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026022400.json +0 -0
  245. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026022400.md +0 -0
  246. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026030700.csv +0 -0
  247. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026030700.json +0 -0
  248. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026030700.md +0 -0
  249. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026030703.csv +0 -0
  250. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026030703.json +0 -0
  251. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026030703.md +0 -0
  252. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026030901.csv +0 -0
  253. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026030901.json +0 -0
  254. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026030901.md +0 -0
  255. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026031000.csv +0 -0
  256. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026031000.json +0 -0
  257. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/benchmarks/2026031000.md +0 -0
  258. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/cover.md +0 -0
  259. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/favicon.ico +0 -0
  260. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/index.html +0 -0
  261. {json_model_compiler-2.0b40 → json_model_compiler-2.0b41}/site/json_logo.svg +0 -0
@@ -2,11 +2,13 @@
2
2
 
3
3
  ## Current Tasks
4
4
 
5
- - [x] c-backend: use monotonic instead of realtime clock which has a better precision
6
- - [x] java-backend: fix previously untested `--jsonschema-benchmark` implementation
5
+ - [x] optim: do not recheck object if not necessary
6
+ - [x] command: show runtime directory with `--runtime`
7
+ - [x] optim: better merge `&` list when possible, including regex prefix incompatibilities
8
+ - [x] js-backend: export model map
9
+ - [x] pl-backend: add and export `_mapper` function
7
10
  - [ ] optim: simplify _(x ^ M) & (x | T)_ where _M in T_
8
11
  - [ ] optim: recognize typed not: _"" ^ "xxx"_
9
- - [ ] optim: merge `&` list when possible, eg inclusions or compatibility
10
12
  - [ ] backend: implement new predefs with IP4, IP6, HOSTNAME, JSONPT, DURATION (just with regex?)
11
13
  - [ ] \*-backend: add support for embedded nul characters in strings, when possible, or fail gracefully
12
14
  - [ ] doc: add _known limitations_ stuff
@@ -792,3 +794,5 @@
792
794
  - [x] ir: fix bad elimination when bool var was used
793
795
  - [x] ir: add bool var assign elimination on return with only one use
794
796
  - [x] c-backend: fix long option parsing
797
+ - [x] c-backend: use monotonic instead of realtime clock which has a better precision
798
+ - [x] java-backend: fix previously untested `--jsonschema-benchmark` implementation
@@ -9,6 +9,7 @@ schema to model converter in C, JS, Java (GSON, Jackson and JSONP using Johnzon)
9
9
 
10
10
  ## Recent Artifacts
11
11
 
12
+ - [2026031300](benchmarks/2026031300.md) clang, no predefs, jsu 0.9.1/jmc 2.0b40 vs sbc 14.14.2, 11 runs, 1000 iterations.
12
13
  - [2026031000](benchmarks/2026031000.md) clang, no predefs, jsu 0.9.1/jmc 2.0b39 vs sbc 14.14.2, 11 runs, 1000 iterations.
13
14
  - [2026030901](benchmarks/2026030901.md) clang, no predefs, jsu 0.9.1/jmc 2.0b38 vs sbc 14.14.2, 11 runs, 1000 iterations.
14
15
  - [2026030703](benchmarks/2026030703.md) clang, no predefs, jmc 2.0b37 vs sbc 14.14.2, 11 runs, 1000 iterations.
@@ -23,13 +24,6 @@ schema to model converter in C, JS, Java (GSON, Jackson and JSONP using Johnzon)
23
24
  - [2026021000](benchmarks/2026021000.md) clang, no predefs, jmc 2.0b36 vs sbc 14.7.2, 11 runs, 1000 iterations.
24
25
  - [2026020600](benchmarks/2026020600.md) clang, no predefs, jmc 2.0b36 vs sbc 14.7.1, 11 runs, 1000 iterations.
25
26
  - [2026020500](benchmarks/2026020500.md) clang, no predefs, jmc 2.0b36 vs sbc 14.6.1, 11 runs, 1000 iterations.
26
- - [2026012700](benchmarks/2026012700.md) clang, no predefs, jmc 2.0b36 vs sbc 14.5.0, 11 runs, 1000 iterations.
27
- - [2026012400](benchmarks/2026012400.md) clang, no predefs, jmc 2.0b36 vs sbc 14.4.0, 11 runs, 1000 iterations.
28
- - [2026012200](benchmarks/2026012200.md) clang, no predefs, jmc 2.0b36 vs sbc 14.2.0, 11 runs, 1000 iterations.
29
- - [2026012000](benchmarks/2026012000.md) clang, no predefs, jmc 2.0b36 vs sbc 14.1.0, 11 runs, 1000 iterations.
30
- - [2026011500](benchmarks/2026011500.md) clang, no predefs, jmc 2.0b36 vs sbc 14.0.4, 11 runs, 1000 iterations.
31
- - [2026010900](benchmarks/2026010900.md) clang, no predefs, jmc 2.0b36 vs sbc 14.0.3, 11 runs, 1000 iterations.
32
- - [2026010600](benchmarks/2026010600.md) clang, no predefs, jmc 2.0b36 vs sbc 14.0.2, 11 runs, 1000 iterations.
33
27
 
34
28
  ## Benchmarking Script
35
29
 
@@ -7,15 +7,34 @@ ifndef PYTHON
7
7
  PYTHON = python
8
8
  endif
9
9
 
10
- venv:
10
+ venv: venv/.init
11
+
12
+ venv/.init:
11
13
  $(PYTHON) -m venv venv
12
14
  source venv/bin/activate
13
15
  pip install -U pip
16
+ pip install -e .
17
+ touch $@
18
+
19
+ venv/.dev: venv/.init
14
20
  pip install -e .[dev]
21
+ touch $@
22
+
23
+ venv/.dist: venv/.dev
24
+ pip install -e .[dist]
25
+ touch $@
15
26
 
16
27
  .PHONY: dev
17
- dev: venv
28
+ dev: venv/.dev dev.js dev.java
29
+
30
+ .PHONY: dev.js
31
+ dev.js: node_modules
32
+
33
+ node_modules:
18
34
  npm install
35
+
36
+ .PHONY: dev.java
37
+ dev.java:
19
38
  $(MAKE) -C json_model/runtime/java jar
20
39
 
21
40
  .PHONY: clean
@@ -112,7 +131,7 @@ publish.site: build.site
112
131
  ssh $(SITE) chmod a+r $(SITEPATH)/* $(SITEPATH)/models/* $(SITEPATH)/benchmarks/*
113
132
 
114
133
  .PHONY: publish.py
115
- publish.py: dev
134
+ publish.py: venv/.dist
116
135
  source venv/bin/activate
117
136
  python -m build
118
137
  twine check dist/*
@@ -139,12 +158,12 @@ publish.perl:
139
158
  # $(RM) $(RT.dir)/pl/Makefile.old
140
159
 
141
160
  .PHONY: publish.js
142
- publish.js:
161
+ publish.js: dev.js
143
162
  npm publish --dry-run $(RT.dir)/js
144
163
  echo npm publish --access public --tag latest $(RT.dir)/js
145
164
 
146
165
  .PHONY: publish.java
147
- publish.java:
166
+ publish.java: dev.java
148
167
  $(MAKE) -C $(RT.dir)/java zip
149
168
  # see https://central.sonatype.org/publish/requirements/
150
169
  # upload zip on https://central.sonatype.com/publishing as org.json-model:json-model:VERSION
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: json_model_compiler
3
- Version: 2.0b40
3
+ Version: 2.0b41
4
4
  Summary: JSON Model Tools
5
5
  Author: Fabien Coelho, Claire Yannou-Medrala
6
6
  License-Expression: CC0-1.0
@@ -1,3 +1,10 @@
1
+ sub CHECK_FUNCTION_NAME_mapper($)
2
+ {
3
+ my ($name) = @_;
4
+ die "unexpected model name \"$name\"" unless exists $CHECK_FUNCTION_NAME_map{$name};
5
+ return $CHECK_FUNCTION_NAME_map{$name};
6
+ }
7
+
1
8
  sub CHECK_FUNCTION_NAME($$$)
2
9
  {
3
10
  my ($json, $name, $rep) = @_;
@@ -3,7 +3,7 @@ use Exporter 'import';
3
3
  our @ISA = qw( Exporter );
4
4
  our @EXPORT = qw(
5
5
  CHECK_FUNCTION_NAME_init
6
- CHECK_FUNCTION_NAME_map
6
+ CHECK_FUNCTION_NAME_mapper
7
7
  CHECK_FUNCTION_NAME
8
8
  CHECK_FUNCTION_NAME_free
9
9
  );
@@ -281,7 +281,8 @@ class JavaScript(Language):
281
281
  # Property Map
282
282
  #
283
283
  def def_pmap(self, name: str, pmap: PropMap, public: bool) -> Block:
284
- return [ f"var {name} = new Map()" ]
284
+ export = "export " if public else ""
285
+ return [ f"{export}var {name} = new Map()" ]
285
286
 
286
287
  def ini_pmap(self, name: str, pmap: PropMap, public: bool) -> Block:
287
288
  return [ f"{name}.set({self.esc(p)}, {f})" for p, f in pmap.items() ]
@@ -1,6 +1,7 @@
1
1
  #
2
2
  # Model Optimizations
3
3
  #
4
+ import re
4
5
  from .mtypes import ModelPath, ModelType
5
6
  from .utils import log, is_cst, _structurally_distinct_models, model_type, is_base_model
6
7
  from .utils import constant_values, same_model, model_eq
@@ -53,35 +54,6 @@ def normalizeModels(models: list[ModelType]) -> int:
53
54
 
54
55
  return changes
55
56
 
56
- def _simple_open_object(model: ModelType, jm: JsonModel, path: ModelPath) -> list[str]|None:
57
- """Detect simple may/must open objects, return property names."""
58
- if jm._isRef(model):
59
- model = jm.resolveRef(model, path)._model
60
- if isinstance(model, dict):
61
- props, is_open = [], False
62
- for prop in model.keys():
63
- assert isinstance(prop, str)
64
- if prop == "":
65
- is_open = model[""] == "$ANY"
66
- if not is_open:
67
- return None
68
- elif prop in ("$", "%", "~") or prop[0] == "#":
69
- pass
70
- elif prop[0] in ("$", "/"):
71
- return None
72
- elif prop[0] in ("?", "_", "!"):
73
- name = prop[1:]
74
- if name in props: # not safe?
75
- return None
76
- props.append(name)
77
- else:
78
- if prop in props: # not safe?
79
- return None
80
- props.append(prop)
81
- return props if is_open else None
82
- else:
83
- return None
84
-
85
57
  def and_not_simpler(jm: JsonModel) -> bool:
86
58
  """Change and(T, xor(ANY, …)) to xor(T, and(T, …))."""
87
59
  # this does not generalize, the idea is to forward the type to both sides
@@ -131,6 +103,77 @@ def and_not_simpler(jm: JsonModel) -> bool:
131
103
  log.debug(f"{jm._id}: ans {changes}")
132
104
  return changes > 0
133
105
 
106
+ def _simple_open_object(model: ModelType, jm: JsonModel, path: ModelPath) -> list[str]|None:
107
+ """Detect simple may/must/regs open objects, return property names and regs."""
108
+ if jm._isRef(model):
109
+ model = jm.resolveRef(model, path)._model
110
+ if isinstance(model, dict):
111
+ props, is_open = [], False
112
+ for prop in model.keys():
113
+ assert isinstance(prop, str)
114
+ if prop == "":
115
+ is_open = model[""] == "$ANY"
116
+ # NOTE it could also be partially open…
117
+ if not is_open:
118
+ return None
119
+ elif prop in ("$", "%", "~") or prop[0] == "#":
120
+ pass
121
+ elif prop[0] == "$":
122
+ # TODO follow definition!
123
+ return None
124
+ elif prop[0] == "/":
125
+ props.append(prop)
126
+ elif prop[0] in ("?", "_", "!"):
127
+ name = "_" + prop[1:]
128
+ if name in props: # not safe?
129
+ return None
130
+ props.append(name)
131
+ else:
132
+ name = "_" + prop
133
+ if name in props: # not safe?
134
+ return None
135
+ props.append(name)
136
+ return props if is_open else None
137
+ else:
138
+ return None
139
+
140
+ def _prefix_reg(reg: str) -> str|None:
141
+ """Prefix of simple prefix regex."""
142
+ # FIXME must handle ignore-case option
143
+ m = re.match(r"/\^([-_A-Za-z0-9]+)", reg)
144
+ return m.group(1) if m else None
145
+
146
+ def _bad_regs(lobj: list[list[str]|None]) -> set[str]:
147
+ """Identify regs which cannot be merged, based on prefix compatibilities."""
148
+ # NOTE we could check only with regs with props from **other** objects
149
+ all_props, all_regs, bad_regs = set(), set(), set()
150
+ for lp in lobj:
151
+ if lp is not None:
152
+ assert isinstance(lp, list)
153
+ all_props.update(filter(lambda s: s[0] == "_", lp))
154
+ all_regs.update(filter(lambda s: s[0] == "/", lp))
155
+ # drop leading "_"
156
+ all_props = { s[1:] for s in all_props }
157
+ prefixes = {}
158
+ for r in all_regs:
159
+ # regex incompatibilities between themselves
160
+ prefix = _prefix_reg(r)
161
+ if prefix is None:
162
+ bad_regs.add(r)
163
+ continue
164
+ # check for prefix inclusions, including ==
165
+ for p, pr in prefixes.items():
166
+ if prefix.startswith(p) or p.startswith(prefix):
167
+ bad_regs.add(r)
168
+ bad_regs.add(pr)
169
+ prefixes[prefix] = r
170
+ # rough regex incompatibilities with properties
171
+ for p in all_props:
172
+ if p.startswith(prefix):
173
+ bad_regs.add(r)
174
+ # log.debug(f"bad_regs={bad_regs}")
175
+ return bad_regs
176
+
134
177
  def and_to_merge(jm: JsonModel) -> bool:
135
178
  """Change and to less costly merge if possible."""
136
179
 
@@ -142,19 +185,43 @@ def and_to_merge(jm: JsonModel) -> bool:
142
185
  land = model["&"]
143
186
  assert isinstance(land, list)
144
187
  lobj: list[list[str]|None] = list(map(lambda i: _simple_open_object(i, jm, path), land))
145
- if all(map(lambda i: i is not None, lobj)):
146
- # property intersection
147
- sprops, nprops = set(), 0
148
- for lp in lobj:
149
- nprops += len(lp)
150
- sprops.update(lp)
151
- if nprops == len(sprops):
152
- # no property intersection, change is safe
153
- # TODO it is also ok if values are compatible
154
- changes += 1
155
- model["+"] = land
188
+ # subset of mergeables
189
+ n_merges = sum(map(lambda i: 1 if i is not None else 0, lobj))
190
+ if n_merges <= 1:
191
+ return model
192
+ # else something to try
193
+ # FIXME for now partial merges may fail
194
+ sprops, nprops, sregs, nregs, move = set(), 0, set(), 0, []
195
+ # regular expressions to skip
196
+ bad_regs = _bad_regs(lobj)
197
+ for i, lp in enumerate(lobj):
198
+ if lp is not None:
199
+ props = list(filter(lambda s: s[0] == "_", lp))
200
+ regs = list(filter(lambda s: s[0] == "/", lp))
201
+ # skip objects with a bad regular expression for merging
202
+ if any(filter(lambda r: r in bad_regs, regs)):
203
+ # skip object
204
+ continue
205
+ # else let us accumulate
206
+ nprops += len(props)
207
+ sprops.update(props)
208
+ nregs += len(regs)
209
+ sregs.update(regs)
210
+ move.append(i)
211
+ # log.debug(f"move={move} sprops={sprops} sregs={sregs}")
212
+ # no property intersection, change is safe
213
+ if len(move) > 1 and nprops == len(sprops) and nregs == len(sregs):
214
+ # FIXME the generated merge may fail, which may denote an unfeasible model?
215
+ changes += 1
216
+ merge = [ land[i] for i in move ]
217
+ for i in reversed(move):
218
+ land.pop(i)
219
+ if len(land) == 0:
156
220
  del model["&"]
157
- # else property collision, probably not safe
221
+ model["+"] = merge
222
+ else:
223
+ land.append({"+": merge})
224
+ # else property collision, probably not safe
158
225
  return model
159
226
 
160
227
  jm._model = recModel(jm._model, builtFlt, a2mRwt)
@@ -78,7 +78,7 @@ function jsonschema_benchmark(values, checker, times)
78
78
  const WARMUP_ITERATIONS = 1000 // unless too long
79
79
  const max_iterations = Math.ceil(WARMUP_MAX_TIME * 1000.0 / cold_delay)
80
80
  const warmup_iterations = Math.min(WARMUP_ITERATIONS, max_iterations)
81
- console.error(`warmup iterations: ${warmup_iterations}`)
81
+ // console.error(`warmup iterations: ${warmup_iterations}`)
82
82
  for (let i = 0; i < warmup_iterations; i++)
83
83
  for (const v of values)
84
84
  checker(v, '', null)
@@ -10,7 +10,7 @@ use warnings;
10
10
 
11
11
  # no Carp, this modules runs with automatically generated code, all issues are ours?
12
12
 
13
- our $VERSION = 1.999012; # aka 2.0b12
13
+ our $VERSION = 1.999038; # aka 2.0b38
14
14
 
15
15
  eval "use re::engine::RE2"; # try to replace regex engine
16
16
  use List::Util qw( min );
@@ -286,6 +286,7 @@ def jmc_script():
286
286
  arg("--doc", choices=["pod", "syn", "help", "man"], default=None,
287
287
  help="show documentation and exit")
288
288
  arg("--man", dest="doc", action="store_const", const="man", help="show man page")
289
+ arg("--runtime", default=False, action="store_true", help="show runtime source directory")
289
290
 
290
291
  # verbosity and checks
291
292
  arg("--version", action="store_true", help="show current version and exit")
@@ -464,6 +465,10 @@ def jmc_script():
464
465
  print(pkg_version("json_model_compiler"))
465
466
  sys.exit(0)
466
467
 
468
+ if args.runtime:
469
+ print(files("json_model.runtime"))
470
+ sys.exit(0)
471
+
467
472
  # POD - Plain Old Documentation
468
473
  if args.doc:
469
474
  # Python does not provide any help to write man pages for the user
@@ -446,8 +446,10 @@ class CodeGenerator:
446
446
 
447
447
  return code
448
448
 
449
- def _disjunction(self, jm: JsonModel, model: ModelType, mpath: ModelPath,
450
- res: str, val: str, vpath: str, known: set[str]|None) -> Block|None:
449
+ def _disjunction(
450
+ self, jm: JsonModel, model: ModelType, mpath: ModelPath,
451
+ res: str, val: str, vpath: str, known: set[BoolExpr]|None = None,
452
+ ) -> Block|None:
451
453
  """Generate optimized disjunction check, return None if failed."""
452
454
 
453
455
  assert isinstance(model, dict) and "|" in model and isinstance(model["|"], list)
@@ -641,26 +643,37 @@ class CodeGenerator:
641
643
 
642
644
  self._code.pmap(name, prop_map)
643
645
 
644
- # TODO known?
645
646
  def _closeMuObject(
646
647
  self, jm: JsonModel, must: dict[str, ModelType],
647
648
  mpath: ModelPath, oname: str,
648
- res: Var, val: JsonExpr, vpath: PathExpr
649
+ res: Var, val: JsonExpr, vpath: PathExpr,
650
+ known: set[BoolExpr]|None = None,
649
651
  ) -> Block:
650
652
  """Optimize `{"x": ..., "": "y": ...}`."""
651
653
 
652
654
  assert isinstance(must, dict)
653
655
  gen = self._lang
654
656
  smpath = json_path(mpath)
657
+ if known is None:
658
+ known = set()
655
659
 
656
- code = (
657
- gen.lcom("check close must only props") +
660
+ code = gen.lcom("check close must only props")
661
+
662
+ obj_test = gen.is_a(val, dict)
663
+ if obj_test not in known:
658
664
  # filter non object
659
- gen.if_stmt(gen.not_op(gen.is_a(val, dict)),
660
- self._gen_fail(f"not an object [{smpath}]", vpath),
661
- likely=False) +
662
- # filter ahead on the number of properties
663
- # NOTE necessary to detect unexpected misc property as the object is not scanned
665
+ code += (
666
+ gen.if_stmt(gen.not_op(obj_test),
667
+ self._gen_fail(f"not an object [{smpath}]", vpath),
668
+ likely=False)
669
+ )
670
+ known = known | {obj_test}
671
+ else:
672
+ code += gen.lcom("value known to be an object")
673
+
674
+ # filter ahead on the number of properties
675
+ # NOTE necessary to detect unexpected misc property as the object is not scanned
676
+ code += (
664
677
  gen.if_stmt(gen.num_cmp(gen.obj_len(val), "!=", gen.const(len(must)), is_int=True),
665
678
  self._gen_fail(f"bad property count [{smpath}]", vpath),
666
679
  likely=False)
@@ -709,21 +722,32 @@ class CodeGenerator:
709
722
 
710
723
  # TODO known?
711
724
  # TODO fix vpath
712
- def _openMuMaObject(self, jm: JsonModel, must: dict[str, ModelType], may: dict[str, ModelType],
713
- mpath: ModelPath, oname: str,
714
- res: Var, val: JsonExpr, vpath: PathExpr) -> Block:
725
+ def _openMuMaObject(
726
+ self, jm: JsonModel, must: dict[str, ModelType], may: dict[str, ModelType],
727
+ mpath: ModelPath, oname: str,
728
+ res: Var, val: JsonExpr, vpath: PathExpr,
729
+ known: set[BoolExpr]|None = None,
730
+ ) -> Block:
715
731
  """Optimize `{"x": ..., "": "?y": ..., "": "$ANY"}`."""
716
732
 
717
733
  assert isinstance(must, dict)
718
734
  gen = self._lang
719
735
  smpath = json_path(mpath)
736
+ if known is None:
737
+ known = set()
720
738
 
721
- code = (
722
- gen.lcom("check open must/may only props") +
723
- gen.if_stmt(gen.not_op(gen.is_a(val, dict)),
724
- self._gen_fail(f"not an object [{smpath}]", vpath),
725
- likely=False)
726
- )
739
+ code = gen.lcom("check open must/may only props")
740
+
741
+ obj_test = gen.is_a(val, dict)
742
+ if obj_test not in known:
743
+ code += (
744
+ gen.if_stmt(gen.not_op(obj_test),
745
+ self._gen_fail(f"not an object [{smpath}]", vpath),
746
+ likely=False)
747
+ )
748
+ known = known | {obj_test}
749
+ else:
750
+ code += gen.lcom("value known to be an object")
727
751
 
728
752
  # value checks?
729
753
  if any(m != "$ANY" for m in must.values()) or any(m != "$ANY" for m in may.values()):
@@ -792,8 +816,11 @@ class CodeGenerator:
792
816
 
793
817
  return code + gen.ret(gen.true())
794
818
 
795
- def _compileObject(self, jm: JsonModel, model: ModelType, mpath: ModelPath,
796
- oname: str, res: str, val: JsonExpr, vpath: PathExpr) -> Block:
819
+ def _compileObject(
820
+ self, jm: JsonModel, model: ModelType, mpath: ModelPath,
821
+ oname: str, res: str, val: JsonExpr, vpath: PathExpr,
822
+ known: set[BoolExpr]|None = None,
823
+ ) -> Block:
797
824
  """Generate the body of a function which checks an actual object."""
798
825
 
799
826
  assert isinstance(model, dict)
@@ -803,6 +830,20 @@ class CodeGenerator:
803
830
  must, may, defs, regs, oth = split_object(model, mpath)
804
831
  smpath = json_path(mpath)
805
832
 
833
+ # shortcut for open object with simple props only
834
+ # TODO accept any other prop?
835
+ if not defs and not regs and (must or may) and oth == {"": "$ANY"}:
836
+ # if there are many may values, this may be too costly…
837
+ # # if (len(may) / (len(must) + len(may)) < self._may_must_open_ratio or
838
+ if (len(must) + len(may)) <= self._may_must_open_threshold:
839
+ return self._openMuMaObject(jm, must, may, mpath, oname, res, val, vpath, known)
840
+
841
+ # shortcut for must-only close object
842
+ # NOTE we assume that this strategy is always beneficial, but it may depend on the target
843
+ if must and not may and not defs and not regs and not oth and \
844
+ len(must) <= self._must_only_threshold:
845
+ return self._closeMuObject(jm, must, mpath, oname, res, val, vpath, known)
846
+
806
847
  # generated code helpers
807
848
  code: Block = []
808
849
  body_code: Block = []
@@ -810,9 +851,14 @@ class CodeGenerator:
810
851
  prop, pval, must_c, pfun = "prop", "pval", "must_count", "pfun"
811
852
 
812
853
  # should be an object
813
- code += gen.if_stmt(gen.not_op(gen.is_a(val, dict)),
814
- self._gen_fail(f"not an object [{smpath}]", vpath),
815
- likely=False)
854
+ obj_test = gen.is_a(val, dict)
855
+ if obj_test not in known:
856
+ code += gen.if_stmt(gen.not_op(obj_test),
857
+ self._gen_fail(f"not an object [{smpath}]", vpath),
858
+ likely=False)
859
+ known = known | {obj_test}
860
+ else:
861
+ code += gen.lcom("value known to be an object")
816
862
 
817
863
  # NOTE there may be different tradeoffs depending on the target languages,
818
864
  # libraries and the complexity of underlying operations.
@@ -835,19 +881,6 @@ class CodeGenerator:
835
881
  return code
836
882
  # only check values, fine code will be generated below
837
883
 
838
- # shortcut for open object with simple props only
839
- # TODO accept any other prop?
840
- if not defs and not regs and (must or may) and oth == {"": "$ANY"}:
841
- # if there are many may values, this may be too costly…
842
- # # if (len(may) / (len(must) + len(may)) < self._may_must_open_ratio or
843
- if (len(must) + len(may)) <= self._may_must_open_threshold:
844
- return self._openMuMaObject(jm, must, may, mpath, oname, res, val, vpath)
845
-
846
- # shortcut for must-only close object
847
- # NOTE we assume that this strategy is always beneficial, but it may depend on the target
848
- if must and not may and not defs and not regs and not oth and \
849
- len(must) <= self._must_only_threshold:
850
- return self._closeMuObject(jm, must, mpath, oname, res, val, vpath)
851
884
 
852
885
  # used for evaluating likely-ness
853
886
  expected_nprops = (
@@ -1196,8 +1229,11 @@ class CodeGenerator:
1196
1229
  # ok!
1197
1230
  return model, mtype, im
1198
1231
 
1199
- def _compileOr(self, jm: JsonModel, models: ModelArray, mpath: ModelPath,
1200
- res: str, val: str, vpath: str, known: set[BoolExpr]|None = None) -> Block:
1232
+ def _compileOr(
1233
+ self, jm: JsonModel, models: ModelArray, mpath: ModelPath,
1234
+ res: str, val: str, vpath: str,
1235
+ known: set[BoolExpr]|None = None,
1236
+ ) -> Block:
1201
1237
  """Compile a general or-list of models."""
1202
1238
 
1203
1239
  code = []
@@ -1366,8 +1402,11 @@ class CodeGenerator:
1366
1402
 
1367
1403
  return code
1368
1404
 
1369
- def _compileXor(self, jm: JsonModel, models: ModelArray, mpath: ModelPath,
1370
- res: str, val: str, vpath: str, known: set[BoolExpr]|None = None) -> Block:
1405
+ def _compileXor(
1406
+ self, jm: JsonModel, models: ModelArray, mpath: ModelPath,
1407
+ res: str, val: str, vpath: str,
1408
+ known: set[BoolExpr]|None = None
1409
+ ) -> Block:
1371
1410
  """Compile a xor-list of models."""
1372
1411
 
1373
1412
  assert isinstance(models, list) # pyright hint
@@ -1493,9 +1532,11 @@ class CodeGenerator:
1493
1532
 
1494
1533
  return code
1495
1534
 
1496
- def _compileAnd(self, jm: JsonModel, models: ModelArray, mpath: ModelPath,
1497
- res: Var, val: JsonExpr, vpath: PathExpr,
1498
- known: set[BoolExpr]|None = None) -> Block:
1535
+ def _compileAnd(
1536
+ self, jm: JsonModel, models: ModelArray, mpath: ModelPath,
1537
+ res: Var, val: JsonExpr, vpath: PathExpr,
1538
+ known: set[BoolExpr]|None = None,
1539
+ ) -> Block:
1499
1540
  """Compile an and-list of models."""
1500
1541
 
1501
1542
  assert isinstance(models, list) # pyright hint
@@ -1532,16 +1573,19 @@ class CodeGenerator:
1532
1573
 
1533
1574
  return code
1534
1575
 
1535
- def _compileModel(self, jm: JsonModel, model: ModelType, mpath: ModelPath,
1536
- res: str, val: str, vpath: str, known: set[BoolExpr]|None = None,
1537
- constrained: bool = False, name: str|None = None) -> Block:
1576
+ def _compileModel(
1577
+ self, jm: JsonModel, model: ModelType, mpath: ModelPath,
1578
+ res: str, val: str, vpath: str,
1579
+ known: set[BoolExpr]|None = None,
1580
+ constrained: bool = False, name: str|None = None,
1581
+ ) -> Block:
1538
1582
  # TODO break each level into a separate function and let the compiler inline
1539
- # known = expression already verified
1540
- log.debug(f"mpath={mpath} model={model} res={res} val={val} vpath={vpath}")
1583
+ log.debug(f"mpath={mpath} model={model} res={res} val={val} vpath={vpath} known={known}")
1541
1584
  assert isinstance(mpath, list)
1542
1585
  smpath = json_path(mpath)
1543
1586
  gen = self._lang
1544
- known = known or set()
1587
+ if known is None:
1588
+ known = set()
1545
1589
 
1546
1590
  code = gen.lcom(f"{json_path(mpath)}")
1547
1591
  match model:
@@ -1561,7 +1605,7 @@ class CodeGenerator:
1561
1605
  if model == -1:
1562
1606
  if known is not None:
1563
1607
  if expr is not None:
1564
- known.add(expr)
1608
+ known = known | {expr}
1565
1609
  if not expr:
1566
1610
  expr = gen.true()
1567
1611
  elif model == 0:
@@ -1592,7 +1636,7 @@ class CodeGenerator:
1592
1636
  if model == -1.0:
1593
1637
  if known is not None:
1594
1638
  if expr is not None:
1595
- known.add(expr)
1639
+ known = known | {expr}
1596
1640
  if not expr:
1597
1641
  expr = gen.true()
1598
1642
  elif model == 0.0:
@@ -1623,7 +1667,7 @@ class CodeGenerator:
1623
1667
  if model == "":
1624
1668
  if known is not None:
1625
1669
  if expr is not None:
1626
- known.add(expr)
1670
+ known = known | {expr}
1627
1671
  code += gen.bool_var(res, expr if expr else gen.true())
1628
1672
  elif model[0] == "_":
1629
1673
  compare = gen.str_cmp(gen.value(val, str), "=", # type: ignore
@@ -1692,7 +1736,7 @@ class CodeGenerator:
1692
1736
  if expr in known:
1693
1737
  expr = None
1694
1738
  if expr is not None:
1695
- known.add(expr)
1739
+ known = known | {expr}
1696
1740
 
1697
1741
  if len(model) == 0: # []
1698
1742
  length = gen.num_cmp(gen.arr_len(val), "=", gen.const(0), is_int=True)
@@ -1808,13 +1852,13 @@ class CodeGenerator:
1808
1852
  else:
1809
1853
  if name:
1810
1854
  objid = name
1811
- code += self._compileObject(jm, model, mpath, name, res, val, vpath)
1855
+ code += self._compileObject(jm, model, mpath, name, res, val, vpath, known)
1812
1856
  else:
1813
1857
  # new function to check the object
1814
1858
  objid = gen.ident(self._prefix + "obj")
1815
1859
  self._code.sub(
1816
1860
  objid,
1817
- self._compileObject(jm, model, mpath, objid, "res", "val", "path"),
1861
+ self._compileObject(jm, model, mpath, objid, "res", "val", "path", known),
1818
1862
  comment=f"object {json_path(mpath)}",
1819
1863
  inline=True
1820
1864
  )