-
Notifications
You must be signed in to change notification settings - Fork 175
bug(#4504): FQN resolution for compact array base #4637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughThis PR adds comprehensive support for compact array parsing in the EO language parser. It includes new test resources for integration and parser tests, modifies the CompactArrayFqn.java logic to handle HOME and XI prefix conditions, adds XSLT templates for FQN resolution with alias lookup and default Φ prefix application, and updates existing test assertions to reference fully-qualified names. Changes
Sequence DiagramsequenceDiagram
participant Parser
participant CompactArrayFqn
participant FQN Resolution
Parser->>CompactArrayFqn: process base attribute
alt XI() is not null
CompactArrayFqn->>FQN Resolution: set fqn = "ξ.<name>"
else HOME() is present and XI() is null
CompactArrayFqn->>FQN Resolution: set fqn = "Φ.org.eolang.<name>"
else HOME() and XI() both null
CompactArrayFqn->>FQN Resolution: keep fqn = "<name>"
end
FQN Resolution->>Parser: return resolved fqn
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes The changes include conditional logic refactoring in CompactArrayFqn.java, XSLT template additions with a duplicate pattern, and multiple test resource files requiring pattern consistency verification. While many files are added, they follow consistent structures; however, the logic density in the Java and XSLT components and the presence of duplicate XSLT templates warrant careful review. Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (2)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-08-12T15:24:05.011ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
🔇 Additional comments (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (4)
eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/compact-array.yaml (1)
13-16: Strengthen the assertion to catch unresolved compacts.Add an assertion that no @compact:* bases leak into this pack stage.
Example:
asserts: - /object[not(errors)] - //java[contains(text(), 'base="Φ.org.eolang.tt.sprintf"')] + - /object[count(//o[starts-with(@base,'@compact:')])=0]eo-parser/src/main/java/org/eolang/parser/CompactArrayFqn.java (1)
49-57: Good sentinel approach; add a brief contract and a defensive guard.The @compact:%s marker is clear and plays well with resolve-compacts.xsl. Please:
- Document in class Javadoc that @compact:* is a transient marker resolved later; unresolved markers should be an error.
- Optionally guard against empty NAME() to avoid emitting "@compact:" (assert or precondition).
Example:
final class CompactArrayFqn implements Text { + /** + * Produces a transient FQN: + * - "@compact:<name>" when unresolved; resolved later by resolve-compacts.xsl. + * - "Φ.org.eolang.<name>" when HOME present. + * - "ξ.<name>" when XI present. + */ @Override public String asString() { final String name = this.context.NAME().stream() .map(ParseTree::getText) .collect(Collectors.joining(".")); + if (name.isEmpty()) { + throw new IllegalStateException("Compact array name is empty"); + } final String fqn; ...eo-parser/src/test/resources/org/eolang/parser/eo-syntax/sugared-array-with-composite-name.yaml (1)
8-9: Also assert that no @compact: remains after canonicalization.*Prevents regressions where compacts aren’t fully resolved.
asserts: - /object[not(errors)] - //o[@base='Φ.org.eolang.foo.bar']/o[@base='Φ.org.eolang.x'] - //o[@base='Φ.org.eolang.foo.bar']//o[@base='Φ.org.eolang.y'] + - /object[count(//o[starts-with(@base,'@compact:')])=0]eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/validate-resolve-before-stars.yaml (1)
5-9: Sheet order looks right here; add an explicit safety check.Nice that resolve-compacts.xsl runs before validate/resolve-before-stars in this test. Add a check that no @compact:* nodes remain.
asserts: - /object/errors/error[@line='3' and @severity='error'] ... - /object[count(//o[@before-star])=0] + - /object[count(//o[starts-with(@base,'@compact:')])=0]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
eo-integration-tests/src/test/resources/org/eolang/snippets/compact-array.yaml(1 hunks)eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/compact-array.yaml(1 hunks)eo-parser/src/main/java/org/eolang/parser/CompactArrayFqn.java(1 hunks)eo-parser/src/main/java/org/eolang/parser/EoSyntax.java(1 hunks)eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl(1 hunks)eo-parser/src/test/java/org/eolang/parser/CompactArrayFqnTest.java(1 hunks)eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/validate-resolve-before-stars.yaml(1 hunks)eo-parser/src/test/resources/org/eolang/parser/eo-syntax/compact-array-with-defined-first-part.yaml(1 hunks)eo-parser/src/test/resources/org/eolang/parser/eo-syntax/compact-array.yaml(1 hunks)eo-parser/src/test/resources/org/eolang/parser/eo-syntax/compact-sprintf-aliased.yaml(1 hunks)eo-parser/src/test/resources/org/eolang/parser/eo-syntax/sugared-array-with-composite-name-aliased.yaml(1 hunks)eo-parser/src/test/resources/org/eolang/parser/eo-syntax/sugared-array-with-composite-name.yaml(1 hunks)
🧰 Additional context used
🪛 GitHub Actions: copyrights
eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl
[warning] 1-1: Missed: resolve-compacts.xsl
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: trufflehog
- GitHub Check: benchmark
- GitHub Check: mvn (windows-2022, 23)
- GitHub Check: mvn (macos-15, 23)
🔇 Additional comments (9)
eo-parser/src/test/java/org/eolang/parser/CompactArrayFqnTest.java (1)
22-22: Test expectation updated correctly for new compact array behavior.The change from
"foo *1,foo"to"foo *1,@compact:foo"correctly reflects the new behavior where simple names in compact arrays are prefixed with@compact:during parsing before being resolved by the XSLT transformation.eo-parser/src/test/resources/org/eolang/parser/eo-syntax/compact-array.yaml (1)
1-17: LGTM! Test correctly verifies compact array base resolution.The test properly validates that
tt.sprintf(without an alias) resolves toΦ.org.eolang.tt.sprintfin the compact array context, which is the expected default namespace behavior.eo-integration-tests/src/test/resources/org/eolang/snippets/compact-array.yaml (1)
1-18: LGTM! Good internationalization test coverage.The integration test appropriately validates compact array functionality with non-ASCII arguments (上海), ensuring the feature works correctly with internationalized content.
eo-parser/src/test/resources/org/eolang/parser/eo-syntax/sugared-array-with-composite-name-aliased.yaml (1)
1-16: LGTM! Test correctly verifies alias-based resolution.The test properly validates that
barresolves toΦ.org.eolang.foo.barvia the declared alias, and that child elementsxandyare also fully qualified with the EO namespace.eo-parser/src/test/resources/org/eolang/parser/eo-syntax/compact-sprintf-aliased.yaml (1)
1-18: LGTM! Test correctly verifies aliased sprintf resolution.The test appropriately validates that
sprintfresolves toΦ.org.eolang.tt.sprintfvia the declared alias, and that the string argument is properly typed asΦ.org.eolang.string.eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl (3)
14-16: LGTM! Variable extraction logic is correct.The string manipulation correctly handles both simple names (e.g., "foo") and composite names (e.g., "foo.bar.baz") by extracting the head before the first dot and the tail after it.
19-23: Verify whether single-level scope lookup is intended design or a limitation.The XPath
parent::o/parent::o/o[@name = $head]limits scope resolution to checking if the name is available as a child of the grandparent (i.e., at the same level as the parent element). This implements single-level local scope rather than searching the entire ancestor chain. The only test file referencing this stylesheet (validate-resolve-before-stars.yaml) tests star expansion validation, not nested scope scenarios. Confirm whether this single-level lookup matches the EoLang language semantics or if ancestor-chain resolution should be supported.
24-28: Verify alias resolution with composite names.When an alias is found (line 26), the code sets
baseto$aliasdirectly. However, if$qcontains dots (e.g., "foo.bar"), and an alias exists for "foo" (e.g., "org.eolang.baz"), this would resolve to just "org.eolang.baz" instead of "org.eolang.baz.bar".Confirm whether the tail portion should be appended to the alias when present:
<xsl:when test="string-length($alias) > 0"> <xsl:attribute name="base"> - <xsl:value-of select="$alias"/> + <xsl:value-of select="if (string-length($tail) > 0) then concat($alias, '.', $tail) else $alias"/> </xsl:attribute> </xsl:when>Check existing test cases to verify the expected behavior:
eo-parser/src/test/resources/org/eolang/parser/eo-syntax/compact-array-with-defined-first-part.yaml (1)
8-9: Mixed resolution behavior is intentional and correctly implemented.The
resolve-compacts.xsllogic confirms the expected behavior:
- Line 19: Checks if the first part of a composite name (e.g.,
fooinfoo.bar) is defined in parent scope- If defined locally (line 21): The composite name is kept as-is (
foo.bar)- If not defined (line 31): Simple references are resolved to the default namespace (
Φ.org.eolang.x,Φ.org.eolang.y)In the test case,
foois defined in scope, sofoo.barremains unchanged. However,xandyare not defined references and correctly resolve to the EO namespace.
eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (3)
eo-parser/src/test/resources/org/eolang/parser/eo-syntax/sugared-array-with-composite-name-aliased.yaml (1)
6-10: Add a guard assert to ensure all compacts are fully resolvedTo catch regressions, assert that no "@compact:" bases remain after the pipeline.
Proposed addition:
asserts: - /object[not(errors)] - //o[@base='Φ.org.eolang.foo.bar']/o[@base='Φ.org.eolang.x'] - //o[@base='Φ.org.eolang.foo.bar']//o[@base='Φ.org.eolang.y'] + - count(//o[starts-with(@base, '@compact:')])=0eo-parser/src/test/resources/org/eolang/parser/eo-syntax/compact-sprintf-aliased.yaml (1)
6-9: Strengthen assertions to cover stdout alias and no residual compactsCurrently only sprintf is asserted. Also assert stdout’s FQN and absence of any unresolved compacts.
Suggested additions:
asserts: - /object[not(errors)] - //o[@base='Φ.org.eolang.tt.sprintf']/o[@base='Φ.org.eolang.string'] + - //o[@base='Φ.org.eolang.io.stdout'] + - count(//o[starts-with(@base, '@compact:')])=0eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl (1)
22-22: Scope probe uses fixed depth; prefer nearest lexical ownerparent::o/parent::o may miss valid bindings or overreach depending on nesting. Use the nearest owner “o”.
Replace:
- <xsl:when test="parent::o/parent::o/o[@name = $head]"> + <xsl:when test="ancestor::o[1]/o[@name = $head]">This checks the immediate lexical scope reliably in XMIR hierarchies.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
eo-integration-tests/src/test/resources/org/eolang/snippets/compact-array.yaml(1 hunks)eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/compact-array.yaml(1 hunks)eo-parser/src/main/java/org/eolang/parser/CompactArrayFqn.java(1 hunks)eo-parser/src/main/java/org/eolang/parser/EoSyntax.java(1 hunks)eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl(1 hunks)eo-parser/src/test/java/org/eolang/parser/CompactArrayFqnTest.java(1 hunks)eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/validate-resolve-before-stars.yaml(1 hunks)eo-parser/src/test/resources/org/eolang/parser/eo-syntax/compact-array-with-defined-first-part.yaml(1 hunks)eo-parser/src/test/resources/org/eolang/parser/eo-syntax/compact-array.yaml(1 hunks)eo-parser/src/test/resources/org/eolang/parser/eo-syntax/compact-sprintf-aliased.yaml(1 hunks)eo-parser/src/test/resources/org/eolang/parser/eo-syntax/sugared-array-with-composite-name-aliased.yaml(1 hunks)eo-parser/src/test/resources/org/eolang/parser/eo-syntax/sugared-array-with-composite-name.yaml(1 hunks)
🔇 Additional comments (9)
eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/compact-array.yaml (1)
1-24: LGTM! Well-structured test resource for compact array transpilation.The test resource correctly validates the new FQN resolution behavior, ensuring that
tt.sprintfis resolved toΦ.org.eolang.tt.sprintfafter transpilation. The use of the+aliasdirective and the assertion structure are appropriate.eo-integration-tests/src/test/resources/org/eolang/snippets/compact-array.yaml (1)
1-18: LGTM! Good integration test with internationalization coverage.The integration test appropriately validates end-to-end execution of compact array resolution with internationalized input (上海), ensuring the full pipeline works correctly from parsing through execution.
eo-parser/src/test/resources/org/eolang/parser/eo-syntax/sugared-array-with-composite-name.yaml (1)
8-9: LGTM! Assertions correctly reflect the new FQN resolution.The updated assertions appropriately expect
Φ.org.eolang.foo.barsincefoois not defined in the local scope. This aligns with the new compact array FQN resolution behavior.eo-parser/src/test/java/org/eolang/parser/CompactArrayFqnTest.java (1)
22-22: LGTM! Test expectation correctly updated.The updated expectation
@compact:foocorrectly reflects the newCompactArrayFqn.asString()behavior when neither HOME nor XI contexts are present.eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/validate-resolve-before-stars.yaml (2)
6-6: LGTM! Resolve-compacts transform correctly integrated.The addition of
resolve-compacts.xslappropriately extends the transformation pipeline to handle compact reference resolution.
14-14: LGTM! Assertion updated to reflect resolved base name.The assertion correctly expects
Φ.org.eolang.sprintfafter the compact reference resolution, validating the new transformation behavior.eo-parser/src/test/resources/org/eolang/parser/eo-syntax/compact-array.yaml (1)
1-17: LGTM! Parser test resource correctly validates compact array resolution.The test appropriately validates that
tt.sprintfis resolved toΦ.org.eolang.tt.sprintfduring parsing, complementing the transpilation tests.eo-parser/src/test/resources/org/eolang/parser/eo-syntax/compact-array-with-defined-first-part.yaml (1)
1-16: LGTM! Test correctly validates scope-aware FQN resolution.This test appropriately verifies that when
foois defined in the local scope (line 13), the compact array referencefoo.barremains asfoo.barrather than being resolved toΦ.org.eolang.foo.bar. However, the unresolved child references (xandy) are correctly expected to be resolved toΦ.org.eolang.xandΦ.org.eolang.y. This demonstrates proper scope-aware resolution behavior.eo-parser/src/main/java/org/eolang/parser/EoSyntax.java (1)
89-90: Duplication is intentional—confirmed two-pass transformation approach.The transforms
validate-before-stars.xslandresolve-before-stars.xslappear at both lines 89-90 and lines 102-103 afterresolve-compacts.xsl(line 101). This is a deliberate two-pass validation/resolution pattern:
- First pass (lines 89-90): Validate and resolve initial compact references
- Compact resolution (line 101): Transform
@compact:onamemarkers- Second pass (lines 102-103): Re-validate and resolve newly created references
The transformation pipeline comment ("order of transformations matters"; "strongly coupled") confirms this multi-phase approach is intentional. The pattern is logically sound: the first pass processes initial references, then
resolve-compactscreates new references that require a second validation/resolution pass.
eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl
Outdated
Show resolved
Hide resolved
🚀 Performance AnalysisAll benchmarks are within the acceptable range. No critical degradation detected (threshold is 100%). Please refer to the detailed report for more information. Click to see the detailed report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl (1)
2-5: Copyright header is now present.The copyright warning from the previous review has been addressed. The file now includes the proper SPDX header consistent with the repository's standards.
🧹 Nitpick comments (1)
eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl (1)
18-18: Consider validating non-empty$q.If the input is exactly
@compact:(with no suffix),$qwill be empty, leading to a malformed FQN likeΦ.org.eolang.in the fallback case. Consider adding validation or documenting the assumption that@compact:is always followed by a non-empty name.Example validation approach:
<xsl:variable name="q" select="substring-after(., '@compact:')"/> <xsl:if test="string-length($q) = 0"> <xsl:message terminate="yes"> <xsl:text>Error: empty name after @compact: in </xsl:text> <xsl:value-of select="."/> </xsl:message> </xsl:if>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
eo-integration-tests/src/test/resources/org/eolang/snippets/compact-array.yaml(1 hunks)eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/compact-array.yaml(1 hunks)eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl(1 hunks)eo-parser/src/test/resources/org/eolang/parser/eo-syntax/compact-array.yaml(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- eo-integration-tests/src/test/resources/org/eolang/snippets/compact-array.yaml
- eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/compact-array.yaml
- eo-parser/src/test/resources/org/eolang/parser/eo-syntax/compact-array.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: mvn (macos-15, 23)
- GitHub Check: actionlint
- GitHub Check: mvn (windows-2022, 23)
- GitHub Check: benchmark
🔇 Additional comments (2)
eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl (2)
18-19: LGTM: Clean variable extraction logic.The use of
concat($q, '.')withsubstring-beforeis an elegant way to extract the first component while handling both simple names (e.g., "sprintf") and dotted names (e.g., "sprintf.format") correctly.
22-26: Scope resolution logic appears sound.The XPath
parent::o/parent::o/o[@name = $head]correctly checks for objects in the enclosing scope (siblings of the compact array's parent object), which aligns with the expected semantics for local name resolution.
eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl
Outdated
Show resolved
Hide resolved
eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl
Outdated
Show resolved
Hide resolved
…related validation and resolution
…ast()] for dynamic alias resolution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl (1)
8-8: Fix grammatical error in comment.Change "it's FQN" to "its FQN" (possessive form, not contraction).
Apply this diff:
- Here we go through all `@compact:oname` bases and resolve it's FQN: + Here we go through all `@compact:oname` bases and resolve its FQN:
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-17T14:21:45.031Z
Learnt from: h1alexbel
PR: objectionary/eo#4637
File: eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl:27-31
Timestamp: 2025-10-17T14:21:45.031Z
Learning: In the EO language aliasing system, only concrete objects (complete paths to objects, e.g., `org.eolang.io.stdout`) can be aliased, not intermediate packages or partial paths (e.g., `org.eolang.io`). This means aliases always point to final objects, not package prefixes.
Applied to files:
eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: benchmark
- GitHub Check: integration
- GitHub Check: qulice
- GitHub Check: snippets
- GitHub Check: mvn (windows-2022, 23)
- GitHub Check: trufflehog
- GitHub Check: mvn (ubuntu-24.04, 17)
- GitHub Check: mvn (ubuntu-24.04, 23)
- GitHub Check: mvn (macos-15, 23)
- GitHub Check: ort
🔇 Additional comments (4)
eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl (4)
1-6: LGTM! Copyright header properly added.The SPDX copyright header has been correctly added, addressing the previous pipeline warning. The file structure and namespace declarations are appropriate.
13-17: LGTM! Standard identity template correctly implemented.The identity template follows XSLT best practices for preserving document structure while allowing selective transformations.
18-39: Resolution logic correctly implements FQN resolution per EO aliasing constraints.The three-case resolution logic is sound:
- Local scope check: Returns the qualified name if the head exists in parent scope
- Alias resolution: Returns the aliased FQN using
part[last()]to correctly handle composite alias definitions- Default namespace: Falls back to
Φ.org.eolang.*for standard library objectsThe alias resolution correctly uses only the alias value without appending any tail from the composite name. This is correct given the EO language constraint that only concrete objects (not packages) can be aliased, which prevents scenarios where a composite name would have an aliased head requiring tail concatenation.
Based on learnings.
23-27: Single-level scope check is correct by design.The XPath
parent::o/parent::o/o[@name = $head]intentionally checks only the immediate parent scope, which aligns with EO's documented scoping semantics for compact notation resolution. The file's comment clarifies that step 1 resolves names "in the current scope"—meaning the immediate parent scope—not the full ancestor chain.This design choice is consistent with the codebase: other XSLT transformations use
ancestor::opatterns when full ancestor chain traversal is needed (e.g., line 26 in validate-abstracts.xsl). No test cases or bug reports indicate that nested scope resolution is required for compact notation, confirming this is working as intended.
|
@maxonfjvipon please check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@h1alexbel can we solve this problem without adding new @compact attribute and new XSL, but somehow just in XeListener?
@maxonfjvipon seems that we need full XMIR(with metas and top object, to check the scope). WDYT? |
|
@maxonfjvipon ^ WDYT? |
|
@h1alexbel can't we just map EO with such compact arrays to valid XMIR and leave this scope resolving to |
|
@maxonfjvipon seems that no, without compact FQN resolution, in this snippet: The <o base="tt.sprintf"...>Later, in <xsl:choose>
<xsl:when test="$first='Φ'">
<xsl:text>Phi.Φ</xsl:text>
</xsl:when>
<xsl:when test="$first='ξ'">
<xsl:value-of select="$rho"/>
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
<xsl:text>FQN must start with either with Φ or ξ, but </xsl:text>
<xsl:value-of select="$first"/>
<xsl:text> found</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose> |
|
@h1alexbel maybe it's better to fix the original XSL(s) which append corresponding prefixes and resolve FQNs |
…resolution into build-fqns.xsl
|
@maxonfjvipon updated. Take a look, please |
|
@maxonfjvipon reminder |
In this PR I've implemented correct FQN resolution for object
@baseof compact arrays. New XSLresolve-compactsresolves all@compact:onameleft during the parsing inCompactArrayFqn.javafor precise FQN construction, taking into account both: objects in scope, and present+aliase-s.see #4504
Summary by CodeRabbit
Release Notes
New Features
Tests