aas-core-codegen 0.0.16__py3-none-any.whl → 0.0.17__py3-none-any.whl
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.
- aas_core_codegen/__init__.py +1 -1
- aas_core_codegen/cpp/pattern/_generate.py +8 -7
- aas_core_codegen/cpp/revm/_generate.py +2 -2
- aas_core_codegen/intermediate/__init__.py +2 -0
- aas_core_codegen/intermediate/_stringify.py +9 -0
- aas_core_codegen/intermediate/_types.py +374 -44
- aas_core_codegen/python/xmlization/_generate.py +3 -1
- {aas_core_codegen-0.0.16.dist-info → aas_core_codegen-0.0.17.dist-info}/METADATA +2 -2
- {aas_core_codegen-0.0.16.dist-info → aas_core_codegen-0.0.17.dist-info}/RECORD +19 -17
- {aas_core_codegen-0.0.16.dist-info → aas_core_codegen-0.0.17.dist-info}/WHEEL +1 -1
- dev/dev_scripts/run_tests_with_rerecord.py +5 -1
- dev/test_data/intermediate/expected/constrained_primitive/inheritance/meta_model.py +17 -0
- dev/tests/cpp/test_pattern.py +31 -31
- dev/tests/intermediate/test_pickle.py +1871 -0
- dev/tests/intermediate/test_types.py +454 -0
- {aas_core_codegen-0.0.16.dist-info → aas_core_codegen-0.0.17.dist-info}/entry_points.txt +0 -0
- {aas_core_codegen-0.0.16.dist-info → aas_core_codegen-0.0.17.dist-info}/licenses/AUTHORS +0 -0
- {aas_core_codegen-0.0.16.dist-info → aas_core_codegen-0.0.17.dist-info}/licenses/LICENSE +0 -0
- {aas_core_codegen-0.0.16.dist-info → aas_core_codegen-0.0.17.dist-info}/top_level.txt +0 -0
aas_core_codegen/__init__.py
CHANGED
|
@@ -201,7 +201,7 @@ def _write_instructions_recursively(
|
|
|
201
201
|
instruction_code = Stripped(
|
|
202
202
|
f"""\
|
|
203
203
|
program.emplace_back({maybe_label_comment}
|
|
204
|
-
{I}
|
|
204
|
+
{I}common::make_unique<revm::InstructionChar>({char_literal})
|
|
205
205
|
);"""
|
|
206
206
|
)
|
|
207
207
|
|
|
@@ -230,7 +230,7 @@ program.emplace_back({maybe_label_comment}
|
|
|
230
230
|
instruction_code = Stripped(
|
|
231
231
|
f"""\
|
|
232
232
|
program.emplace_back({maybe_label_comment}
|
|
233
|
-
{I}
|
|
233
|
+
{I}common::make_unique<revm::{instruction_cls}>(
|
|
234
234
|
{II}std::vector<revm::Range>{{
|
|
235
235
|
{III}{indent_but_first_line(ranges_joined, III)}
|
|
236
236
|
{II}}}
|
|
@@ -242,7 +242,7 @@ program.emplace_back({maybe_label_comment}
|
|
|
242
242
|
instruction_code = Stripped(
|
|
243
243
|
f"""\
|
|
244
244
|
program.emplace_back({maybe_label_comment}
|
|
245
|
-
{I}
|
|
245
|
+
{I}common::make_unique<revm::InstructionAny>()
|
|
246
246
|
);"""
|
|
247
247
|
)
|
|
248
248
|
|
|
@@ -250,7 +250,7 @@ program.emplace_back({maybe_label_comment}
|
|
|
250
250
|
instruction_code = Stripped(
|
|
251
251
|
f"""\
|
|
252
252
|
program.emplace_back({maybe_label_comment}
|
|
253
|
-
{I}
|
|
253
|
+
{I}common::make_unique<revm::InstructionMatch>()
|
|
254
254
|
);"""
|
|
255
255
|
)
|
|
256
256
|
|
|
@@ -258,7 +258,7 @@ program.emplace_back({maybe_label_comment}
|
|
|
258
258
|
instruction_code = Stripped(
|
|
259
259
|
f"""\
|
|
260
260
|
program.emplace_back({maybe_label_comment}
|
|
261
|
-
{I}
|
|
261
|
+
{I}common::make_unique<revm::InstructionJump>({node_or_leaf.instruction.target})
|
|
262
262
|
);"""
|
|
263
263
|
)
|
|
264
264
|
|
|
@@ -268,7 +268,7 @@ program.emplace_back({maybe_label_comment}
|
|
|
268
268
|
instruction_code = Stripped(
|
|
269
269
|
f"""\
|
|
270
270
|
program.emplace_back({maybe_label_comment}
|
|
271
|
-
{I}
|
|
271
|
+
{I}common::make_unique<revm::InstructionSplit>({first_target}, {second_target})
|
|
272
272
|
);"""
|
|
273
273
|
)
|
|
274
274
|
|
|
@@ -276,7 +276,7 @@ program.emplace_back({maybe_label_comment}
|
|
|
276
276
|
instruction_code = Stripped(
|
|
277
277
|
f"""\
|
|
278
278
|
program.emplace_back({maybe_label_comment}
|
|
279
|
-
{I}
|
|
279
|
+
{I}common::make_unique<revm::InstructionEnd>()
|
|
280
280
|
);"""
|
|
281
281
|
)
|
|
282
282
|
|
|
@@ -449,6 +449,7 @@ def generate_implementation(
|
|
|
449
449
|
cpp_common.WARNING,
|
|
450
450
|
Stripped(
|
|
451
451
|
f'''\
|
|
452
|
+
#include "{include_prefix_path}/common.hpp"
|
|
452
453
|
#include "{include_prefix_path}/pattern.hpp"
|
|
453
454
|
#include "{include_prefix_path}/revm.hpp"'''
|
|
454
455
|
),
|
|
@@ -902,8 +902,8 @@ bool Match(
|
|
|
902
902
|
{I}// See: https://swtch.com/~rsc/regexp/regexp2.html,
|
|
903
903
|
{I}// Section "Thompson's Implementation".
|
|
904
904
|
|
|
905
|
-
{I}std::unique_ptr<ThreadList> clist(
|
|
906
|
-
{I}std::unique_ptr<ThreadList> nlist(
|
|
905
|
+
{I}std::unique_ptr<ThreadList> clist(common::make_unique<ThreadList>(program.size()));
|
|
906
|
+
{I}std::unique_ptr<ThreadList> nlist(common::make_unique<ThreadList>(program.size()));
|
|
907
907
|
|
|
908
908
|
{I}clist->Spawn(0);
|
|
909
909
|
|
|
@@ -6,6 +6,8 @@ TypeAnnotation = _types.TypeAnnotation
|
|
|
6
6
|
TypeAnnotationUnion = _types.TypeAnnotationUnion
|
|
7
7
|
AtomicTypeAnnotation = _types.AtomicTypeAnnotation
|
|
8
8
|
PrimitiveType = _types.PrimitiveType
|
|
9
|
+
PRIMITIVE_TYPE_TO_PYTHON_TYPE = _types.PRIMITIVE_TYPE_TO_PYTHON_TYPE
|
|
10
|
+
PYTHON_TYPE_TO_PRIMITIVE_TYPE = _types.PYTHON_TYPE_TO_PRIMITIVE_TYPE
|
|
9
11
|
PrimitiveTypeAnnotation = _types.PrimitiveTypeAnnotation
|
|
10
12
|
OurTypeAnnotation = _types.OurTypeAnnotation
|
|
11
13
|
ListTypeAnnotation = _types.ListTypeAnnotation
|
|
@@ -510,6 +510,7 @@ def _stringify_enumeration(
|
|
|
510
510
|
stringify_mod.PropertyEllipsis("literals_by_name", that.literals_by_name),
|
|
511
511
|
stringify_mod.PropertyEllipsis("literals_by_value", that.literals_by_value),
|
|
512
512
|
stringify_mod.PropertyEllipsis("literal_id_set", that.literal_id_set),
|
|
513
|
+
stringify_mod.PropertyEllipsis("literal_value_set", that.literal_value_set),
|
|
513
514
|
stringify_mod.PropertyEllipsis("parsed", that.parsed),
|
|
514
515
|
],
|
|
515
516
|
)
|
|
@@ -542,6 +543,13 @@ def _stringify_constrained_primitive(
|
|
|
542
543
|
],
|
|
543
544
|
),
|
|
544
545
|
stringify_mod.PropertyEllipsis("ancestor_id_set", that.ancestor_id_set),
|
|
546
|
+
stringify_mod.Property(
|
|
547
|
+
"descendants",
|
|
548
|
+
[
|
|
549
|
+
f"Reference to {descendant.__class__.__name__} {descendant.name}"
|
|
550
|
+
for descendant in that.descendants
|
|
551
|
+
],
|
|
552
|
+
),
|
|
545
553
|
stringify_mod.PropertyEllipsis("descendant_id_set", that.descendant_id_set),
|
|
546
554
|
stringify_mod.Property("constrainee", that.constrainee.name),
|
|
547
555
|
stringify_mod.Property(
|
|
@@ -711,6 +719,7 @@ def _stringify_constant_set_of_enumeration_literals(
|
|
|
711
719
|
],
|
|
712
720
|
),
|
|
713
721
|
stringify_mod.PropertyEllipsis("literal_id_set", that.literal_id_set),
|
|
722
|
+
stringify_mod.PropertyEllipsis("literal_value_set", that.literal_value_set),
|
|
714
723
|
stringify_mod.Property(
|
|
715
724
|
"subsets",
|
|
716
725
|
[
|