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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rip-lang",
3
- "version": "3.13.20",
3
+ "version": "3.13.22",
4
4
  "description": "A modern language that compiles to JavaScript",
5
5
  "type": "module",
6
6
  "main": "src/compiler.js",
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;