jssm 5.162.24 → 5.162.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -97,16 +97,22 @@ declare function configure(opts: {
97
97
  declare function vc(col: string): string;
98
98
  /**
99
99
  * Escape a string for safe interpolation inside a DOT double-quoted
100
- * attribute value. Replaces every `"` with `\"` so that group names,
101
- * state labels, and chip labels containing literal double-quotes produce
102
- * valid, parseable DOT source.
100
+ * attribute value. Escapes every `\` and `"` so that group names, state
101
+ * labels, and chip labels containing either character produce valid,
102
+ * parseable DOT source.
103
+ *
104
+ * Backslash is escaped *first*: a label ending in `\` would otherwise emit
105
+ * `label="a\"`, whose `\"` escapes the closing quote and corrupts the DOT so
106
+ * the whole render throws. Escaping `\`→`\\` before `"`→`\"` avoids
107
+ * double-escaping the backslashes the quote step introduces. StoneCypher/fsl#1951
103
108
  *
104
109
  * ```typescript
105
- * doublequote('a"b'); // 'a\\"b'
106
- * doublequote('safe'); // 'safe'
110
+ * doublequote('a"b'); // 'a\\"b'
111
+ * doublequote('a\\'); // 'a\\\\'
112
+ * doublequote('safe'); // 'safe'
107
113
  * ```
108
114
  * @param txt Any string that will be placed inside `"…"` in a DOT attribute.
109
- * @returns The string with every `"` replaced by `\"`.
115
+ * @returns The string with every `\` and `"` backslash-escaped.
110
116
  * @internal
111
117
  */
112
118
  declare function doublequote(txt: string): string;
@@ -23227,7 +23227,19 @@ function compile_rule_transition_step(acc, from, to, this_se, next_se) {
23227
23227
  acc.push(right);
23228
23228
  }
23229
23229
  const left = makeTransition(this_se, t, f, false);
23230
- if (left.kind !== 'none') {
23230
+ if (left.kind === 'none') {
23231
+ // A one-way arrow has no reverse edge, so a probability/action/after
23232
+ // written AFTER the arrow ("a -> 40% b") lands in the reverse-edge slots
23233
+ // and used to be silently dropped. Reject it loudly; the decoration
23234
+ // belongs before the arrow ("a 40% -> b"). The parser omits these
23235
+ // fields when absent (despite the non-optional type), so a loose view
23236
+ // lets `!= null` mean "was decorated". StoneCypher/fsl#1950
23237
+ const rev = this_se;
23238
+ if (rev.l_probability != null || rev.l_action != null || rev.l_after != null) {
23239
+ throw new JssmError(undefined, `A one-way arrow has no reverse edge, so a decoration written after it ("${String(from)} ${this_se.kind} 40% ${String(to)}") is discarded; write it before the arrow instead ("${String(from)} 40% ${this_se.kind} ${String(to)}").`);
23240
+ }
23241
+ }
23242
+ else {
23231
23243
  acc.push(left);
23232
23244
  }
23233
23245
  }
@@ -24442,7 +24454,7 @@ function fslSemanticSpans(text) {
24442
24454
  * Useful for runtime diagnostics and for embedding in serialized machine
24443
24455
  * snapshots so that deserializers can detect version-skew.
24444
24456
  */
24445
- const version = "5.162.24";
24457
+ const version = "5.162.26";
24446
24458
 
24447
24459
  /**
24448
24460
  * The FSL Markdown fence convention parser — pure, host-agnostic logic that
@@ -30210,20 +30222,26 @@ function vc(col) {
30210
30222
  }
30211
30223
  /**
30212
30224
  * Escape a string for safe interpolation inside a DOT double-quoted
30213
- * attribute value. Replaces every `"` with `\"` so that group names,
30214
- * state labels, and chip labels containing literal double-quotes produce
30215
- * valid, parseable DOT source.
30225
+ * attribute value. Escapes every `\` and `"` so that group names, state
30226
+ * labels, and chip labels containing either character produce valid,
30227
+ * parseable DOT source.
30228
+ *
30229
+ * Backslash is escaped *first*: a label ending in `\` would otherwise emit
30230
+ * `label="a\"`, whose `\"` escapes the closing quote and corrupts the DOT so
30231
+ * the whole render throws. Escaping `\`→`\\` before `"`→`\"` avoids
30232
+ * double-escaping the backslashes the quote step introduces. StoneCypher/fsl#1951
30216
30233
  *
30217
30234
  * ```typescript
30218
- * doublequote('a"b'); // 'a\\"b'
30219
- * doublequote('safe'); // 'safe'
30235
+ * doublequote('a"b'); // 'a\\"b'
30236
+ * doublequote('a\\'); // 'a\\\\'
30237
+ * doublequote('safe'); // 'safe'
30220
30238
  * ```
30221
30239
  * @param txt Any string that will be placed inside `"…"` in a DOT attribute.
30222
- * @returns The string with every `"` replaced by `\"`.
30240
+ * @returns The string with every `\` and `"` backslash-escaped.
30223
30241
  * @internal
30224
30242
  */
30225
30243
  function doublequote(txt) {
30226
- return txt.replace(/"/g, String.raw `\"`);
30244
+ return txt.replace(/\\/g, String.raw `\\`).replace(/"/g, String.raw `\"`);
30227
30245
  }
30228
30246
  /**
30229
30247
  * URL schemes that are safe to emit into a rendered diagram's `<a xlink:href>`.