Repository navigation
Conversation
cbrun
force-pushed
the
cbr/serializer-validation-cases
branch
3 times, most recently
from
November 27, 2026 12:39
89d3c9f to
e94363a
Compare
The serializer wrote the direction and the derived/abstract/constant modifiers of an end feature before end (in end left : Vehicle), which the parser rejects: defaultReferenceUsage only accepts refPrefix after end. They are now written right after end, as in the source text. Covered by connections/end-feature-prefixes.sysml. Signed-off-by: cbrun <cedric.brun@obeo.fr>
…dy field A metadata body field that redefines two features (:>> level :>> limit;) was written as :>> level, limit;, which the parser rejects: metadataBodyUsage takes a single ownedRedefinition before its featureSpecializationPart. Only the first redefinition is now written as the field name, the others as their own clauses. Normalized output used the generic usage declaration for these fields, which groups the redefinitions the same way; it now uses the field form too. Every serializer and parser fixture keeps its round trip. Covered by metadata/metadata-body-feature-with-two-redefinitions.sysml. Signed-off-by: cbrun <cedric.brun@obeo.fr>
…ce usages snapshot occurrence captured; and timeslice occurrence phase; were written as snapshot captured; and timeslice phase;: the serializer always used the compact portionUsage form for plain occurrence usages, so round-trip output lost the occurrence keyword of the source. The parser now marks a portion kind followed by a usage keyword with PORTION_KIND_BEFORE_USAGE_KEYWORD, and the serializer keeps occurrence when the marker is present. Models without text adapters keep the compact form. The text-adapter goldens of the parser fixtures that write timeslice occurrence gain the new marker. Covered by declarations/portion-usage-occurrence-keyword.sysml. Signed-off-by: cbrun <cedric.brun@obeo.fr>
succession first prepare then [1] dispatch; lost its [1]: the serializer treated [1] as the implicit multiplicity of a succession end and wrote it only for a source whose target had another multiplicity. The parser creates the cross multiplicity of a connector end only from text, so leaving it out dropped it from the model. Every multiplicity of a succession or transition end is now written. Covered by actions/succession-end-multiplicities.sysml. Signed-off-by: cbrun <cedric.brun@obeo.fr>
binding equality bind left = right { end ref ::> extra; } and the same
body after connect left to right lost their body: the body content test
of connectors ignored every unnamed element as a generated helper, so
the extra end, which only references extra, made no body. It now counts
unnamed reference usages that designate something as user-written, as
variant memberships already did.
Covered by connections/binding-connector-body-end.sysml and
connections/connection-usage-body-end.sysml.
Signed-off-by: cbrun <cedric.brun@obeo.fr>
transition change first waiting then running { attribute trace; } lost
its attribute: transitions ended with the restricted statement body
(comments and metadata only), while every transition rule ends with a
full actionBody. The members after the transition succession, which
closes the declaration, are now written in the body; trigger, guard and
effect memberships stay in the declaration wherever they are.
Covered by states/transition-usage-body.sysml.
Signed-off-by: cbrun <cedric.brun@obeo.fr>
…quirement
satisfy requirement explicit : Required { subject participant redefines
Required::participant; } was written as satisfy requirement explicit :
Required by Required::participant {}: any untyped subject whose
redefinition gave an endpoint path was taken for the by clause. Only a
subject with the shape of satisfactionParameter (unidentified, untyped,
valued by the satisfying feature) is now written after by; other
subjects stay in the body.
Covered by requirements/satisfy-requirement-body-subject.sysml.
Signed-off-by: cbrun <cedric.brun@obeo.fr>
end crossPart : Member [0..1] :> allMembers item left : Member; lost the typing and the subsetting of its cross feature: the end prefix only wrote the cross feature name, its multiplicity and nonunique, while ownedCrossFeature declares it like any usage. The cross feature is now written with the specialization writer, which keeps its clauses, its multiplicity and its modifiers in source order. Covered by connections/owned-cross-feature.sysml. Signed-off-by: cbrun <cedric.brun@obeo.fr>
port def Plug; // note was serialized without its note: the empty rule portConjugation, which builds the implicit conjugated port definition, starts on the next token of the input, so it took the notes written before that token as its leading comments, and the serializer never writes that generated subtree. An end action now leaves those notes when its rule consumed no token; the next element takes them. The same happened to a note after a join node followed by a shorthand succession. Covered by comments/note-after-port-definition.sysml, comments/own-line-note-after-port-definition.sysml and comments/note-after-join-node.sysml. Signed-off-by: cbrun <cedric.brun@obeo.fr>
state mode { // note followed by entry action prepare; lost its note:
the parser attaches it to the StateSubactionMembership as a leading
note, and the state subaction writer, unlike the other membership
writers, wrote neither the leading nor the trailing notes of its
membership. It now writes them around the subaction.
Covered by comments/note-after-state-usage-opening-brace.sysml and
comments/note-after-state-definition-opening-brace.sysml.
Signed-off-by: cbrun <cedric.brun@obeo.fr>
…xed members variant part option; // note lost its note: the parser attaches it to the VariantMembership as a trailing note, and the writer of keyword-prefixed memberships (variant, verify, require...) wrote only the leading notes of the membership. It now writes the trailing notes after the owned declaration. Covered by comments/note-after-variant-usage.sysml. Signed-off-by: cbrun <cedric.brun@obeo.fr>
…references a feature
connection link { // note followed by end ::> origin; lost its note: the
parser attaches it to the unnamed reference usage, which the membership
writer renders through the forced declaration, and that path skips the
notes that element dispatch writes. They are now written before it.
Covered by comments/note-after-connection-usage-opening-brace.sysml.
Signed-off-by: cbrun <cedric.brun@obeo.fr>
calc def Compute { // note followed by the result expression 2 wrote the
note twice: the parser attaches it to the literal, element dispatch
writes the leading notes of every element, and the expression text of a
standalone expression added them again. A standalone expression is now
rendered without the notes its dispatch already wrote.
Covered by comments/note-before-result-expression.sysml.
Signed-off-by: cbrun <cedric.brun@obeo.fr>
connection link connect entrance // note followed by to exitPort; lost its note at parse time: no rule starts or ends around the note, so no element took it. The parser now attaches the notes that follow a connector end to that end, as it does for accept actions, and the binary and n-ary connector end writers write them right after the end, terminating a line note so that it cannot swallow the next end. Covered by comments/note-between-connection-ends.sysml. Signed-off-by: cbrun <cedric.brun@obeo.fr>
(1, 2).{ in operand : T; attribute bias : T; operand + bias } lost the
attribute keyword, return parameters lost return, binding connectors
were dropped and a body without result expression became .{}: body
expressions are rendered as a string that only knows named parameters
and the result expression. When a body has other members, or no result
expression, its members are now rendered with the element renderers
into a separate text (SysMLTextRenderer#relationshipsText), which the
expression text embeds; other bodies keep the compact form.
Covered by expressions/body-expression-without-result.sysml,
expressions/body-expression-return-parameter.sysml,
expressions/body-expression-attribute-usage.sysml and
expressions/body-expression-binding-connector.sysml.
Signed-off-by: cbrun <cedric.brun@obeo.fr>
…sion
(1, 2).{ // note followed by in operand : T; operand + operand lost its
note: the parser attaches it to the operand parameter, and the compact
text of a body expression wrote the parameters without their leading
notes. They are now written before each parameter, a line note being
terminated so that it cannot swallow the declaration.
Covered by expressions/body-expression-note.sysml.
Signed-off-by: cbrun <cedric.brun@obeo.fr>
cbrun
force-pushed
the
cbr/serializer-validation-cases
branch
from
November 27, 2026 15:59
e94363a to
be46624
Compare
cbrun
marked this pull request as ready for review
November 27, 2026 16:04
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SysML validation cases exposed declarations and comments that could change or disappear when a model was parsed and serialized again.
Verification
Added 23 SysML regression fixtures to the text and model round-trip suites. Ran 6,670 parser tests and 9,784 serializer tests with no failures, including 2,771 text round trips and 3,419 model round trips after removing the parser text adapters.
Auto review
Project management
queue:andreview-window:labels been added to the pull request? (In case of doubt, start with the labelsqueue: triageandreview-window: unscheduled)package:,type:)Changelog and release notes
CHANGELOG.adoc+doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adocbeen updated to reference the relevant issues?CHANGELOG.adoc?CHANGELOG.adoc?doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?Key highlightssection indoc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?Documentation
Tests