You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: support log node expressions in microflow roundtrip
The LOG statement's optional NODE clause only accepted a bare
`STRING_LITERAL` (e.g. `LOG INFO NODE 'MyModule' 'msg'`), but Studio
Pro persists projects where the node is any expression — a constant
reference like `@MyModule.SecurityLogNode`, a variable, or a function
call. Describing those microflows emitted MDL the parser rejected with
`mismatched input '$' expecting STRING_LITERAL`, and
`addLogMessageAction` was wrapping the already-quoted node in an extra
pair of quotes whenever the input was a plain string.
Widen the grammar and AST:
logStatement
: LOG logLevel? (NODE expression)? expression logTemplateParams?
;
LogStmt.Node: Expression // was string
The visitor now collects all child expressions and assigns the first
to `Node` / second to `Message` when `NODE` is present; the builder
formats `s.Node` through `exprToString` and defaults to `'Application'`
when absent. Describer and diff emitter pass the node through the same
expression formatter, and the format casing is lowercased to match the
rest of the MDL output.
`formatAction` for `LogMessageAction` keeps raw template text on the
wire so Mendix-style `{1}` placeholders survive when WITH params are
present; without that, the literal got re-quoted into `'''Order {1}'''`
on every roundtrip.
Regression tests cover:
- `log info node @Module.Constant 'msg'` roundtrip through
create -> describe -> re-exec
- template LOG statements: `log info node 'App' 'Order {1}' with ...`
- visitor builds `ConstantRefExpr` for `@Module.Constant` node
- `formatAction` multiline escaping matches the new lowercased form
0 commit comments