dirac-lang 0.1.29 → 0.1.30

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,6 +1,6 @@
1
1
  import {
2
2
  integrate
3
- } from "./chunk-VURAZURY.js";
3
+ } from "./chunk-Y57EPVOA.js";
4
4
  import {
5
5
  DiracParser
6
6
  } from "./chunk-HRHAMPOB.js";
@@ -379,9 +379,10 @@ async function executeLoop(session, element) {
379
379
  if (!countAttr) {
380
380
  throw new Error("<loop> requires count attribute");
381
381
  }
382
- const count = parseInt(substituteVariables(session, countAttr), 10);
382
+ const substitutedCount = substituteAttribute(session, countAttr);
383
+ const count = parseInt(substitutedCount, 10);
383
384
  if (isNaN(count) || count < 0) {
384
- throw new Error(`Invalid loop count: ${countAttr}`);
385
+ throw new Error(`Invalid loop count: ${countAttr} (evaluated to: ${substitutedCount})`);
385
386
  }
386
387
  const wasBreak = session.isBreak;
387
388
  session.isBreak = false;
@@ -419,12 +420,12 @@ async function executeIf(session, element) {
419
420
  const condition = await evaluatePredicate(session, conditionElement);
420
421
  if (condition) {
421
422
  if (thenElement) {
422
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-BB4H4XG4.js");
423
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-NNPKC43F.js");
423
424
  await integrateChildren2(session, thenElement);
424
425
  }
425
426
  } else {
426
427
  if (elseElement) {
427
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-BB4H4XG4.js");
428
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-NNPKC43F.js");
428
429
  await integrateChildren2(session, elseElement);
429
430
  }
430
431
  }
@@ -437,7 +438,7 @@ async function evaluatePredicate(session, predicateElement) {
437
438
  return await evaluateCondition(session, predicateElement);
438
439
  }
439
440
  const outputLengthBefore = session.output.length;
440
- const { integrate: integrate2 } = await import("./interpreter-BB4H4XG4.js");
441
+ const { integrate: integrate2 } = await import("./interpreter-NNPKC43F.js");
441
442
  await integrate2(session, predicateElement);
442
443
  const newOutputChunks = session.output.slice(outputLengthBefore);
443
444
  const result = newOutputChunks.join("").trim();
@@ -460,11 +461,11 @@ async function evaluateCondition(session, condElement) {
460
461
  }
461
462
  const outputLengthBefore = session.output.length;
462
463
  const args = [];
463
- const { integrate: integrate2 } = await import("./interpreter-BB4H4XG4.js");
464
+ const { integrate: integrate2 } = await import("./interpreter-NNPKC43F.js");
464
465
  for (const child of condElement.children) {
465
466
  if (child.tag.toLowerCase() === "arg") {
466
467
  const argOutputStart = session.output.length;
467
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-BB4H4XG4.js");
468
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-NNPKC43F.js");
468
469
  await integrateChildren2(session, child);
469
470
  const newChunks = session.output.slice(argOutputStart);
470
471
  const argValue = newChunks.join("");
@@ -1323,7 +1324,7 @@ async function executeTagCheck(session, element) {
1323
1324
  const executeTag = correctedTag || tagName;
1324
1325
  console.error(`[tag-check] Executing <${executeTag}/> as all checks passed and execute=true.`);
1325
1326
  const elementToExecute = correctedTag ? { ...child, tag: correctedTag } : child;
1326
- const { integrate: integrate2 } = await import("./interpreter-BB4H4XG4.js");
1327
+ const { integrate: integrate2 } = await import("./interpreter-NNPKC43F.js");
1327
1328
  await integrate2(session, elementToExecute);
1328
1329
  }
1329
1330
  }
@@ -1332,7 +1333,7 @@ async function executeTagCheck(session, element) {
1332
1333
  // src/tags/throw.ts
1333
1334
  async function executeThrow(session, element) {
1334
1335
  const exceptionName = element.attributes?.name || "exception";
1335
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-BB4H4XG4.js");
1336
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-NNPKC43F.js");
1336
1337
  const exceptionDom = {
1337
1338
  tag: "exception-content",
1338
1339
  attributes: { name: exceptionName },
@@ -1345,7 +1346,7 @@ async function executeThrow(session, element) {
1345
1346
  // src/tags/try.ts
1346
1347
  async function executeTry(session, element) {
1347
1348
  setExceptionBoundary(session);
1348
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-BB4H4XG4.js");
1349
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-NNPKC43F.js");
1349
1350
  await integrateChildren2(session, element);
1350
1351
  unsetExceptionBoundary(session);
1351
1352
  }
@@ -1355,7 +1356,7 @@ async function executeCatch(session, element) {
1355
1356
  const exceptionName = element.attributes?.name || "exception";
1356
1357
  const caughtCount = lookupException(session, exceptionName);
1357
1358
  if (caughtCount > 0) {
1358
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-BB4H4XG4.js");
1359
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-NNPKC43F.js");
1359
1360
  await integrateChildren2(session, element);
1360
1361
  }
1361
1362
  flushCurrentException(session);
@@ -1364,7 +1365,7 @@ async function executeCatch(session, element) {
1364
1365
  // src/tags/exception.ts
1365
1366
  async function executeException(session, element) {
1366
1367
  const exceptions = getCurrentExceptions(session);
1367
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-BB4H4XG4.js");
1368
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-NNPKC43F.js");
1368
1369
  for (const exceptionDom of exceptions) {
1369
1370
  await integrateChildren2(session, exceptionDom);
1370
1371
  }
@@ -1504,7 +1505,7 @@ async function executeForeach(session, element) {
1504
1505
  const parser2 = new DiracParser2();
1505
1506
  try {
1506
1507
  const fromElement = parser2.parse(fromAttr);
1507
- const { integrate: integrate2 } = await import("./interpreter-BB4H4XG4.js");
1508
+ const { integrate: integrate2 } = await import("./interpreter-NNPKC43F.js");
1508
1509
  await integrate2(session, fromElement);
1509
1510
  } catch (e) {
1510
1511
  session.output = savedOutput;
package/dist/cli.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  execute
4
- } from "./chunk-YV6QRRMT.js";
5
- import "./chunk-VURAZURY.js";
4
+ } from "./chunk-QPYWRBBT.js";
5
+ import "./chunk-Y57EPVOA.js";
6
6
  import "./chunk-HRHAMPOB.js";
7
7
  import "./chunk-LXF5PGUX.js";
8
8
  import "./chunk-BSQV77YM.js";
@@ -13,7 +13,7 @@ import "dotenv/config";
13
13
  // package.json
14
14
  var package_default = {
15
15
  name: "dirac-lang",
16
- version: "0.1.28",
16
+ version: "0.1.29",
17
17
  description: "LLM-Augmented Declarative Execution",
18
18
  type: "module",
19
19
  main: "dist/index.js",
package/dist/index.js CHANGED
@@ -2,10 +2,10 @@ import {
2
2
  createLLMAdapter,
3
3
  execute,
4
4
  executeUserCommand
5
- } from "./chunk-YV6QRRMT.js";
5
+ } from "./chunk-QPYWRBBT.js";
6
6
  import {
7
7
  integrate
8
- } from "./chunk-VURAZURY.js";
8
+ } from "./chunk-Y57EPVOA.js";
9
9
  import {
10
10
  DiracParser
11
11
  } from "./chunk-HRHAMPOB.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  integrate,
3
3
  integrateChildren
4
- } from "./chunk-VURAZURY.js";
4
+ } from "./chunk-Y57EPVOA.js";
5
5
  import "./chunk-HRHAMPOB.js";
6
6
  import "./chunk-LXF5PGUX.js";
7
7
  import "./chunk-BSQV77YM.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  integrate
3
- } from "./chunk-VURAZURY.js";
3
+ } from "./chunk-Y57EPVOA.js";
4
4
  import {
5
5
  DiracParser
6
6
  } from "./chunk-HRHAMPOB.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dirac-lang",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "LLM-Augmented Declarative Execution",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",