Skip to content

Declaration modifiers: canonical block form, package visibility, UML vocabulary - #49

Merged
ronaldtse merged 1 commit into
mainfrom
feat/modifier-canonical
Oct 6, 2026
Merged

ronaldtse merged 1 commit into
mainfrom
feat/modifier-canonical

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Implements the spec amendment signed off as D1–D5 (spec text landed in lutaml/docs spec/element-modifiers, merged — RS 3001 par. Declaration modifiers + RS 3010 Operations).

  • Canonical in-block declarations (D1): visibility {level} in class/enum bodies; abstract true|false maps onto is_abstract. The keyword prefix is now spec-defined sugar that expands to these.
  • Package visibility (D3): private package Ceramics { } parses. The package visibility keyword carries a declaration-keyword lookahead guard, so a bare package P { } still binds as a package declaration and package class Foo { } stays a package-visible class.
  • UML 2.5 vocabulary (D2): ~ now maps to package visibility (was "friendly"); GraphViz symbol table gains ~.
  • D4/D5 needed no code: symbols remain attribute-only sugar; operations were documented in RS 3010 with structural-metadata semantics.

683 examples, 0 failures (5 new modifier specs).

…vocabulary

Implements the signed-off RS 3001 par. Declaration modifiers (lutaml
docs PR: spec/element-modifiers):

- canonical in-block declarations: `visibility {level}` in class/enum
  bodies (flows through the generic attribute path) and
  `abstract true|false` mapping onto `is_abstract`
- package declarations take the visibility prefix again: the `package`
  visibility keyword is guarded by a declaration-keyword lookahead, so
  `private package P { }` parses while bare `package P { }` still binds
  as a package declaration
- vocabulary: `~` maps to UML 2.5 `package` visibility (was "friendly");
  the GraphViz symbol table gains the `~` mapping
@ronaldtse
ronaldtse merged commit e4dc1f7 into main Oct 6, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant