@listen-fire/movement-lang 0.16.0 → 0.16.1

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,3 +1,4 @@
1
+ import type { Loc } from '../parser/ast';
1
2
  import { type LanguageVersion, type LanguageVersionStanding } from '../language_version';
2
3
  import type { CatalogSnapshot } from '../service/snapshot';
3
4
  import type { Diagnostic } from './diagnostic';
@@ -14,10 +15,13 @@ export interface RustCheckOptions {
14
15
  limitingFunction?: string;
15
16
  }
16
17
  /** A source the Rust checker could not check: it does not parse, or the
17
- * snapshot does not load. */
18
+ * snapshot does not load. A source that does not parse is refused at `loc`,
19
+ * where the parser stopped (1-based); a snapshot is refused at no place in
20
+ * the source, and has none. */
18
21
  export declare class RustCheckRefused extends Error {
19
- constructor(message: string);
20
- /** The refusal an artifact's `{error: {message}}` reply carries. */
22
+ readonly loc?: Loc;
23
+ constructor(message: string, loc?: Loc);
24
+ /** The refusal an artifact's `{error: {message, loc?}}` reply carries. */
21
25
  static of(json: unknown): RustCheckRefused;
22
26
  }
23
27
  /** The language the artifact reads: its release's version. */
@@ -87,14 +91,16 @@ export interface LinkData {
87
91
  }>;
88
92
  }
89
93
  /** The check as the engine's `check.program` request is answered: every
90
- * diagnostic, the import link, the checker's stamps, and a plan per
91
- * `listen to <traversal>` that checked clean (absent when there is none),
92
- * as JSON: the engine reads them (`listenPlansOf`). */
94
+ * diagnostic, the import link, the checker's stamps, a plan per
95
+ * `listen to <traversal>` that checked clean, and each walk a function makes
96
+ * from a connection (each absent when there is none), as JSON: the engine
97
+ * reads them (`listenPlansOf`, `functionWalksOf`). */
93
98
  export interface CheckAnswer {
94
99
  diagnostics: Diagnostic[];
95
100
  link?: LinkData;
96
101
  stamps: Stamp[];
97
102
  listens?: unknown[];
103
+ walks?: unknown[];
98
104
  }
99
105
  /** `checkSourceInRust` as data (crates/movement-checker/src/answer.rs). */
100
106
  export declare function checkAnswerInRust(source: string, snapshot: CatalogSnapshot, options: RustCheckOptions): CheckAnswer;
@@ -20,16 +20,21 @@ exports.diagnosticOf = diagnosticOf;
20
20
  const loader_1 = require("../wasm/loader");
21
21
  const language_version_1 = require("../language_version");
22
22
  /** A source the Rust checker could not check: it does not parse, or the
23
- * snapshot does not load. */
23
+ * snapshot does not load. A source that does not parse is refused at `loc`,
24
+ * where the parser stopped (1-based); a snapshot is refused at no place in
25
+ * the source, and has none. */
24
26
  class RustCheckRefused extends Error {
25
- constructor(message) {
27
+ loc;
28
+ constructor(message, loc) {
26
29
  super(message);
27
30
  this.name = 'RustCheckRefused';
31
+ this.loc = loc;
28
32
  }
29
- /** The refusal an artifact's `{error: {message}}` reply carries. */
33
+ /** The refusal an artifact's `{error: {message, loc?}}` reply carries. */
30
34
  static of(json) {
31
35
  const error = isRecord(json) && isRecord(json.error) ? json.error : undefined;
32
- return new RustCheckRefused(typeof error?.message === 'string' ? error.message : 'the Rust checker refused the check');
36
+ const message = typeof error?.message === 'string' ? error.message : 'the Rust checker refused the check';
37
+ return new RustCheckRefused(message, error?.loc !== undefined ? locOf(error.loc) : undefined);
33
38
  }
34
39
  }
35
40
  exports.RustCheckRefused = RustCheckRefused;
@@ -87,6 +92,7 @@ function checkAnswerInRust(source, snapshot, options) {
87
92
  stamps: json.stamps.map(stampOf),
88
93
  ...(json.link !== undefined ? { link: linkOf(json.link) } : {}),
89
94
  ...(Array.isArray(json.listens) ? { listens: json.listens } : {}),
95
+ ...(Array.isArray(json.walks) ? { walks: json.walks } : {}),
90
96
  };
91
97
  }
92
98
  /** The engine's `check.compatible` request (an `IS <Decl>` test of a
package/dist/index.d.ts CHANGED
@@ -8,6 +8,8 @@ export * from './expression/bridge';
8
8
  export * from './expression/chunk';
9
9
  export * from './expression/file_value';
10
10
  export * from './expression/density';
11
+ export { isPurePredicate } from './expression/filter';
12
+ export type { Expression } from './expression/types';
11
13
  export * from './catalog/types';
12
14
  export * from './checker/handbook_pointers';
13
15
  export * from './checker/fixes';
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.openEngineSegment = exports.isParserReady = exports.initParser = exports.initEngine = exports.EngineStackRanOut = exports.callListenIdentity = exports.callLandingNode = exports.callLandingMisfits = exports.callJudgeArrival = exports.callExplainArrival = exports.assertParserReady = exports.MovementParserNotReady = void 0;
17
+ exports.isPurePredicate = exports.openEngineSegment = exports.isParserReady = exports.initParser = exports.initEngine = exports.EngineStackRanOut = exports.callListenIdentity = exports.callLandingNode = exports.callLandingMisfits = exports.callJudgeArrival = exports.callExplainArrival = exports.assertParserReady = exports.MovementParserNotReady = void 0;
18
18
  __exportStar(require("./never"), exports);
19
19
  __exportStar(require("./parser/ast"), exports);
20
20
  __exportStar(require("./parser/await_words"), exports);
@@ -37,6 +37,10 @@ __exportStar(require("./expression/bridge"), exports);
37
37
  __exportStar(require("./expression/chunk"), exports);
38
38
  __exportStar(require("./expression/file_value"), exports);
39
39
  __exportStar(require("./expression/density"), exports);
40
+ // Whether the engine hands a hop's WHERE to the module: only a pure one (no
41
+ // call, no walk) is sent.
42
+ var filter_1 = require("./expression/filter");
43
+ Object.defineProperty(exports, "isPurePredicate", { enumerable: true, get: function () { return filter_1.isPurePredicate; } });
40
44
  __exportStar(require("./catalog/types"), exports);
41
45
  __exportStar(require("./checker/handbook_pointers"), exports);
42
46
  __exportStar(require("./checker/fixes"), exports);
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "0.16.0";
1
+ export declare const PACKAGE_VERSION = "0.16.1";
@@ -5,4 +5,4 @@ exports.PACKAGE_VERSION = void 0;
5
5
  // scripts/build-packages.cjs (a source and its build sit at different depths
6
6
  // beside package.json, so neither can require it by one relative path).
7
7
  // __test__/language_version.unit.test.ts holds it equal to package.json.
8
- exports.PACKAGE_VERSION = '0.16.0';
8
+ exports.PACKAGE_VERSION = '0.16.1';
Binary file
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@listen-fire/movement-lang",
3
3
  "license": "Apache-2.0",
4
- "version": "0.16.0",
4
+ "version": "0.16.1",
5
5
  "description": "The data-movement language: the wasm parser, checker and engine with their loader and bindings, the version rule, the expression AST and the types the contracts name",
6
6
  "engines": {
7
7
  "node": ">=22.23.4 <23"