Skip to content

Resolve reserved directive keywords colliding with property names - #44

Merged
woksin merged 6 commits into
mainfrom
fix/reserved-keyword-collisions
Jul 29, 2026
Merged

Resolve reserved directive keywords colliding with property names#44
woksin merged 6 commits into
mainfrom
fix/reserved-keyword-collisions

Conversation

@woksin

@woksin woksin commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Added

  • A general @ escape for names that collide with a directive keyword. @tag TagType declares a property called tag, @authorize AuthorizationCode a property called authorize, @validate an enumeration value called validate, and @key = x a projection mapping onto key. The escape already existed in projections and now works for property lines, property mappings, enumeration values and projection from mappings everywhere. (Reserved directive keywords collide with property names with no escape syntax #27)

Fixed

woksin added 6 commits July 29, 2026 09:48
The printer needs to know which names collide with a directive keyword so it
can put the @ escape back. Keeping the sets in one place also documents the
collision surface in a single readable spot.
Every block decided what a line was from its first word alone, so a command
property named description, validate, handler or concurrency was a parse
error, and an event property named tag or an enumeration value named validate
was swallowed with no diagnostic at all.

Where shape decides, shape now wins: the bare directives take no operand, so a
line with property shape is a property. 'description String' declares a
property; 'description "..."' is still the directive, and 'validate csharp'
still opens a code block.

Where shape cannot decide - 'authorize X', 'produces X', 'tag X', a mapping
target, an enumeration value - the '@' escape that ProjectionParser already
accepted is now accepted everywhere, so '@tag TagType' declares the property.

The two collisions that changed meaning in silence now warn: 'tag TagType'
says it declares a static tag rather than a property, and a bare 'validate' in
an enumeration says it opens an empty validate block rather than declaring a
value. Both keep the meaning they have always had.
@woksin woksin added the patch Bug fixes, docs, refactoring label Jul 29, 2026
@woksin
woksin merged commit 9fdb6ab into main Jul 29, 2026
1 check passed
@woksin
woksin deleted the fix/reserved-keyword-collisions branch July 29, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Bug fixes, docs, refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant