R3: alter sets properties in create's ( Key: value ) list; colons only where R3 puts them (#751) - #778
Merged
Conversation
…ere R3 puts them (#751) R3 of the beta syntax freeze: `:` sets a model property, so every `alter` takes the same `( Key: value, … )` list its `create` does, and a colon is written in a property list or an attribute definition and nowhere else. Canonical forms, parsed under mdl 0 and mdl 1; the old spellings keep parsing as registered aliases that warn and that `fmt --upgrade` rewrites: - MDL-DEPR060 alter settings <section> / configuration 'X' and create configuration: `Key = v, …` -> `( Key: v, … )` - MDL-DEPR061 alter consumed|published odata service X set Key = v -> set ( Key: v, … ), exactly create's property list - MDL-DEPR062 alter styling … set Class = 'x', 'P' = on -> set ( … ) - MDL-DEPR063 alter entity … set allow_create_change_locally = v -> set ( AllowCreateChangeLocally: v ) - MDL-DEPR064 association `type: Reference` / owner: / storage: -> no colon - MDL-DEPR065 modify attribute A T -> modify attribute A: T - MDL-DEPR101..103, the generic alter page/snippet/layout aliases, move from the executor's provisional table into the registry, with rewrites. describe settings now writes the canonical lists, and the MDL mxcli generates (testrunner, new-project hints) uses them. Docs, skills, `mxcli syntax` and the quick reference follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#751) fmt --upgrade promises to keep comments, but the MDL-DEPR103, -064, -060..063 rewrites replaced whole gaps: 'drop widget -- c\n a' became 'drop a', 'type: /* c */ Reference' became 'type Reference'. A gap that holds more than whitespace now keeps its text; only the old token goes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…list (#751) The MDL-WIDGET renamed-property suggestion told users to write `set 'Key' = 'Value'`, the spelling this PR deprecates as MDL-DEPR062. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
11 tasks done
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.
Closes #751 (the R3 half; R4 landed in #772).
R3 of the beta syntax freeze (PROPOSAL_mdl_beta_syntax_freeze.md §3 R3, §7 item 6):
:sets a model property, so analtertakes exactly the( Key: value, … )list itscreatetakes, and a colon appears in a property list or an attribute definition and nowhere else.What changes
The new canonical spelling parses under both
mdl 0andmdl 1. The old spelling keeps parsing as a registered alias (mdl/deprecation) that warns under both versions, andfmt --upgraderewrites it. None of these changes meaning, so nothing is gated on the language version.alter settings runtime|language|workflows K = v, …,alter settings configuration 'X' K = v,create configuration 'X' K = v… ( K: v, … )alter consumed|published odata service X set K = v, …set ( K: v, … ):create's ownodataPropertyAssignmentlist, including the client's expression-typed keysalter styling … set Class = 'x', 'P' = on(alsoset K: vwithout parentheses)set ( Class: 'x', 'P': on )alter entity … set allow_create_change_locally = trueset ( AllowCreateChangeLocally: true ), the keycreate external entityusestype: Reference/owner:/storage:type Reference, because a clause takes no colonmodify attribute A T(alsomodify column)modify attribute A: Tset K = v,set K: v,drop widget aThe MDL-DEPR101..103 fold-in. These moved from the executor's provisional table (
mdl/executor/alter_aliases.go, now deleted) into the registry. The visitor records them with anast.Fix, sofmt --upgradenow rewrites them, which it could not do before. TheLegacymarker field onSetPropertyOp/DropWidgetOpis gone. Both spellings build an identical AST, which the registry-example test now checks withDeepEqual. The grammar markers are now/* @alias … */, soTestGrammarAliasesAreRegisteredcovers them.validateAlterPageAddressesmoved unchanged tovalidate_alter_page_addresses.go.Describe.
describe settingsnow emits every section (runtime, configuration, language default, workflows) as the canonical list. MDL that mxcli generates now uses the canonical list too: the test runner's after-startup set/restore and theJavaVersionhints inmxcli new/ docker detect.Docs. Updated skills (
.claude/skills/mendix/*, thenmake sync-skills), docs-site,mxcli syntaxentries anddocs/01-project/MDL_QUICK_REFERENCE.md. The fenced MDL code blocks were rewritten mechanically with these rewrites (parse, apply only these codes' fixes), and the tables and prose by hand. I also fixed a quick-reference row that showed a form that never parsed:modify (attr: T).Design choices the ADRs did not settle
mxcli syntaxand docs-site. The registry says a code is never renumbered.set:alter settings runtime ( K: v ). This follows the proposal's own After example. OData, styling and entity keep theirsetverb, because it is part of those statements.(on the statement line and closes)on its own line, indented like the statement. A one-line list gets( … ). Pagesetkeeps its tight(…), which is how existing docs spell it.alter settings runtimeon two PedApp copies left everymprcontentsfile byte-identical, and the new describe output replays cleanly withexec.Test plan (what I ran)
make build,make lint(Go and TS): pass.go test ./mdl/visitor ./mdl/grammar ./mdl/deprecation ./mdl/upgrade ./mdl/executor ./mdl/langver ./mdl/ast ./cmd/mxcli/...: pass.go test -tags integration ./mdl/roundtrip/: pass, includingTestUpgradeExecutesToTheSameModel(execute-both), the PedApp and TestApp describe canonical-spelling and terminator tests, and both round trips. It was run in three-rungroups with-p 1because the full run was OOM-killed on the shared machine. No allowlist entries were added.mdl/visitor/r3_property_lists_test.go: every old/canonical pair builds identical statements, only the old one records its code with a fix, and the canonical lists carry their values.mdl/upgrade/r3_property_lists_test.go: exact rewrite output (inline, multi-line, indented, upper-case, and a nested R8 respelling inside a pageset) and idempotence.mdl/executor/cmd_settings_describe_canonical_test.go: describe output parses under no header and undermdl 1;with zero deprecations. The control is the property count and a" = "check.recordOldListandExitAlterStylingAction: 12 R3 pair tests and the MDL-DEPR060/061/062 registry examples fail.eachSettingsProperty: the settings pairs andTestR3CanonicalListsCarryTheirValuesfail.cmd_settings.gofrommain: the describe test fails with four MDL-DEPR060 records.Not in this PR (follow-ups)
These are other
set k = vspellings outside the issue's list:alter module … add jar dependency (group = …), which is in the proposal's R3 After examplealter published rest service … set path = …alter model/knowledge base/consumed mcp service … set K = v,alter agent … set)alter pages … set 'P' = on where …set layout = M.Linalter page/alter pagesThe
mdl-examplesscripts still use the old spellings. They now warn, and they exercise the aliases through the execute-both test.🤖 Generated with Claude Code