rip-lang 3.13.126 → 3.13.127

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 CHANGED
@@ -9,7 +9,7 @@
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
- <a href="CHANGELOG.md"><img src="https://img.shields.io/badge/version-3.13.126-blue.svg" alt="Version"></a>
12
+ <a href="CHANGELOG.md"><img src="https://img.shields.io/badge/version-3.13.127-blue.svg" alt="Version"></a>
13
13
  <a href="#zero-dependencies"><img src="https://img.shields.io/badge/dependencies-ZERO-brightgreen.svg" alt="Dependencies"></a>
14
14
  <a href="#"><img src="https://img.shields.io/badge/tests-1%2C436%2F1%2C436-brightgreen.svg" alt="Tests"></a>
15
15
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"></a>
package/docs/dist/rip.js CHANGED
@@ -3159,10 +3159,12 @@
3159
3159
  case 68:
3160
3160
  return ["regex-index", $[$0], null];
3161
3161
  case 69:
3162
+ case 120:
3162
3163
  return ["=", $[$0 - 2], $[$0]];
3163
3164
  case 70:
3164
3165
  return ["=", $[$0 - 3], $[$0]];
3165
3166
  case 71:
3167
+ case 121:
3166
3168
  return ["=", $[$0 - 4], $[$0 - 1]];
3167
3169
  case 72:
3168
3170
  return ["=", $[$0], $[$0 - 2]];
@@ -3244,15 +3246,11 @@
3244
3246
  case 367:
3245
3247
  return [...$[$0 - 5], ...$[$0 - 2]];
3246
3248
  case 116:
3247
- return [$[$0], $[$0], null];
3249
+ return [null, $[$0], $[$0]];
3248
3250
  case 118:
3249
- return [$[$0 - 2], $[$0], ":"];
3251
+ return [":", $[$0 - 2], $[$0]];
3250
3252
  case 119:
3251
- return [$[$0 - 4], $[$0 - 1], ":"];
3252
- case 120:
3253
- return [$[$0 - 2], $[$0], "="];
3254
- case 121:
3255
- return [$[$0 - 4], $[$0 - 1], "="];
3253
+ return [":", $[$0 - 4], $[$0 - 1]];
3256
3254
  case 126:
3257
3255
  return ["dynamicKey", $[$0 - 1]];
3258
3256
  case 127:
@@ -4098,8 +4096,8 @@ Expecting ${expected.join(", ")}, got '${this.tokenNames[symbol] || symbol}'`;
4098
4096
  for (const pair of pairs) {
4099
4097
  if (!Array.isArray(pair))
4100
4098
  continue;
4101
- const key = pair[0] instanceof String ? pair[0].valueOf() : pair[0];
4102
- const val = pair[1] instanceof String ? pair[1].valueOf() : pair[1];
4099
+ const key = pair[1] instanceof String ? pair[1].valueOf() : pair[1];
4100
+ const val = pair[2] instanceof String ? pair[2].valueOf() : pair[2];
4103
4101
  if (key === "type" && typeof val === "string") {
4104
4102
  return val.replace(/^["']|["']$/g, "");
4105
4103
  }
@@ -4528,10 +4526,10 @@ Expecting ${expected.join(", ")}, got '${this.tokenNames[symbol] || symbol}'`;
4528
4526
  if (sexpr[0] === "object") {
4529
4527
  return ["object", ...sexpr.slice(1).map((pair) => {
4530
4528
  if (Array.isArray(pair) && pair.length >= 2) {
4531
- let key = pair[0];
4529
+ let key = pair[1];
4532
4530
  let newKey = Array.isArray(key) ? this.transformComponentMembers(key, localScope) : key;
4533
- let newValue = this.transformComponentMembers(pair[1], localScope);
4534
- return [newKey, newValue, pair[2]];
4531
+ let newValue = this.transformComponentMembers(pair[2], localScope);
4532
+ return [pair[0], newKey, newValue];
4535
4533
  }
4536
4534
  return this.transformComponentMembers(pair, localScope);
4537
4535
  })];
@@ -4642,7 +4640,7 @@ Expecting ${expected.join(", ")}, got '${this.tokenNames[symbol] || symbol}'`;
4642
4640
  const pair = stmt[i];
4643
4641
  if (!Array.isArray(pair))
4644
4642
  continue;
4645
- const [methodName, funcDef] = pair;
4643
+ const [, methodName, funcDef] = pair;
4646
4644
  if (typeof methodName === "string" && LIFECYCLE_HOOKS.has(methodName)) {
4647
4645
  lifecycleHooks.push({ name: methodName, value: funcDef });
4648
4646
  } else if (typeof methodName === "string") {
@@ -4791,7 +4789,7 @@ Expecting ${expected.join(", ")}, got '${this.tokenNames[symbol] || symbol}'`;
4791
4789
  const pair = obj[j];
4792
4790
  if (!Array.isArray(pair) || pair.length < 2)
4793
4791
  continue;
4794
- const [key, value] = pair;
4792
+ const [, key, value] = pair;
4795
4793
  if (Array.isArray(key) && key[0] === "." && key[1] === "this" && Array.isArray(value) && value[0] === "." && value[1] === "this") {
4796
4794
  const eventName = typeof key[2] === "string" ? key[2] : key[2]?.valueOf?.();
4797
4795
  const methodName = typeof value[2] === "string" ? value[2] : value[2]?.valueOf?.();
@@ -4858,7 +4856,7 @@ Expecting ${expected.join(", ")}, got '${this.tokenNames[symbol] || symbol}'`;
4858
4856
  if (obj) {
4859
4857
  for (let j = 1;j < obj.length; j++) {
4860
4858
  const pair = obj[j];
4861
- const [key, value] = pair;
4859
+ const [, key, value] = pair;
4862
4860
  if (typeof key === "string" && !key.startsWith("@")) {
4863
4861
  const srcLine = pair.loc?.r ?? obj.loc?.r;
4864
4862
  if (key.startsWith("__bind_") && key.endsWith("__")) {
@@ -4893,7 +4891,7 @@ Expecting ${expected.join(", ")}, got '${this.tokenNames[symbol] || symbol}'`;
4893
4891
  const pair = obj[j];
4894
4892
  if (!Array.isArray(pair) || pair.length < 2)
4895
4893
  continue;
4896
- const [key, value] = pair;
4894
+ const [, key, value] = pair;
4897
4895
  const srcLine = pair.loc?.r ?? obj.loc?.r;
4898
4896
  if (Array.isArray(key) && key[0] === "." && key[1] === "this") {
4899
4897
  let memberName = typeof key[2] === "string" ? key[2] : key[2]?.valueOf?.();
@@ -5574,7 +5572,7 @@ ${blockFactoriesCode}return ${lines.join(`
5574
5572
  proto.generateAttributes = function(elVar, objExpr) {
5575
5573
  const inputType = extractInputType(objExpr.slice(1));
5576
5574
  for (let i = 1;i < objExpr.length; i++) {
5577
- let [key, value] = objExpr[i];
5575
+ let [, key, value] = objExpr[i];
5578
5576
  if (this.is(key, ".") && key[1] === "this") {
5579
5577
  const eventName = key[2];
5580
5578
  if (this._autoWireExplicit && this._autoWireEl === elVar) {
@@ -5951,7 +5949,7 @@ ${blockFactoriesCode}return ${lines.join(`
5951
5949
  };
5952
5950
  const addObjectProps = (objExpr) => {
5953
5951
  for (let i = 1;i < objExpr.length; i++) {
5954
- const [key, value] = objExpr[i];
5952
+ const [, key, value] = objExpr[i];
5955
5953
  if (typeof key === "string") {
5956
5954
  addProp(key, value);
5957
5955
  } else if (Array.isArray(key) && key[0] === "." && key[1] === "this" && typeof key[2] === "string") {
@@ -7108,7 +7106,7 @@ if (typeof globalThis !== 'undefined') {
7108
7106
  let stmtEntries = body.map((stmt, index) => {
7109
7107
  let isSingle = body.length === 1 && imports.length === 0;
7110
7108
  let isObj = this.is(stmt, "object");
7111
- let isObjComp = isObj && stmt.length === 2 && Array.isArray(stmt[1]) && Array.isArray(stmt[1][1]) && stmt[1][1][0] === "comprehension";
7109
+ let isObjComp = isObj && stmt.length === 2 && Array.isArray(stmt[1]) && Array.isArray(stmt[1][2]) && stmt[1][2][0] === "comprehension";
7112
7110
  let isAlreadyExpr = this.is(stmt, "comprehension") || this.is(stmt, "object-comprehension") || this.is(stmt, "do-iife");
7113
7111
  let hasNoVars = this.programVars.size === 0;
7114
7112
  let needsParens = isSingle && isObj && hasNoVars && !isAlreadyExpr && !isObjComp;
@@ -8029,15 +8027,15 @@ ${this.indent()}}`;
8029
8027
  return hasTrailingElision ? `[${codes},]` : `[${codes}]`;
8030
8028
  }
8031
8029
  generateObject(head, pairs, context) {
8032
- if (pairs.length === 1 && Array.isArray(pairs[0]) && Array.isArray(pairs[0][1]) && pairs[0][1][0] === "comprehension") {
8033
- let [keyVar, compNode] = pairs[0];
8030
+ if (pairs.length === 1 && Array.isArray(pairs[0]) && Array.isArray(pairs[0][2]) && pairs[0][2][0] === "comprehension") {
8031
+ let [, keyVar, compNode] = pairs[0];
8034
8032
  let [, valueExpr, iterators, guards] = compNode;
8035
8033
  return this.generate(["object-comprehension", keyVar, valueExpr, iterators, guards], context);
8036
8034
  }
8037
8035
  let codes = pairs.map((pair) => {
8038
8036
  if (this.is(pair, "..."))
8039
8037
  return `...${this.generate(pair[1], "value")}`;
8040
- let [key, value, operator] = pair;
8038
+ let [operator, key, value] = pair;
8041
8039
  let keyCode;
8042
8040
  if (this.is(key, "dynamicKey"))
8043
8041
  keyCode = `[${this.generate(key[1], "value")}]`;
@@ -8408,14 +8406,14 @@ ${this.indent()}}`;
8408
8406
  let members = bodyStmts[0].slice(1);
8409
8407
  this.indentLevel++;
8410
8408
  let boundMethods = [];
8411
- for (let [mk, mv] of members) {
8409
+ for (let [, mk, mv] of members) {
8412
8410
  let isStatic = this.is(mk, ".") && mk[1] === "this";
8413
8411
  let isComputed = this.is(mk, "computed");
8414
8412
  let mName = this.extractMemberName(mk);
8415
8413
  if (this.is(mv, "=>") && !isStatic && !isComputed && mName !== "constructor")
8416
8414
  boundMethods.push(mName);
8417
8415
  }
8418
- for (let [mk, mv] of members) {
8416
+ for (let [, mk, mv] of members) {
8419
8417
  let isStatic = this.is(mk, ".") && mk[1] === "this";
8420
8418
  let isComputed = this.is(mk, "computed");
8421
8419
  let mName = this.extractMemberName(mk);
@@ -8473,7 +8471,7 @@ ${this.indent()}}`;
8473
8471
  let members = bodyStmts[0].slice(1);
8474
8472
  let additionalStmts = bodyStmts.slice(1);
8475
8473
  this.indentLevel++;
8476
- for (let [mk, mv] of members) {
8474
+ for (let [, mk, mv] of members) {
8477
8475
  let isStatic = this.is(mk, ".") && mk[1] === "this", mName = this.extractMemberName(mk);
8478
8476
  if (this.is(mv, "->") || this.is(mv, "=>")) {
8479
8477
  let [, params, body] = mv;
@@ -8741,7 +8739,7 @@ export default ${expr[1]}`;
8741
8739
  return `...${pair[1]}`;
8742
8740
  if (this.is(pair, "default"))
8743
8741
  return `${pair[1]} = ${this.generate(pair[2], "value")}`;
8744
- let [key, value, operator] = pair;
8742
+ let [operator, key, value] = pair;
8745
8743
  if (operator === "=")
8746
8744
  return `${key} = ${this.generate(value, "value")}`;
8747
8745
  if (key === value)
@@ -9466,7 +9464,7 @@ ${this.indent()}}`;
9466
9464
  return;
9467
9465
  }
9468
9466
  if (pair.length >= 2) {
9469
- let [key, value, operator] = pair;
9467
+ let [operator, key, value] = pair;
9470
9468
  if (operator === "=") {
9471
9469
  if (typeof key === "string")
9472
9470
  varSet.add(key);
@@ -10001,8 +9999,8 @@ globalThis.zip ??= (...a) => a[0].map((_, i) => a.map(b => b[i]));
10001
9999
  return new CodeGenerator({}).getComponentRuntime();
10002
10000
  }
10003
10001
  // src/browser.js
10004
- var VERSION = "3.13.126";
10005
- var BUILD_DATE = "2026-03-21@06:00:44GMT";
10002
+ var VERSION = "3.13.127";
10003
+ var BUILD_DATE = "2026-03-21@07:18:26GMT";
10006
10004
  if (typeof globalThis !== "undefined") {
10007
10005
  if (!globalThis.__rip)
10008
10006
  new Function(getReactiveRuntime())();