R4: one argument form (Param = expr) and with ({n} = …) text templates (#751) - #772
Merged
Merged
Conversation
…vision (#768) `/` shares a precedence level with `*`, `div` and `mod`, so `$a/X * $b/Y` parsed as `(($a/X) * $b) / Y` and was stored as `$a/X * $b / Y` (and, in a list filter, `$b / $currentObject/Y`). When a `/ Member` step cannot attach to the whole left side, attach it to the last operand of the preceding multiplicative expression. Mendix has no `/` division. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… ({n} = e)) (#751)
Every call site binds an argument as `Param = expression`: call
microflow/nanoflow/java/javascript/external action, web service, execute
database query, send rest request, show page, and page/button actions and
flow data sources. A workflow's call microflow / call workflow takes its
arguments right after the callee as bare expressions. show message and
validation feedback take `with ({1} = e)`.
The old spellings stay as registered deprecated aliases with fmt --upgrade
rewrites computed from the parse tree:
MDL-DEPR006 $Param = e
MDL-DEPR007 Param: e
MDL-DEPR008 workflow `with (Param = '<expr>')` (same meaning: the
string's content is the expression)
MDL-DEPR009 objects [..] / parameters [..]
describe writes the canonical forms, and now also writes a validation
feedback's template arguments, which it dropped. A stored workflow
expression that does not read back as itself when bare keeps the string
form in describe.
Skills, docs-site, the quick reference and `mxcli syntax` are migrated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… phrases read as nouns (#751) The E001 hint's Right example, the control-bar selection suggestion, the microflow help text and the vega-charts skill pack still wrote an argument as `$Param = e` / `Param: e`, the spellings MDL-DEPR006/007 now warn on. The four new registry Structural texts were verb phrases, so check printed "Rewrite the drop the `$` ...". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… workflow args after the callee) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Part of #751 (R4 in full; the R3
alter … set ( Key: value )half is left for a follow-up — see below). Tracking: #714.What changes
One argument form at every call site:
Param = expression(no$,=not:):call microflow/nanoflow/java action/javascript action/external action, web service operation,execute database query,send rest request … with (id = $X),show page M.P(Order = $O), page/button actions and microflow/nanoflow data sources (Action: microflow M.F(Order = $currentObject)), and workflow calls:call microflow M.F(Order = $WorkflowContext) as act1 comment '…'(bare expression, right after the callee).One text-template form:
with ({1} = e, …)forshow messageandvalidation feedback(already the form oflogand REST templates).Old spellings are registered deprecated aliases (both language versions warn,
fmt --upgraderewrites them, rewrites computed from the parse tree):$Param = eParam = e(quoted only when the name is not a validparameterName)Param: e(show page, page actions, data sources)Param = ewith (Param = '<expr>')(Param = <expr>)after the calleeobjects [a, b]/parameters [a, b]with ({1} = a, {2} = b)describeemits the canonical forms everywhere (microflow show page, show message, validation feedback, send rest request, page actions incl. inferred show_page args, data sources, workflow calls). It now also emits a validation feedback's template arguments, which it silently dropped (describe → exec lost them; finding recorded).Skills (
make sync-skills), docs-site,MDL_QUICK_REFERENCE.md,mxcli syntaxentries and CHANGELOG are migrated.Design choices the ADRs did not settle
with (P = '<expr>')keeps its meaning (the string's content is the expression) and is an alias (MDL-DEPR008), not a gated change. The rewrite unquotes only when the content parses as an MDL expression and reads back as exactly the same stored text (visitor.BareExpression); otherwise it is left and reported (Result.Unrewritten). Writing both lists on one call is an error.send rest requestkeeps itswith (…)clause; only the binding form changes ($id = e→id = e). Moving the list next to the operation is a bracket question (R2, R2: three brackets, three meanings — integration documents, navigation/menus, on error, while (3.4) #754), not R4.with ({n} = …)on show message / validation feedback is stored by number; the numbers must be exactly 1..N (the model holds a positional list), otherwise a parse error.Not in this PR (follow-ups)
alter <type> X set ( Key: value, … )with exactly create's keys for pageset, odata alter, settings, styling; removing optional colons (type reference,modify attribute A: T). Overlaps R6/R7/R9/R10: verbs, session commands, metadata placement, Studio Pro document names (3.5–3.6) #755 (alter settings runtime) and the existing MDL-DEPR101–103 alter-page aliases, so it is better as its own PR.{$Asset: $var}and fragment args($p: $Data)still use:/$(not call sites in the R4 list; fragment args are mxcli macros).mdl-examples/scripts were not rewritten (the examples upgrade test covers them).Test plan (what I ran)
make build,make lint(Go + TS) — pass.go test ./mdl/visitor/ ./mdl/upgrade/ ./mdl/deprecation/ ./mdl/grammar/ ./mdl/executor/ ./mdl/linter/... ./cmd/mxcli/...— pass (incl.TestUpgrade_ExamplesKeepTheirStatements,TestRegistryExamplesRecordTheirCode,TestGrammarAliasesAreRegistered,TestLargeSkillsWereSplit).go test -tags integration ./mdl/roundtrip/(PedApp + TestApp, execute-both upgrade property, describe: end every statement with ';', never print '/' (#744) #745 terminator test) — pass; no allowlist entries added.TestArgumentBindingAliases(17 call-site cases: each old form records its code, has a fix, and builds exactly the canonical statement), workflow bare-expression / no-rewrite / two-lists tests, template numbering,TestUpgrade_ArgumentBinding(golden rewrite keeping case/comments/layout, idempotent),TestUpgrade_WorkflowStringArgumentWithoutBareForm,TestDescribe_*(show message, validation feedback, send rest request, workflow incl. fallback — each output re-parses with no deprecation).mainfailsTestDescribe_*and the updated describe expectations (old output also records MDL-DEPR006/008/009); disabling the visitor'sExit*hooks failsTestArgumentBindingAliases,TestRegistryExamplesRecordTheirCode,TestUpgrade_ArgumentBinding,TestUpgrade_EveryRegistryExampleand the workflow/template tests.describeof the results is identical, andmxcli docker checkon the canonical copy reports 0 errors.🤖 Generated with Claude Code