rip-lang 3.13.20 → 3.13.22
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.
- package/README.md +3 -3
- package/docs/RIP-INTERNALS.md +1 -1
- package/docs/RIP-LANG.md +1 -1
- package/docs/dist/rip.js +17 -2
- package/docs/dist/rip.min.js +29 -29
- package/docs/dist/rip.min.js.br +0 -0
- package/package.json +1 -1
- package/src/components.js +10 -0
- package/src/lexer.js +1 -0
package/docs/dist/rip.min.js.br
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/components.js
CHANGED
|
@@ -398,6 +398,16 @@ export function installComponentSupport(CodeGenerator, Lexer) {
|
|
|
398
398
|
// Implicit nesting (inject -> before INDENT)
|
|
399
399
|
// ─────────────────────────────────────────────────────────────────────
|
|
400
400
|
if (nextToken && nextToken[0] === 'INDENT') {
|
|
401
|
+
// Skip fromThen INDENTs inside string interpolation (e.g. "#{if x then y else z}")
|
|
402
|
+
if (nextToken.fromThen) {
|
|
403
|
+
let depth = 0;
|
|
404
|
+
for (let j = i; j >= 0; j--) {
|
|
405
|
+
let jt = tokens[j][0];
|
|
406
|
+
if (jt === 'INTERPOLATION_END' || jt === 'STRING_END') depth++;
|
|
407
|
+
if (jt === 'INTERPOLATION_START' || jt === 'STRING_START') depth--;
|
|
408
|
+
if (depth < 0) { return 1; }
|
|
409
|
+
}
|
|
410
|
+
}
|
|
401
411
|
if (tag === '->' || tag === '=>' || tag === 'CALL_START' || tag === '(') {
|
|
402
412
|
return 1;
|
|
403
413
|
}
|
package/src/lexer.js
CHANGED
|
@@ -1424,6 +1424,7 @@ export class Lexer {
|
|
|
1424
1424
|
|
|
1425
1425
|
this.scanTokens((token, i) => {
|
|
1426
1426
|
if (token[0] !== 'IF' && token[0] !== 'UNLESS') return 1;
|
|
1427
|
+
if (this.tokens[i - 1]?.[0] === 'INTERPOLATION_START') return 1;
|
|
1427
1428
|
original = token;
|
|
1428
1429
|
this.detectEnd(i + 1, condition, action);
|
|
1429
1430
|
return 1;
|