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.
@@ -1,6 +1,6 @@
1
1
  """Generate implementations and schemas based on an AAS meta-model."""
2
2
 
3
- __version__ = "0.0.16"
3
+ __version__ = "0.0.17"
4
4
  __author__ = "Marko Ristin, Nico Braunisch"
5
5
  __license__ = "License :: OSI Approved :: MIT License"
6
6
  __status__ = "Production/Stable"
@@ -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}std::make_unique<revm::InstructionChar>({char_literal})
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}std::make_unique<revm::{instruction_cls}>(
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}std::make_unique<revm::InstructionAny>()
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}std::make_unique<revm::InstructionMatch>()
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}std::make_unique<revm::InstructionJump>({node_or_leaf.instruction.target})
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}std::make_unique<revm::InstructionSplit>({first_target}, {second_target})
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}std::make_unique<revm::InstructionEnd>()
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(std::make_unique<ThreadList>(program.size()));
906
- {I}std::unique_ptr<ThreadList> nlist(std::make_unique<ThreadList>(program.size()));
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
  [