Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
d47deca
[fix] Serializer: write end feature prefixes after the end keyword
cbrun Nov 27, 2026
f1bfdb6
[fix] Serializer: write one redefinition as the name of a metadata bo…
cbrun Nov 27, 2026
9c0bb56
[fix] Serializer: keep the occurrence keyword of snapshot and timesli…
cbrun Nov 27, 2026
13ed32e
[fix] Serializer: keep the [1] multiplicity of succession ends
cbrun Nov 27, 2026
713f7ea
[fix] Serializer: keep the unnamed ends declared in a connector body
cbrun Nov 27, 2026
af26503
[fix] Serializer: write the body members of transition usages
cbrun Nov 27, 2026
89ccaad
[fix] Serializer: keep a declared subject in the body of a satisfy re…
cbrun Nov 27, 2026
dc37c48
[fix] Serializer: write the specializations of an owned cross feature
cbrun Nov 27, 2026
80dd16f
[fix] Parser: leave the notes before an empty rule to the next element
cbrun Nov 27, 2026
1eb6557
[fix] Serializer: write the notes of entry, do and exit members
cbrun Nov 27, 2026
f3620a1
[fix] Serializer: write the trailing notes of variant and other prefi…
cbrun Nov 27, 2026
b45154c
[fix] Serializer: write the notes of an unnamed reference usage that …
cbrun Nov 27, 2026
4478f58
[fix] Serializer: write the notes before a result expression once
cbrun Nov 27, 2026
a0960b1
[fix] Serializer: keep the notes written after a connector end
cbrun Nov 27, 2026
3d073ca
[fix] Serializer: write every member of a body expression
cbrun Nov 27, 2026
be46624
[fix] Serializer: write the notes before a parameter of a body expres…
cbrun Nov 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ occurrenceUsageKeyword:
occurrenceUsagePrefix:
(
endUsagePrefix
| basicUsagePrefix ('individual' {setTrue(occurrenceUsage_IsIndividual());})? (portionKind {set(occurrenceUsage_PortionKind());})?
| basicUsagePrefix ('individual' {setTrue(occurrenceUsage_IsIndividual());})? (portionKind {set(occurrenceUsage_PortionKind());} {attachPortionKindBeforeUsageKeyword();})?
) usageExtensionKeyword*
;

Expand Down Expand Up @@ -1108,8 +1108,8 @@ connectorEnd:
(ownedCrossMultiplicityMember {add(element_OwnedRelationship());})? (
(name {set(element_DeclaredName());}) referencesKeyword
)?
(ownedReferenceSubsetting {add(element_OwnedRelationship());})
) {end(_localctx);}
(target=ownedReferenceSubsetting {add(element_OwnedRelationship());})
) {attachFollowingComments($target.ctx);} {end(_localctx);}
;

ownedCrossMultiplicityMember:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,20 @@ public interface ITextAdapter extends Adapter {
*/
KeywordAdapter COMPACT_INDIVIDUAL_USAGE = new KeywordAdapter();

/**
* A snapshot or timeslice portion kind followed by a usage keyword, as opposed to the compact portion usage form
* where the portion kind alone declares an occurrence usage.
*
* <p>
* Examples:
* </p>
* <ul>
* <li><code>timeslice occurrence phase : Session;</code></li>
* <li><code>snapshot part captured;</code></li>
* </ul>
*/
KeywordAdapter PORTION_KIND_BEFORE_USAGE_KEYWORD = new KeywordAdapter();

/**
* A metadata usage introduced by the annotation shorthand <code>"@"</code>.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@ protected void attachCompactIndividualUsage() {
this.attach(ITextAdapter.COMPACT_INDIVIDUAL_USAGE);
}

protected void attachPortionKindBeforeUsageKeyword() {
this.attach(ITextAdapter.PORTION_KIND_BEFORE_USAGE_KEYWORD);
}

protected void attachMetadataAtSign() {
this.attach(ITextAdapter.METADATA_AT_SIGN);
}
Expand Down Expand Up @@ -894,7 +898,7 @@ private String rawBlockCommentText(ParserRuleContext ctx) {
}

private void attachLeadingComments(ParserRuleContext ctx, EObject eObject) {
if (ctx == null || ctx.getStart() == null || eObject == null || !(this.getTokenStream() instanceof CommonTokenStream commonTokenStream)) {
if (ctx == null || ctx.getStart() == null || eObject == null || isEmptyRule(ctx) || !(this.getTokenStream() instanceof CommonTokenStream commonTokenStream)) {
return;
}
List<Token> hiddenTokens = commonTokenStream.getHiddenTokensToLeft(ctx.getStart().getTokenIndex());
Expand All @@ -913,6 +917,16 @@ private void attachLeadingComments(ParserRuleContext ctx, EObject eObject) {
}
}

/**
* Tells whether the rule ending now consumed no token, such as {@code portConjugation} or {@code emptyParameterMember}.
* Its start token is the next token of the input, so the comments before that token belong to the next element, not
* to the element the empty rule builds. The context has no stop token yet when its end action runs.
*/
private boolean isEmptyRule(ParserRuleContext ctx) {
Token lastConsumedToken = this.getTokenStream().LT(-1);
return lastConsumedToken == null || lastConsumedToken.getTokenIndex() < ctx.getStart().getTokenIndex();
}

private void attachTrailingComments(ParserRuleContext ctx, EObject eObject) {
if (ctx == null || ctx.getStart() == null || ctx.getStop() == null || ctx.getStart() == ctx.getStop()
|| eObject == null) {
Expand Down

Large diffs are not rendered by default.

Loading
Loading