numbl 0.4.17 → 0.4.18

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.
@@ -1,2 +1,2 @@
1
1
  /** Numbl version, used for JIT disk cache invalidation. */
2
- export declare const NUMBL_VERSION = "0.4.17";
2
+ export declare const NUMBL_VERSION = "0.4.18";
package/dist-cli/cli.js CHANGED
@@ -31940,6 +31940,9 @@ var ExpressionParser = class extends ParserBase {
31940
31940
  if (this.peekToken() === 50 /* LParen */ && this.inMatrixExpr && this.pos > 0 && !this.tokensAdjacent(this.pos - 1, this.pos)) {
31941
31941
  break;
31942
31942
  }
31943
+ if (this.peekToken() === 54 /* LBrace */ && this.inMatrixExpr && this.pos > 0 && !this.tokensAdjacent(this.pos - 1, this.pos)) {
31944
+ break;
31945
+ }
31943
31946
  if (this.consume(50 /* LParen */)) {
31944
31947
  const start = expr.span.start;
31945
31948
  const args = [];
@@ -64795,7 +64798,7 @@ function getSourceLine(getSource, file, line) {
64795
64798
  }
64796
64799
 
64797
64800
  // src/numbl-core/version.ts
64798
- var NUMBL_VERSION = "0.4.17";
64801
+ var NUMBL_VERSION = "0.4.18";
64799
64802
 
64800
64803
  // src/cli-repl.ts
64801
64804
  import { createInterface } from "readline";
@@ -67842,7 +67845,12 @@ function evalLValueBase(base, defaultVal) {
67842
67845
  }
67843
67846
  const indices = this.evalIndicesWithEnd(baseVal, base.indices);
67844
67847
  try {
67845
- return this.rt.indexCell(baseVal, indices);
67848
+ const result = this.rt.indexCell(baseVal, indices);
67849
+ if (Array.isArray(result)) {
67850
+ if (result.length === 1) return result[0];
67851
+ if (result.length === 0) return defaultVal;
67852
+ }
67853
+ return result;
67846
67854
  } catch {
67847
67855
  return defaultVal;
67848
67856
  }
package/dist-lib/lib.js CHANGED
@@ -30240,6 +30240,9 @@ var ExpressionParser = class extends ParserBase {
30240
30240
  if (this.peekToken() === 50 /* LParen */ && this.inMatrixExpr && this.pos > 0 && !this.tokensAdjacent(this.pos - 1, this.pos)) {
30241
30241
  break;
30242
30242
  }
30243
+ if (this.peekToken() === 54 /* LBrace */ && this.inMatrixExpr && this.pos > 0 && !this.tokensAdjacent(this.pos - 1, this.pos)) {
30244
+ break;
30245
+ }
30243
30246
  if (this.consume(50 /* LParen */)) {
30244
30247
  const start = expr.span.start;
30245
30248
  const args = [];
@@ -67028,7 +67031,12 @@ function evalLValueBase(base, defaultVal) {
67028
67031
  }
67029
67032
  const indices = this.evalIndicesWithEnd(baseVal, base.indices);
67030
67033
  try {
67031
- return this.rt.indexCell(baseVal, indices);
67034
+ const result = this.rt.indexCell(baseVal, indices);
67035
+ if (Array.isArray(result)) {
67036
+ if (result.length === 1) return result[0];
67037
+ if (result.length === 0) return defaultVal;
67038
+ }
67039
+ return result;
67032
67040
  } catch {
67033
67041
  return defaultVal;
67034
67042
  }
@@ -1,2 +1,2 @@
1
1
  /** Numbl version, used for JIT disk cache invalidation. */
2
- export declare const NUMBL_VERSION = "0.4.17";
2
+ export declare const NUMBL_VERSION = "0.4.18";