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
MDL text produced by `describe microflow` was failing to re-parse on
several shapes: multiline captions/messages lost their newlines, tabs
were silently dropped when unquoting strings, and loop positions
anchored with `@position` drifted by half a loop width per roundtrip.
Centralise string escaping in an mdlQuote helper that doubles single
quotes and encodes `\n`, `\r`, `\t`, and `\\`. Switch every call site
(`cmd_microflows_show.go`, `cmd_microflows_show_helpers.go`,
`cmd_microflows_format_action.go`, `cmd_microflows_helpers.go`,
`cmd_pages_describe_output.go`) to use it. Mirror the encoding in the
visitor by rewriting `unquoteString` to walk the input and decode each
escape explicitly instead of doing naive sequential `ReplaceAll` calls,
which mangled `\\n` and similar sequences.
Loops now compute `loopLeftX`/`loopCenterX` up front and use the
annotated `@position` when set, then advance `fb.posX` past the actual
left edge of the loop instead of the stale pre-annotation position.
`addWhileStatement` gets the same treatment.
Regression tests cover:
- `emitObjectAnnotations` emitting escaped `@caption` / `@annotation`
- `formatAction` for `ShowMessage` and `LogMessage` with multiline text
- `unquoteString` decoding `\n`, `\t`, `\\`, and doubled quotes
- `addLoopStatement` / `addWhileStatement` honouring `@position` and
leaving `fb.posX` past the loop's right edge
0 commit comments