sysmlpy 0.33.4__tar.gz → 0.33.6__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 (147) hide show
  1. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/PKG-INFO +10 -1
  2. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/README.md +9 -0
  3. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/pyproject.toml +1 -1
  4. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/__init__.py +1 -1
  5. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/antlr_parser.py +5 -20
  6. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/antlr_visitor.py +6 -0
  7. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/grammar/classes.py +9 -5
  8. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/semantic.py +44 -22
  9. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/LICENSE +0 -0
  10. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/__main__.py +0 -0
  11. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/antlr/README.md +0 -0
  12. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/antlr/SysMLv2Lexer.interp +0 -0
  13. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/antlr/SysMLv2Lexer.py +0 -0
  14. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/antlr/SysMLv2Lexer.tokens +0 -0
  15. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/antlr/SysMLv2Parser.interp +0 -0
  16. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/antlr/SysMLv2Parser.py +0 -0
  17. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/antlr/SysMLv2Parser.tokens +0 -0
  18. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/antlr/SysMLv2ParserListener.py +0 -0
  19. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/antlr/SysMLv2ParserVisitor.py +0 -0
  20. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.interp +0 -0
  21. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.py +0 -0
  22. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.tokens +0 -0
  23. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/definition.py +0 -0
  24. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/examples/attribute_values.py +0 -0
  25. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/examples/part_attributes.py +0 -0
  26. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/examples/tuples_sequences.py +0 -0
  27. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/formatting.py +0 -0
  28. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/grammar/antlr4/README.md +0 -0
  29. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.g4 +0 -0
  30. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.interp +0 -0
  31. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.py +0 -0
  32. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.tokens +0 -0
  33. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.g4 +0 -0
  34. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.interp +0 -0
  35. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.py +0 -0
  36. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.tokens +0 -0
  37. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/grammar/antlr4/SysMLv2ParserListener.py +0 -0
  38. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/grammar/antlr4/SysMLv2ParserVisitor.py +0 -0
  39. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/grammar/antlr4/desc.xml +0 -0
  40. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/grammar/antlr4/examples/camera.sysml +0 -0
  41. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/grammar/antlr4/examples/toaster-system.sysml +0 -0
  42. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/grammar/antlr4/examples/vehicle-model.sysml +0 -0
  43. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/grammar/antlr4/pom.xml +0 -0
  44. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/LICENSE +0 -0
  45. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/README.md +0 -0
  46. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/__init__.py +0 -0
  47. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Analysis/AnalysisTooling.sysml +0 -0
  48. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Analysis/SampledFunctions.sysml +0 -0
  49. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Analysis/StateSpaceRepresentation.sysml +0 -0
  50. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Analysis/TradeStudies.sysml +0 -0
  51. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Cause and Effect/CausationConnections.sysml +0 -0
  52. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Cause and Effect/CauseAndEffect.sysml +0 -0
  53. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Geometry/ShapeItems.sysml +0 -0
  54. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Geometry/SpatialItems.sysml +0 -0
  55. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Metadata/ImageMetadata.sysml +0 -0
  56. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Metadata/ModelingMetadata.sysml +0 -0
  57. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Metadata/ParametersOfInterestMetadata.sysml +0 -0
  58. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Metadata/RiskMetadata.sysml +0 -0
  59. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/ISQ.sysml +0 -0
  60. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/ISQAcoustics.sysml +0 -0
  61. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/ISQAtomicNuclear.sysml +0 -0
  62. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/ISQBase.sysml +0 -0
  63. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/ISQCharacteristicNumbers.sysml +0 -0
  64. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/ISQChemistryMolecular.sysml +0 -0
  65. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/ISQCondensedMatter.sysml +0 -0
  66. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/ISQElectromagnetism.sysml +0 -0
  67. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/ISQInformation.sysml +0 -0
  68. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/ISQLight.sysml +0 -0
  69. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/ISQMechanics.sysml +0 -0
  70. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/ISQSpaceTime.sysml +0 -0
  71. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/ISQThermodynamics.sysml +0 -0
  72. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/MeasurementRefCalculations.sysml +0 -0
  73. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/MeasurementReferences.sysml +0 -0
  74. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/Quantities.sysml +0 -0
  75. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/QuantityCalculations.sysml +0 -0
  76. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/SI.sysml +0 -0
  77. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/SIPrefixes.sysml +0 -0
  78. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/TensorCalculations.sysml +0 -0
  79. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/Time.sysml +0 -0
  80. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/USCustomaryUnits.sysml +0 -0
  81. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Quantities and Units/VectorCalculations.sysml +0 -0
  82. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Requirement Derivation/DerivationConnections.sysml +0 -0
  83. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/domain/Requirement Derivation/RequirementDerivation.sysml +0 -0
  84. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/Base.kerml +0 -0
  85. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/BaseFunctions.kerml +0 -0
  86. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/BooleanFunctions.kerml +0 -0
  87. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/Clocks.kerml +0 -0
  88. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/CollectionFunctions.kerml +0 -0
  89. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/Collections.kerml +0 -0
  90. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/ComplexFunctions.kerml +0 -0
  91. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/ControlFunctions.kerml +0 -0
  92. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/ControlPerformances.kerml +0 -0
  93. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/DataFunctions.kerml +0 -0
  94. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/FeatureReferencingPerformances.kerml +0 -0
  95. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/IntegerFunctions.kerml +0 -0
  96. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/KerML.kerml +0 -0
  97. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/Links.kerml +0 -0
  98. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/Metaobjects.kerml +0 -0
  99. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/NaturalFunctions.kerml +0 -0
  100. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/NumericalFunctions.kerml +0 -0
  101. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/Objects.kerml +0 -0
  102. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/Observation.kerml +0 -0
  103. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/OccurrenceFunctions.kerml +0 -0
  104. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/Occurrences.kerml +0 -0
  105. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/Performances.kerml +0 -0
  106. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/RationalFunctions.kerml +0 -0
  107. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/RealFunctions.kerml +0 -0
  108. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/ScalarFunctions.kerml +0 -0
  109. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/ScalarValues.kerml +0 -0
  110. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/SequenceFunctions.kerml +0 -0
  111. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/SpatialFrames.kerml +0 -0
  112. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/StatePerformances.kerml +0 -0
  113. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/StringFunctions.kerml +0 -0
  114. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/Transfers.kerml +0 -0
  115. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/TransitionPerformances.kerml +0 -0
  116. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/TrigFunctions.kerml +0 -0
  117. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/Triggers.kerml +0 -0
  118. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/VectorFunctions.kerml +0 -0
  119. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/kernel/VectorValues.kerml +0 -0
  120. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/Actions.sysml +0 -0
  121. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/Allocations.sysml +0 -0
  122. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/AnalysisCases.sysml +0 -0
  123. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/Attributes.sysml +0 -0
  124. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/Calculations.sysml +0 -0
  125. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/Cases.sysml +0 -0
  126. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/Connections.sysml +0 -0
  127. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/Constraints.sysml +0 -0
  128. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/Flows.sysml +0 -0
  129. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/Interfaces.sysml +0 -0
  130. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/Items.sysml +0 -0
  131. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/Metadata.sysml +0 -0
  132. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/Parts.sysml +0 -0
  133. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/Ports.sysml +0 -0
  134. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/Requirements.sysml +0 -0
  135. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/StandardViewDefinitions.sysml +0 -0
  136. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/States.sysml +0 -0
  137. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/SysML.sysml +0 -0
  138. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/UseCases.sysml +0 -0
  139. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/VerificationCases.sysml +0 -0
  140. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/library/systems/Views.sysml +0 -0
  141. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/navigate.py +0 -0
  142. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/plantuml.py +0 -0
  143. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/project.py +0 -0
  144. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/store.py +0 -0
  145. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/us_customary_units.txt +0 -0
  146. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/usage.py +0 -0
  147. {sysmlpy-0.33.4 → sysmlpy-0.33.6}/src/sysmlpy/validator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sysmlpy
3
- Version: 0.33.4
3
+ Version: 0.33.6
4
4
  Summary:
5
5
  License-File: LICENSE
6
6
  Author: Jon R. Fox (mycr0ft)
@@ -838,6 +838,15 @@ See [`docs/plantuml-examples/`](docs/plantuml-examples/) for all rendered exampl
838
838
  4. Added `load_from_grammar` handler for `PortionUsage` in `usage.py`.
839
839
  5. PlantUML `_get_stereotype()` now includes `individual`/`timeslice`/`snapshot` prefixes (e.g. `<<timeslice part>>`, `<<individual part>>`).
840
840
 
841
+ - **v0.33.6** — Fix library import resolution with custom library paths:
842
+ 1. Threaded `lib_roots` through `build_from_model()` → `_resolve_imports()` → `_resolve_membership_import()` / `_resolve_namespace_import()` for `LibrarySymbolIndex` fallback.
843
+ 2. `import CustomTypes::*` now resolves correctly when `CustomTypes` is in a user-provided library path.
844
+
845
+ - **v0.33.5** — Fix `DefaultInterfaceEnd` keyword injection:
846
+ 1. Removed spurious `part` keyword from interface ends without explicit `part`/`item`/`port` prefix.
847
+ 2. Bare `end e1 : Type;` now round-trips correctly as `end e1: Type;` (no extraneous `part`).
848
+ 3. 3 previously-failing interface round-trip grammar tests now pass.
849
+
841
850
  ## Conformance
842
851
 
843
852
  **100% of 123 OMG XPect conformance tests pass** (123/123).
@@ -813,6 +813,15 @@ See [`docs/plantuml-examples/`](docs/plantuml-examples/) for all rendered exampl
813
813
  4. Added `load_from_grammar` handler for `PortionUsage` in `usage.py`.
814
814
  5. PlantUML `_get_stereotype()` now includes `individual`/`timeslice`/`snapshot` prefixes (e.g. `<<timeslice part>>`, `<<individual part>>`).
815
815
 
816
+ - **v0.33.6** — Fix library import resolution with custom library paths:
817
+ 1. Threaded `lib_roots` through `build_from_model()` → `_resolve_imports()` → `_resolve_membership_import()` / `_resolve_namespace_import()` for `LibrarySymbolIndex` fallback.
818
+ 2. `import CustomTypes::*` now resolves correctly when `CustomTypes` is in a user-provided library path.
819
+
820
+ - **v0.33.5** — Fix `DefaultInterfaceEnd` keyword injection:
821
+ 1. Removed spurious `part` keyword from interface ends without explicit `part`/`item`/`port` prefix.
822
+ 2. Bare `end e1 : Type;` now round-trips correctly as `end e1: Type;` (no extraneous `part`).
823
+ 3. 3 previously-failing interface round-trip grammar tests now pass.
824
+
816
825
  ## Conformance
817
826
 
818
827
  **100% of 123 OMG XPect conformance tests pass** (123/123).
@@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api"
6
6
 
7
7
  [project]
8
8
  name = "sysmlpy"
9
- version = "0.33.4"
9
+ version = "0.33.6"
10
10
  description = ""
11
11
  authors = [{ name = "Jon R. Fox (mycr0ft)", email = "jon.fox@drfox.com" }]
12
12
  readme = "README.md"
@@ -22,7 +22,7 @@ __all__ = [
22
22
  "SysMLSyntaxError",
23
23
  ]
24
24
  __author__ = "Jon Fox"
25
- __version__ = "0.33.4"
25
+ __version__ = "0.33.6"
26
26
 
27
27
  from sysmlpy.usage import (
28
28
  Item, Attribute, Part, Port, Action, Reference, UseCase, Requirement, Interface, Message,
@@ -67,26 +67,11 @@ def parse(source, library=None):
67
67
  else:
68
68
  content = source
69
69
 
70
- # Load library files if library path is provided
71
- if library is not None:
72
- library_paths = [library] if isinstance(library, (str, Path)) else library
73
- library_content = []
74
-
75
- for lib_path in library_paths:
76
- lib_path = Path(lib_path)
77
- if lib_path.exists() and lib_path.is_dir():
78
- # Load all .sysml and .kerml files from library directory
79
- for ext in ['*.sysml', '*.kerml']:
80
- for lib_file in lib_path.glob(f'**/{ext}'):
81
- try:
82
- lib_content = lib_file.read_text(encoding='utf-8')
83
- library_content.append(lib_content)
84
- except Exception:
85
- pass # Skip files that can't be read
86
-
87
- # Prepend library content to main content
88
- if library_content:
89
- content = '\n\n'.join(library_content) + '\n\n' + content
70
+ # Library parameter — previously prepended library files to the parse input.
71
+ # Bundled library files use KerML syntax (datatype, classifier, standard library package)
72
+ # which the SysML v2 ANTLR grammar cannot parse. Library symbol resolution is handled
73
+ # by LibrarySymbolIndex (regex scanning) during semantic analysis (analyze()).
74
+ # The library parameter is accepted for API compatibility but the content is not prepended.
90
75
 
91
76
  # Create input stream
92
77
  input_stream = InputStream(content)
@@ -9265,12 +9265,18 @@ def _visit_definition_body_item_dict(item_ctx, is_interface=False):
9265
9265
  dir_dict = ref_prefix["direction"]
9266
9266
  if dir_dict and isinstance(dir_dict, dict) and len(dir_dict) > 0:
9267
9267
  direction = dir_dict
9268
+ # Preserve the keyword from the usage type
9269
+ # Only set keyword for non-default types (item/port).
9270
+ # PartUsage is the default interface end type — no keyword needed.
9271
+ usage_to_keyword = {"ItemUsage": "item", "PortUsage": "port"}
9272
+ keyword = usage_to_keyword.get(usage_name, None)
9268
9273
  default_interface_end = {
9269
9274
  "name": "DefaultInterfaceEnd",
9270
9275
  "direction": direction,
9271
9276
  "isAbstract": is_abstract,
9272
9277
  "isVariation": is_variation,
9273
9278
  "isEnd": is_end,
9279
+ "keyword": keyword,
9274
9280
  "usage": usage_dict
9275
9281
  }
9276
9282
  iface_elem = {
@@ -3897,15 +3897,16 @@ class DefaultInterfaceEnd:
3897
3897
  def __init__(self, definition):
3898
3898
  if valid_definition(definition, self.__class__.__name__):
3899
3899
  self.direction = None
3900
- self.isAbstract = definition["isAbstract"]
3901
- self.isVariation = definition["isVariation"]
3902
- self.isEnd = definition["isEnd"]
3900
+ self.isAbstract = definition.get("isAbstract")
3901
+ self.isVariation = definition.get("isVariation")
3902
+ self.isEnd = definition.get("isEnd")
3903
+ self.keyword = definition.get("keyword")
3903
3904
  self.usage = None
3904
3905
 
3905
- if definition["direction"] is not None:
3906
+ if definition.get("direction") is not None:
3906
3907
  self.direction = FeatureDirection(definition["direction"])
3907
3908
 
3908
- if definition["usage"] is not None:
3909
+ if definition.get("usage") is not None:
3909
3910
  self.usage = Usage(definition["usage"])
3910
3911
 
3911
3912
  def dump(self):
@@ -3918,6 +3919,8 @@ class DefaultInterfaceEnd:
3918
3919
  output.append("variation")
3919
3920
  if self.isEnd:
3920
3921
  output.append("end")
3922
+ if self.keyword is not None:
3923
+ output.append(self.keyword)
3921
3924
  if self.usage is not None:
3922
3925
  output.append(self.usage.dump())
3923
3926
  return " ".join(output)
@@ -3929,6 +3932,7 @@ class DefaultInterfaceEnd:
3929
3932
  "isAbstract": self.isAbstract,
3930
3933
  "isVariation": self.isVariation,
3931
3934
  "isEnd": self.isEnd,
3935
+ "keyword": self.keyword,
3932
3936
  "usage": self.usage.get_definition() if self.usage else None,
3933
3937
  }
3934
3938
 
@@ -329,10 +329,10 @@ class SymbolTable:
329
329
  return self._parent.lookup(name, from_child=True)
330
330
  return None
331
331
 
332
- def build_from_model(self, model: Any) -> None:
332
+ def build_from_model(self, model: Any, lib_roots: list[Path] | None = None) -> None:
333
333
  """Walk the model tree and populate the symbol table."""
334
334
  self._walk_element(model, self)
335
- self._resolve_imports(self)
335
+ self._resolve_imports(self, lib_roots)
336
336
  self._propagate_public_imports(self)
337
337
 
338
338
  # -- internals -----------------------------------------------------------
@@ -380,14 +380,14 @@ class SymbolTable:
380
380
  if child_type == "Import":
381
381
  table._imports.append(child)
382
382
 
383
- def _resolve_imports(self, table: SymbolTable) -> None:
383
+ def _resolve_imports(self, table: SymbolTable, lib_roots: list[Path] | None = None) -> None:
384
384
  """Resolve all imports for this scope and its children."""
385
385
  for imp in table._imports:
386
- self._resolve_single_import(imp, table)
386
+ self._resolve_single_import(imp, table, lib_roots)
387
387
 
388
388
  # Recurse into children
389
389
  for child_table in table._children.values():
390
- self._resolve_imports(child_table)
390
+ self._resolve_imports(child_table, lib_roots)
391
391
 
392
392
  def _propagate_public_imports(self, table: SymbolTable) -> None:
393
393
  """Propagate public and protected imports through the namespace hierarchy.
@@ -429,7 +429,7 @@ class SymbolTable:
429
429
  # Recurse into children
430
430
  self._propagate_public_imports(child_table)
431
431
 
432
- def _resolve_single_import(self, imp: Any, table: SymbolTable) -> None:
432
+ def _resolve_single_import(self, imp: Any, table: SymbolTable, lib_roots: list[Path] | None = None) -> None:
433
433
  """Resolve a single Import object into the symbol table."""
434
434
  if not imp.children:
435
435
  return
@@ -441,9 +441,9 @@ class SymbolTable:
441
441
  child_type = type(import_child).__name__
442
442
 
443
443
  if child_type == "MembershipImport":
444
- self._resolve_membership_import(import_child, table, visibility)
444
+ self._resolve_membership_import(import_child, table, visibility, lib_roots)
445
445
  elif child_type == "NamespaceImport":
446
- self._resolve_namespace_import(import_child, table, visibility)
446
+ self._resolve_namespace_import(import_child, table, visibility, lib_roots)
447
447
 
448
448
  def _extract_import_visibility(self, imp: Any) -> str:
449
449
  """Extract visibility keyword from an Import object.
@@ -471,7 +471,7 @@ class SymbolTable:
471
471
  else:
472
472
  return "private"
473
473
 
474
- def _resolve_membership_import(self, mem_import: Any, table: SymbolTable, visibility: str) -> None:
474
+ def _resolve_membership_import(self, mem_import: Any, table: SymbolTable, visibility: str, lib_roots: list[Path] | None = None) -> None:
475
475
  """Resolve a MembershipImport (import specific element)."""
476
476
  imported_mem = getattr(mem_import, "membership", None)
477
477
  if imported_mem is None:
@@ -492,8 +492,14 @@ class SymbolTable:
492
492
  simple_name = names[-1]
493
493
  table._imported_symbols[simple_name] = element
494
494
  table._import_visibility[simple_name] = visibility
495
+ else:
496
+ # Fall back to LibrarySymbolIndex for library symbols
497
+ if ref_str in LibrarySymbolIndex.get_symbols(lib_roots):
498
+ simple_name = names[-1]
499
+ table._imported_symbols[simple_name] = ref_str
500
+ table._import_visibility[simple_name] = visibility
495
501
 
496
- def _resolve_namespace_import(self, ns_import: Any, table: SymbolTable, visibility: str) -> None:
502
+ def _resolve_namespace_import(self, ns_import: Any, table: SymbolTable, visibility: str, lib_roots: list[Path] | None = None) -> None:
497
503
  """Resolve a NamespaceImport (import all from namespace)."""
498
504
  imported_ns = getattr(ns_import, "namespace", None)
499
505
  if imported_ns is None:
@@ -512,17 +518,33 @@ class SymbolTable:
512
518
  # Find the target namespace table
513
519
  ref_str = "::".join(names)
514
520
  target_table = self._find_namespace_table(ref_str, table)
515
- if target_table is None:
516
- return
517
-
518
- # Import all symbols from the target namespace
519
- for sym_name, element in target_table._symbols.items():
520
- table._imported_symbols[sym_name] = element
521
- table._import_visibility[sym_name] = visibility
522
-
523
- # If recursive, also import from all child namespaces
524
- if is_recursive:
525
- self._recursive_import(target_table, table, visibility)
521
+ if target_table is not None:
522
+ # Import all symbols from the target namespace
523
+ for sym_name, element in target_table._symbols.items():
524
+ table._imported_symbols[sym_name] = element
525
+ table._import_visibility[sym_name] = visibility
526
+
527
+ # If recursive, also import from all child namespaces
528
+ if is_recursive:
529
+ self._recursive_import(target_table, table, visibility)
530
+ else:
531
+ # Fall back to LibrarySymbolIndex for library namespaces
532
+ prefix = ref_str + "::"
533
+ lib_symbols = LibrarySymbolIndex.get_symbols(lib_roots)
534
+ for sym in lib_symbols:
535
+ if sym.startswith(prefix):
536
+ simple_name = sym[len(prefix):]
537
+ # Only import direct children (no nested :: in the remainder)
538
+ if "::" not in simple_name:
539
+ table._imported_symbols[simple_name] = sym
540
+ table._import_visibility[simple_name] = visibility
541
+ elif is_recursive:
542
+ # For recursive imports, also import deeply nested symbols
543
+ # Use the next-level name as the imported name
544
+ next_name = simple_name.split("::")[0]
545
+ if next_name not in table._imported_symbols:
546
+ table._imported_symbols[next_name] = sym
547
+ table._import_visibility[next_name] = visibility
526
548
 
527
549
  def _recursive_import(self, source_table: SymbolTable, dest_table: SymbolTable, visibility: str) -> None:
528
550
  """Recursively import symbols from all child namespaces."""
@@ -989,7 +1011,7 @@ class SemanticAnalyzer:
989
1011
 
990
1012
  # Step 1: Build symbol table
991
1013
  symtab = SymbolTable()
992
- symtab.build_from_model(model)
1014
+ symtab.build_from_model(model, lib_roots)
993
1015
 
994
1016
  # Step 2: Validate imports (check if import targets exist)
995
1017
  issues.extend(self._validate_imports(symtab, lib_roots))
File without changes
File without changes
File without changes