plain-parser 0.1.2.dev6__py3-none-any.whl → 0.1.3.dev8__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.
@@ -715,11 +715,13 @@ def process_required_modules(
715
715
  all_required_modules: list[str],
716
716
  modules_trace: list[str],
717
717
  chain: list[tuple[str, dict]],
718
+ module_exports: dict[str, list[mistletoe.block_token.token]],
718
719
  ) -> list[mistletoe.block_token.token]:
719
720
  """Parse and fully validate every required module, deepest first.
720
721
 
721
- Appends ``(module name, marshalled plain source tree)`` to ``chain`` for each module not already in it
722
- and returns the exported definitions of the directly required modules.
722
+ Appends ``(module name, marshalled plain source tree)`` to ``chain`` for each module not already in it,
723
+ records each module's exported definitions in ``module_exports``, and returns the exported definitions
724
+ of the directly required modules.
723
725
  """
724
726
  exported_definitions = list[mistletoe.block_token.token]()
725
727
  for module_name in required_modules:
@@ -727,6 +729,8 @@ def process_required_modules(
727
729
  raise PlainSyntaxError(f"Plain syntax error: Circular required module detected: {module_name}.")
728
730
 
729
731
  if len(all_required_modules) > 0 and module_name == all_required_modules[-1]:
732
+ # Already processed as an earlier entry; its exports are still visible to this module.
733
+ exported_definitions.extend(module_exports[module_name])
730
734
  continue
731
735
 
732
736
  code_variables: dict = {}
@@ -750,8 +754,10 @@ def process_required_modules(
750
754
  all_required_modules,
751
755
  modules_trace + [module_name],
752
756
  chain,
757
+ module_exports,
753
758
  )
754
759
 
760
+ own_exported_definitions = list[mistletoe.block_token.token]()
755
761
  if EXPORTED_CONCEPTS_DIRECTIVE in plain_file_parse_result.plain_source_obj.metadata:
756
762
  exported_concepts = list[str]()
757
763
  for concept in plain_file_parse_result.plain_source_obj.metadata[EXPORTED_CONCEPTS_DIRECTIVE]:
@@ -759,11 +765,13 @@ def process_required_modules(
759
765
 
760
766
  with PlainRenderer() as renderer:
761
767
  for exported_concept in exported_concepts:
762
- exported_definitions.extend(
768
+ own_exported_definitions.extend(
763
769
  concept_utils.find_concept_definitions_in_plain_source(
764
770
  exported_concept, plain_file_parse_result.plain_source, renderer
765
771
  )
766
772
  )
773
+ module_exports[module_name] = own_exported_definitions
774
+ exported_definitions.extend(own_exported_definitions)
767
775
 
768
776
  marshalled_plain_source = validate_and_marshall_module(
769
777
  plain_file_parse_result, module_name, ancestor_exported_definitions, code_variables, template_dirs
@@ -889,6 +897,7 @@ def _parse_module(
889
897
  all_required_modules=[],
890
898
  modules_trace=[],
891
899
  chain=chain,
900
+ module_exports={},
892
901
  )
893
902
 
894
903
  marshalled_plain_source = validate_and_marshall_module(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: plain-parser
3
- Version: 0.1.2.dev6
3
+ Version: 0.1.3.dev8
4
4
  Summary: Parser for ***plain specification files
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -5,10 +5,10 @@ plain_parser/exceptions.py,sha256=WcHK5g9K6bsE-ZZBKWl0lZtiMTQ6fif8-zdEx9qjmRw,79
5
5
  plain_parser/graph.py,sha256=xZfgzAXoL_hMfqre0Vj4kdvCC8vzfxZgvYptEK9W0Ho,6843
6
6
  plain_parser/liquid_nodes.py,sha256=CYmujdPJMK9hLjfFPmnSoKL3Ps4sb-2OOhH-fZUssis,3917
7
7
  plain_parser/loaders.py,sha256=o-I7u1NL8hZdTWztqwO7zw072aGxXTBBYSAFDBRG4q0,5136
8
- plain_parser/plain_file.py,sha256=NnPB9-xp2BIwJIaKmZnjTVjYCZPhlh4RLakR1CV6tUU,39867
8
+ plain_parser/plain_file.py,sha256=7QCIh2PlGZoltilLgNirwjm0fdcvDJIMlk9NfR8ViKI,40431
9
9
  plain_parser/plain_spec.py,sha256=Z79Vi8bdRiOiM53QyWS8OLNSlGPrQObSZx11Eh8i8Mk,15308
10
- plain_parser-0.1.2.dev6.dist-info/METADATA,sha256=GpR9GL3i3D06Wc8fnNPvpExLV8kK8rRy5rkejgxzlto,2647
11
- plain_parser-0.1.2.dev6.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
12
- plain_parser-0.1.2.dev6.dist-info/entry_points.txt,sha256=pA31GGUyYrmZSpH1CuSzhjrv8pX5ac5HI5hFop1B4eI,55
13
- plain_parser-0.1.2.dev6.dist-info/licenses/LICENSE,sha256=QClWKncxgRjNUVOW8Axi7zK9HtsMdJEtUSMA4LEe8fo,1071
14
- plain_parser-0.1.2.dev6.dist-info/RECORD,,
10
+ plain_parser-0.1.3.dev8.dist-info/METADATA,sha256=NI7l_hkUjP8fFa1qcvg-qICxofIM-EAq3yENX6xOeKQ,2647
11
+ plain_parser-0.1.3.dev8.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
12
+ plain_parser-0.1.3.dev8.dist-info/entry_points.txt,sha256=pA31GGUyYrmZSpH1CuSzhjrv8pX5ac5HI5hFop1B4eI,55
13
+ plain_parser-0.1.3.dev8.dist-info/licenses/LICENSE,sha256=QClWKncxgRjNUVOW8Axi7zK9HtsMdJEtUSMA4LEe8fo,1071
14
+ plain_parser-0.1.3.dev8.dist-info/RECORD,,