Skip to content

[Feature]: Textual Notation Scoped suppression of a keyword the current rule already implies #362

Description

@antoineatstariongroup

What type of issue is this?

  • Bug report
  • Feature request

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of the SysML2.NET
  • I have searched open and closed issues to ensure it has not already been reported

Description

Message : FlowUsage = OccurrenceUsagePrefix 'message' MessageDeclaration DefinitionBody { isAbstract = true } — the message keyword sets isAbstract, but RefPrefix's
isAbstract ?= 'abstract' emits it again, giving abstract message x of P[1];. Valid and
same AST as the pilot's message x of P[1];, so cosmetic only.

Add a per-element scope on TextualNotationWriterContext, mirroring SuspendOperatorContext:

public IDisposable SuppressImpliedProperty(Guid elementId, string propertyName)

Back it with a Dictionary<(Guid, string), int> counter, not a HashSet — a nested re-open must not have its inner dispose clear the outer suppression. Per-context state, never static.

Generator: emit the using in the rule emitter and consult it in the ?= conditional built at RuleProcessor.cs:531-547.

Two constraints, both load-bearing:

Hoist the scope. NonParsingAssignmentElement is processed in element order (RuleProcessor.ElementProcessing.cs:261) and the action is the last element of Message while the prefix is the first. Pre-scan the rule's elements and open above element 0.
Consult it only at ?= sites. Suppress only when the action sets P to V and a P ?= 'kw' token triggers on the same V. MultiplicityPart carries { isUnique = false } and emits nonunique from if (!poco.IsUnique) — same property, opposite polarity. A blanket rule deletes nonunique from 6 lines of folder 14's locked baseline.
Only one site fires today (isAbstract/Message); the other 13 action assignments in both grammars are inert. Blast radius on locked folders is zero.

Steps to Reproduce
N/A — feature request.

System Configuration
SysML2.NET version: 0.23.0
Environment: n/a
.NET Framework version: n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions