json-model-compiler 2.0.60__tar.gz → 2.0.61__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.
- {json_model_compiler-2.0.60/json_model_compiler.egg-info → json_model_compiler-2.0.61}/PKG-INFO +1 -1
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/VERSION.md +5 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/analyze.py +9 -3
- json_model_compiler-2.0.61/json_model/data/VERSION +1 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/jmc.pod +4 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/irep.py +20 -2
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/script.py +23 -16
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61/json_model_compiler.egg-info}/PKG-INFO +1 -1
- json_model_compiler-2.0.60/json_model/data/VERSION +0 -1
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/.github/workflows/docs.yml +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/.github/workflows/sanity.yml +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/.gitignore +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/.gitmodules +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/API.md +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/BACKLOG.md +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/BENCH.md +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/DESIGN.md +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/DEV.md +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/DOC.md +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/HOWTO.md +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/INTEGRATION.md +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/MANIFEST.in +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/Makefile +3 -3
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/PUBS.md +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/README.md +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/SPEC.md +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/TUTO.md +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/about.sh +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/bench.sh +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/README.md +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/__init__.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/clang.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/convert.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/clang_entry.c +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/clang_free.c +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/clang_init.c +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/clang_pcre2_fun.c +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/clang_re2_fun.c +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/java_free.java +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/java_init.java +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/javascript_exe.js +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/javascript_foot.js +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/javascript_free.js +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/javascript_head.js +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/javascript_init.js +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/javascript_main.js +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/perl_entry.pl +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/perl_exe.pl +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/perl_free.pl +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/perl_init.pl +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/perl_main.pl +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/perl_pkg.pl +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/plpgsql_entry.sql +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/python_entry.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/python_exe.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/python_free.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/python_init.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/python_main.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/export.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/java.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/javascript.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/language.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/model.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/mtypes.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/objops.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/optim.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/perl.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/plpgsql.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/predefs.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/python.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/recurse.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/regex.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/resolver.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/Makefile +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/__init__.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/c/Makefile +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/c/json-model.c +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/c/json-model.h +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/c/main.c +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/java/.gitignore +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/java/Makefile +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/java/README.md +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/java/env.sh +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/java/json_model/Checker.java +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/java/json_model/GSON.java +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/java/json_model/JSON.java +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/java/json_model/JSONP.java +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/java/json_model/Jackson.java +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/java/json_model/Main.java +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/java/json_model/ModelChecker.java +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/java/json_model/Path.java +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/java/json_model/Report.java +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/java/json_model/Runtime.java +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/java/pom.xml +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/js/README.md +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/js/index.js +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/js/main.js +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/js/package.json +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/pl/.gitignore +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/pl/Changes +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/pl/LICENSE +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/pl/MANIFEST +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/pl/Makefile.PL +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/pl/README +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/pl/env.sh +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/pl/ignore.txt +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/pl/lib/JSON/JsonModel.pm +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/pl/t/00-load.t +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/pl/t/manifest.t +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/pl/t/pod-coverage.t +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/pl/t/pod.t +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/pl/xt/boilerplate.t +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/sql/META.json +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/sql/Makefile +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/sql/json_model--2.0.sql +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/sql/json_model.control +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/support.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/types.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/submodel.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/ts_export.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/url_cache.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/utils.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/xstatic.py +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model_compiler.egg-info/SOURCES.txt +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model_compiler.egg-info/dependency_links.txt +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model_compiler.egg-info/entry_points.txt +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model_compiler.egg-info/not-zip-safe +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model_compiler.egg-info/requires.txt +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model_compiler.egg-info/top_level.txt +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/package.json +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/pyproject.toml +0 -0
- {json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/setup.cfg +0 -0
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# JSON Model Compiler Versions
|
|
2
2
|
|
|
3
|
+
## 2.0.61 on 2026-09-18
|
|
4
|
+
|
|
5
|
+
- ir: ensure that a nope is kept when optimizing sequences
|
|
6
|
+
- front: allow to accept all-caps definitions with `--no-caps`
|
|
7
|
+
|
|
3
8
|
## 2.0.60 on 2026-09-15
|
|
4
9
|
|
|
5
10
|
- pr: jm site added to [awesome docsify](https://github.com/docsifyjs/awesome-docsify/commit/3950ece64978f41294463e1a2b12e809c65a6379)
|
|
@@ -65,7 +65,12 @@ def check(jm: JsonModel, assertion: ModelFilter, what: str = "?", short: bool =
|
|
|
65
65
|
return okay
|
|
66
66
|
|
|
67
67
|
# FIXME must tell why it is unhappy!
|
|
68
|
-
def valid(jm: JsonModel,
|
|
68
|
+
def valid(jm: JsonModel,
|
|
69
|
+
path: ModelPath = [],
|
|
70
|
+
root: bool = True, # expect a root model (start recursion)
|
|
71
|
+
extend: bool = False, # allow model extensions (.mo, .in)
|
|
72
|
+
caps: bool = True, # all-caps defs are rejected
|
|
73
|
+
) -> bool:
|
|
69
74
|
"""Check JSON Model structural (and slightly more) validity."""
|
|
70
75
|
|
|
71
76
|
is_valid = True
|
|
@@ -195,8 +200,9 @@ def valid(jm: JsonModel, path: ModelPath = [], root: bool = True, extend: bool =
|
|
|
195
200
|
|
|
196
201
|
try:
|
|
197
202
|
for name, jmr in jm._defs.items():
|
|
198
|
-
|
|
199
|
-
|
|
203
|
+
if caps:
|
|
204
|
+
assert not re.search(r"^[A-Z_][A-Z_0-9]*$", name), \
|
|
205
|
+
f"all caps reserved for predefs at ${name}"
|
|
200
206
|
assert finiteRef("$" + name), f"finite recursion on ${name}"
|
|
201
207
|
check(jm, validFlt, "JSON Model Structural Validity")
|
|
202
208
|
is_valid = True
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.0.61
|
|
@@ -104,6 +104,10 @@ Accept JSON with objects containing duplicated properties.
|
|
|
104
104
|
|
|
105
105
|
Allow some extensions to help with JSU back-end implementation.
|
|
106
106
|
|
|
107
|
+
=item B<--caps> or B<--no-caps>
|
|
108
|
+
|
|
109
|
+
Reject (the default) or accept all-caps definitions.
|
|
110
|
+
|
|
107
111
|
=item B<--from-ir>/B<-fir>
|
|
108
112
|
|
|
109
113
|
Read a JSON intermediate representation, as generated with C<-C -F json>, instead of a
|
|
@@ -807,6 +807,10 @@ def recurseIR(code: Jsonable,
|
|
|
807
807
|
rwt: Callable[[Jsonable, Path], Jsonable]):
|
|
808
808
|
_recIR(code, [], flt, rwt)
|
|
809
809
|
|
|
810
|
+
#
|
|
811
|
+
# Actual IR optimizations
|
|
812
|
+
#
|
|
813
|
+
|
|
810
814
|
def callShortcuts(code: Jsonable, shortcuts: dict[str, str]) -> int:
|
|
811
815
|
"""Update check function calls based on shortcuts."""
|
|
812
816
|
|
|
@@ -837,6 +841,7 @@ def callShortcuts(code: Jsonable, shortcuts: dict[str, str]) -> int:
|
|
|
837
841
|
|
|
838
842
|
recurseIR(code, _goStructIR, repRwt)
|
|
839
843
|
|
|
844
|
+
log.debug(f"csc {changes}")
|
|
840
845
|
return changes
|
|
841
846
|
|
|
842
847
|
SCALAR_TYPES = { "int", "float", "bool", "str" }
|
|
@@ -898,6 +903,7 @@ def partialEval(code: Jsonable, reporting: bool) -> int:
|
|
|
898
903
|
|
|
899
904
|
recurseIR(code, _goStructIR, peRwt)
|
|
900
905
|
|
|
906
|
+
log.debug(f"pev {changes}")
|
|
901
907
|
return changes
|
|
902
908
|
|
|
903
909
|
def elimCommonSub(code: Jsonable) -> int:
|
|
@@ -995,6 +1001,8 @@ def elimCommonSub(code: Jsonable) -> int:
|
|
|
995
1001
|
return code
|
|
996
1002
|
|
|
997
1003
|
recurseIR(code, cseFlt, cseRwt)
|
|
1004
|
+
|
|
1005
|
+
log.debug(f"cse {changes}")
|
|
998
1006
|
return changes
|
|
999
1007
|
|
|
1000
1008
|
def elimEmptySeq(code: Jsonable, reporting: bool) -> int:
|
|
@@ -1018,11 +1026,12 @@ def elimEmptySeq(code: Jsonable, reporting: bool) -> int:
|
|
|
1018
1026
|
break
|
|
1019
1027
|
if code and remove:
|
|
1020
1028
|
changes += 1
|
|
1021
|
-
|
|
1022
|
-
return list(filter(lambda o: _isOps(o, {"co", "seq", "no"}), code))
|
|
1029
|
+
code = getComments(code) + [ {"o": "no"} ]
|
|
1023
1030
|
return code
|
|
1024
1031
|
|
|
1025
1032
|
recurseIR(code, _goIR, eecRwt)
|
|
1033
|
+
|
|
1034
|
+
log.debug(f"ees {changes}")
|
|
1026
1035
|
return changes
|
|
1027
1036
|
|
|
1028
1037
|
|
|
@@ -1075,6 +1084,8 @@ def elimEmptyLoop(code: Jsonable, reporting: bool) -> int:
|
|
|
1075
1084
|
return code
|
|
1076
1085
|
|
|
1077
1086
|
recurseIR(code, _goIR, eelRwt)
|
|
1087
|
+
|
|
1088
|
+
log.debug(f"eel {changes}")
|
|
1078
1089
|
return changes
|
|
1079
1090
|
|
|
1080
1091
|
def elimDeadCode(code: Jsonable, reporting: bool) -> int:
|
|
@@ -1104,6 +1115,8 @@ def elimDeadCode(code: Jsonable, reporting: bool) -> int:
|
|
|
1104
1115
|
return code
|
|
1105
1116
|
|
|
1106
1117
|
recurseIR(code, _goIR, edcRwt)
|
|
1118
|
+
|
|
1119
|
+
log.debug(f"edc {changes}")
|
|
1107
1120
|
return changes
|
|
1108
1121
|
|
|
1109
1122
|
def elimUnreachableCode(code: Jsonable) -> int:
|
|
@@ -1134,6 +1147,8 @@ def elimUnreachableCode(code: Jsonable) -> int:
|
|
|
1134
1147
|
return code
|
|
1135
1148
|
|
|
1136
1149
|
recurseIR(code, _goStructIR, eucRwt)
|
|
1150
|
+
|
|
1151
|
+
log.debug(f"euc {changes}")
|
|
1137
1152
|
return changes
|
|
1138
1153
|
|
|
1139
1154
|
# TODO what about other variables?!
|
|
@@ -1165,6 +1180,7 @@ def elimUnusedBoolVars(code: Jsonable) -> int:
|
|
|
1165
1180
|
bop.clear()
|
|
1166
1181
|
bop.update(o="ign")
|
|
1167
1182
|
|
|
1183
|
+
log.debug(f"eub {changes}")
|
|
1168
1184
|
return changes
|
|
1169
1185
|
|
|
1170
1186
|
def mifToIf(code: Jsonable) -> int:
|
|
@@ -1183,6 +1199,7 @@ def mifToIf(code: Jsonable) -> int:
|
|
|
1183
1199
|
|
|
1184
1200
|
recurseIR(code, _goStructIR, mif2ifRwt)
|
|
1185
1201
|
|
|
1202
|
+
log.debug(f"m2i {changes}")
|
|
1186
1203
|
return changes
|
|
1187
1204
|
|
|
1188
1205
|
def simplifySimpleIf(code: Jsonable, reporting: bool) -> int:
|
|
@@ -1211,6 +1228,7 @@ def simplifySimpleIf(code: Jsonable, reporting: bool) -> int:
|
|
|
1211
1228
|
|
|
1212
1229
|
recurseIR(code, _goStructIR, sisifRwt)
|
|
1213
1230
|
|
|
1231
|
+
log.debug(f"ssi {changes}")
|
|
1214
1232
|
return changes
|
|
1215
1233
|
|
|
1216
1234
|
def optimizeIR(
|
|
@@ -33,9 +33,11 @@ LANG = {
|
|
|
33
33
|
"json": "IR",
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
def process_model(
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
def process_model(
|
|
37
|
+
model: JsonModel, *,
|
|
38
|
+
check: bool = True, merge: bool = True, optimize: bool = True,
|
|
39
|
+
disabled_optims: list[str] = [], extend: bool = False, caps: bool = True,
|
|
40
|
+
debug: int = 0):
|
|
39
41
|
"""Apply necessary preprocessing to JsonModel."""
|
|
40
42
|
|
|
41
43
|
# initial sanity check
|
|
@@ -48,7 +50,7 @@ def process_model(model: JsonModel, *,
|
|
|
48
50
|
|
|
49
51
|
if debug or check:
|
|
50
52
|
for m in all_models:
|
|
51
|
-
if not analyze.valid(m, extend=extend):
|
|
53
|
+
if not analyze.valid(m, extend=extend, caps=caps):
|
|
52
54
|
raise ModelError(f"invalid initial model {m._url}:{m._id}")
|
|
53
55
|
|
|
54
56
|
# simplify before merging
|
|
@@ -60,7 +62,7 @@ def process_model(model: JsonModel, *,
|
|
|
60
62
|
if debug or check:
|
|
61
63
|
# log.debug(json.dumps(model.toJSON(), sort_keys=True, indent=2))
|
|
62
64
|
for m in all_models:
|
|
63
|
-
if not analyze.valid(m, extend=extend):
|
|
65
|
+
if not analyze.valid(m, extend=extend, caps=caps):
|
|
64
66
|
raise ModelError(f"invalid optimized model {m._url}:{m._id}")
|
|
65
67
|
|
|
66
68
|
# merge in reverse order to move alts up before inlining?!
|
|
@@ -76,7 +78,7 @@ def process_model(model: JsonModel, *,
|
|
|
76
78
|
# check after merge & optimize
|
|
77
79
|
if debug or check:
|
|
78
80
|
for m in all_models:
|
|
79
|
-
if not analyze.valid(m, extend=extend):
|
|
81
|
+
if not analyze.valid(m, extend=extend, caps=caps):
|
|
80
82
|
raise ModelError(f"invalid merged model {m._url}:{m._id}")
|
|
81
83
|
|
|
82
84
|
|
|
@@ -88,7 +90,7 @@ def model_from_json(
|
|
|
88
90
|
loose_int: bool|None = None, loose_float: bool|None = None,
|
|
89
91
|
# processing stuff
|
|
90
92
|
check: bool = True, merge: bool = True, optimize: bool = True,
|
|
91
|
-
extend: bool = False, disabled_optims: list[str] = [],
|
|
93
|
+
extend: bool = False, caps: bool = True, disabled_optims: list[str] = [],
|
|
92
94
|
) -> JsonModel:
|
|
93
95
|
"""JsonModel instanciation from JSON data."""
|
|
94
96
|
|
|
@@ -117,7 +119,7 @@ def model_from_json(
|
|
|
117
119
|
if check or merge or optimize or extend:
|
|
118
120
|
process_model(
|
|
119
121
|
jm, debug=debug, extend=extend, check=check, merge=merge,
|
|
120
|
-
optimize=optimize, disabled_optims=disabled_optims,
|
|
122
|
+
optimize=optimize, disabled_optims=disabled_optims, caps=caps,
|
|
121
123
|
)
|
|
122
124
|
|
|
123
125
|
return jm
|
|
@@ -148,8 +150,8 @@ def model_from_str(
|
|
|
148
150
|
return model_from_json(json_loads(mstring, allow_duplicates=allow_duplicates), **kwargs)
|
|
149
151
|
|
|
150
152
|
|
|
151
|
-
# it is unclear if this tricks actually works
|
|
152
153
|
def _model_checker(jm: JsonModel, *, debug: bool = False, **options):
|
|
154
|
+
"""Return the python checker function for the model."""
|
|
153
155
|
code = xstatic_compile(jm, lang="py", debug=debug, **options)
|
|
154
156
|
env = {}
|
|
155
157
|
exec(str(code), env)
|
|
@@ -166,13 +168,14 @@ def model_checker(jm: JsonModel, *, debug: bool = False, **options) -> EntryChec
|
|
|
166
168
|
def model_checker_from_json(
|
|
167
169
|
mjson: Jsonable, *, auto: bool = False, debug: int = 0,
|
|
168
170
|
resolver: Resolver|None = None, single_line: bool = False,
|
|
169
|
-
loose_int: bool|None = None, loose_float: bool|None = None,
|
|
171
|
+
loose_int: bool|None = None, loose_float: bool|None = None,
|
|
172
|
+
extend: bool = False, caps: bool = True,
|
|
170
173
|
**options,
|
|
171
174
|
) -> EntryCheckFun:
|
|
172
175
|
"""Return an executable model checker from a URL."""
|
|
173
176
|
jm = model_from_json(
|
|
174
177
|
mjson, auto=auto, debug=debug, resolver=resolver, single_line=single_line,
|
|
175
|
-
loose_int=loose_int, loose_float=loose_float, extend=extend
|
|
178
|
+
loose_int=loose_int, loose_float=loose_float, extend=extend, caps=caps,
|
|
176
179
|
)
|
|
177
180
|
return model_checker(jm, debug=debug > 0, **options)
|
|
178
181
|
|
|
@@ -181,12 +184,14 @@ def model_checker_from_url(
|
|
|
181
184
|
murl: str, *, auto: bool = False, debug: int = 0,
|
|
182
185
|
resolver: Resolver|None = None, follow: bool = True, single_line: bool = False,
|
|
183
186
|
loose_int: bool|None = None, loose_float: bool|None = None, extend: bool = False,
|
|
187
|
+
caps: bool = True,
|
|
184
188
|
**options,
|
|
185
189
|
) -> EntryCheckFun:
|
|
186
190
|
"""Return an executable model checker from a URL."""
|
|
187
191
|
jm = model_from_url(
|
|
188
192
|
murl, auto=auto, debug=debug, resolver=resolver, follow=follow,
|
|
189
|
-
loose_int=loose_int, loose_float=loose_float, extend=extend,
|
|
193
|
+
loose_int=loose_int, loose_float=loose_float, extend=extend,
|
|
194
|
+
caps=caps, single_line=single_line,
|
|
190
195
|
)
|
|
191
196
|
return model_checker(jm, debug=debug > 0, **options)
|
|
192
197
|
|
|
@@ -196,13 +201,13 @@ def create_model(
|
|
|
196
201
|
auto: bool = False, follow: bool = True, debug: int = 0,
|
|
197
202
|
check: bool = True, merge: bool = True, optimize: bool = True,
|
|
198
203
|
loose_int: bool|None = None, loose_float: bool|None = None,
|
|
199
|
-
extend: bool = False, single_line: bool = False
|
|
204
|
+
extend: bool = False, caps: bool = True, single_line: bool = False
|
|
200
205
|
) -> JsonModel:
|
|
201
206
|
"""JsonModel instanciation without preprocessing."""
|
|
202
207
|
return model_from_url(
|
|
203
208
|
murl, auto=auto, follow=follow, debug=debug, resolver=resolver,
|
|
204
209
|
loose_int=loose_int, loose_float=loose_float, single_line=single_line,
|
|
205
|
-
check=check, merge=merge, optimize=optimize, extend=extend
|
|
210
|
+
check=check, merge=merge, optimize=optimize, extend=extend, caps=caps,
|
|
206
211
|
)
|
|
207
212
|
|
|
208
213
|
|
|
@@ -368,11 +373,13 @@ def jmc_script(xargs: list[str]|None = None) -> int:
|
|
|
368
373
|
grp = ap.add_argument_group("Model input")
|
|
369
374
|
arg = grp.add_argument
|
|
370
375
|
arg("--allow-duplicates", "-ad", action="store_true", default=False,
|
|
371
|
-
help="allow duplicated properties in parsed model, probably a bad idea."
|
|
376
|
+
help="allow duplicated properties in parsed model, probably a bad idea.")
|
|
372
377
|
arg("--maps", "-m", action="append", default=[], help="URL mappings")
|
|
373
378
|
arg("--auto", "-a", action="store_true", help="automatic URL mapping")
|
|
374
379
|
arg("--extend", default=False, action="store_true", help="allow some extensions")
|
|
375
380
|
arg("--no-extend", dest="extend", action="store_false", help="do not allow some extensions")
|
|
381
|
+
arg("--caps", action="store_true", default=True, help="reject all-caps defs")
|
|
382
|
+
arg("--no-caps", dest="caps", action="store_false", help="accept all-caps defs")
|
|
376
383
|
arg("--from-ir", "-fir", action="store_true", default=False,
|
|
377
384
|
help="input is a JSON IR file instead of a JSON model")
|
|
378
385
|
|
|
@@ -852,7 +859,7 @@ def jmc_script(xargs: list[str]|None = None) -> int:
|
|
|
852
859
|
args.model, resolver, auto=args.auto, debug=args.debug,
|
|
853
860
|
loose_int=args.loose_int, loose_float=args.loose_float,
|
|
854
861
|
check=args.check, merge=args.op != "N", single_line=args.single_line_regex,
|
|
855
|
-
optimize=args.optimize, extend=args.extend, follow=False
|
|
862
|
+
optimize=args.optimize, extend=args.extend, caps=args.caps, follow=False
|
|
856
863
|
)
|
|
857
864
|
except Exception as e:
|
|
858
865
|
log.error(e)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.0.60
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -170,6 +170,9 @@ jmc.1: json_model/data/jmc.pod dev
|
|
|
170
170
|
year=$$(date +%Y)
|
|
171
171
|
pod2man $< | sed "s/^\.TH JMC 1.*/.TH JMC 1 $$year \"v$$version\" \"User Documentation\"/" > $@
|
|
172
172
|
|
|
173
|
+
.PHONY: build.site
|
|
174
|
+
build.site: site/models.json site/JMC.md site/ABOUT.md site/BENCH.md
|
|
175
|
+
|
|
173
176
|
_site: build.site
|
|
174
177
|
cp -rL site _site
|
|
175
178
|
find _site -type d -print | xargs chmod a+rx
|
|
@@ -186,9 +189,6 @@ www: build.site
|
|
|
186
189
|
# SITE and SITEPATH are out of the git repository
|
|
187
190
|
-include local.mk
|
|
188
191
|
|
|
189
|
-
.PHONY: build.site
|
|
190
|
-
build.site: site/models.json site/JMC.md site/ABOUT.md site/BENCH.md
|
|
191
|
-
|
|
192
192
|
.PHONY: publish.site
|
|
193
193
|
publish.site: build.site
|
|
194
194
|
# NOTE --delete: no, keep old benchmark pages archive on the site for now
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/javascript_foot.js
RENAMED
|
File without changes
|
{json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/javascript_free.js
RENAMED
|
File without changes
|
{json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/javascript_head.js
RENAMED
|
File without changes
|
{json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/javascript_init.js
RENAMED
|
File without changes
|
{json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/data/javascript_main.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/java/.gitignore
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/js/package.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/pl/t/manifest.t
RENAMED
|
File without changes
|
{json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/pl/t/pod-coverage.t
RENAMED
|
File without changes
|
|
File without changes
|
{json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/pl/xt/boilerplate.t
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/sql/json_model--2.0.sql
RENAMED
|
File without changes
|
{json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model/runtime/sql/json_model.control
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model_compiler.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model_compiler.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model_compiler.egg-info/requires.txt
RENAMED
|
File without changes
|
{json_model_compiler-2.0.60 → json_model_compiler-2.0.61}/json_model_compiler.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|