What type of issue is this?
Prerequisites
Description
The writer hard-codes four notation choices the spec does not rank. Expose each as a setting on
SysML2.NET.Serializer.TextualNotation/Writers/TextualNotationWriterContext.cs, alongside the
existing EmitOperatorParentheses, defaulted to current behaviour so no baseline moves.
1. PreferDeclaredNameForRequirements — emit : MassLimitationRequirement, not : '1'.
Fix site: QueryPreferredRawName in Writers/NameResolutionCache.cs. Must be scoped to
RequirementDefinition/RequirementUsage — a global flip was reverted in folder 09 (breaks
kg → kilogram).
2. PreferAliasNames — emit PlaneAngleValue, not AngularMeasureValue. Does not fit
QueryPreferredRawName (an alias is a memberName on another Membership); lands in the index
build. Needs a tie-break (21 library targets have 2 aliases), a visibility check, and a
qualified-name fallback (an alias never appears in qualifiedName).
3. EmitOptionalKeywords — emit or omit the keywords the grammar spells as an OPTIONAL BARE
terminal: EnumeratedValue = 'enum'? Usage, MetadataBodyUsage = 'ref'? ( ':>>' | 'redefines' )? …,
and the KerML 'feature'? / 'of'? / 'first'? productions (6 sites across both grammars, all
found by '…' ? with no ?=). Such a terminal sets no property, so nothing in the abstract syntax
records whether the author wrote it and both spellings re-parse to the identical model —
enum e1; ≡ e1;, ref :>> x ≡ :>> x.
4. PreferKeywordOverSymbol — emit the word form instead of the symbolic form where the lexical
rules define both, e.g. subsets for :>, redefines for :>>, references for ::>,
specializes for :> on a Specialization, defined by for : in a FeatureTyping. The
SUBSETS = ':>' | 'subsets'-style productions make the two spellings pure synonyms — same token,
same model — so this is presentational only.
Tasks:
Steps to Reproduce
N/A — feature request.
System Configuration
- SysML2.NET version: 0.23.0
- Environment: n/a
- .NET Framework version: n/a
What type of issue is this?
Prerequisites
Description
The writer hard-codes four notation choices the spec does not rank. Expose each as a setting on
SysML2.NET.Serializer.TextualNotation/Writers/TextualNotationWriterContext.cs, alongside theexisting
EmitOperatorParentheses, defaulted to current behaviour so no baseline moves.1.
PreferDeclaredNameForRequirements— emit: MassLimitationRequirement, not: '1'.Fix site:
QueryPreferredRawNameinWriters/NameResolutionCache.cs. Must be scoped toRequirementDefinition/RequirementUsage— a global flip was reverted in folder 09 (breakskg→kilogram).2.
PreferAliasNames— emitPlaneAngleValue, notAngularMeasureValue. Does not fitQueryPreferredRawName(an alias is amemberNameon another Membership); lands in the indexbuild. Needs a tie-break (21 library targets have 2 aliases), a visibility check, and a
qualified-name fallback (an alias never appears in
qualifiedName).3.
EmitOptionalKeywords— emit or omit the keywords the grammar spells as an OPTIONAL BAREterminal:
EnumeratedValue = 'enum'? Usage,MetadataBodyUsage = 'ref'? ( ':>>' | 'redefines' )? …,and the KerML
'feature'?/'of'?/'first'?productions (6 sites across both grammars, allfound by
'…' ?with no?=). Such a terminal sets no property, so nothing in the abstract syntaxrecords whether the author wrote it and both spellings re-parse to the identical model —
enum e1;≡e1;,ref :>> x≡:>> x.4.
PreferKeywordOverSymbol— emit the word form instead of the symbolic form where the lexicalrules define both, e.g.
subsetsfor:>,redefinesfor:>>,referencesfor::>,specializesfor:>on aSpecialization,defined byfor:in aFeatureTyping. TheSUBSETS = ':>' | 'subsets'-style productions make the two spellings pure synonyms — same token,same model — so this is presentational only.
Tasks:
QueryPreferredRawName, metaclass-scopedRuleElement.IsOptionalin the generator'sTerminalElementarm, gated on setting 3[TestCase]per non-default setting with its ownExpected/varianttextual-notation-reviewerpassSteps to Reproduce
N/A — feature request.
System Configuration