dirac-lang 0.1.18 → 0.1.19

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.
@@ -85,7 +85,8 @@ async function executeDefvar(session, element) {
85
85
  const valueAttr = element.attributes.value;
86
86
  const visibleAttr = element.attributes.visible || "false";
87
87
  const literal = "literal" in element.attributes;
88
- const trim = "trim" in element.attributes;
88
+ const trimAttr = element.attributes.trim;
89
+ const trim = trimAttr !== "false";
89
90
  if (!name) {
90
91
  throw new Error("<defvar> requires name attribute");
91
92
  }
@@ -396,12 +397,12 @@ async function executeIf(session, element) {
396
397
  const condition = await evaluatePredicate(session, conditionElement);
397
398
  if (condition) {
398
399
  if (thenElement) {
399
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-MCDR5L7R.js");
400
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-JTOTDC46.js");
400
401
  await integrateChildren2(session, thenElement);
401
402
  }
402
403
  } else {
403
404
  if (elseElement) {
404
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-MCDR5L7R.js");
405
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-JTOTDC46.js");
405
406
  await integrateChildren2(session, elseElement);
406
407
  }
407
408
  }
@@ -414,7 +415,7 @@ async function evaluatePredicate(session, predicateElement) {
414
415
  return await evaluateCondition(session, predicateElement);
415
416
  }
416
417
  const outputLengthBefore = session.output.length;
417
- const { integrate: integrate2 } = await import("./interpreter-MCDR5L7R.js");
418
+ const { integrate: integrate2 } = await import("./interpreter-JTOTDC46.js");
418
419
  await integrate2(session, predicateElement);
419
420
  const newOutputChunks = session.output.slice(outputLengthBefore);
420
421
  const result = newOutputChunks.join("").trim();
@@ -437,11 +438,11 @@ async function evaluateCondition(session, condElement) {
437
438
  }
438
439
  const outputLengthBefore = session.output.length;
439
440
  const args = [];
440
- const { integrate: integrate2 } = await import("./interpreter-MCDR5L7R.js");
441
+ const { integrate: integrate2 } = await import("./interpreter-JTOTDC46.js");
441
442
  for (const child of condElement.children) {
442
443
  if (child.tag.toLowerCase() === "arg") {
443
444
  const argOutputStart = session.output.length;
444
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-MCDR5L7R.js");
445
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-JTOTDC46.js");
445
446
  await integrateChildren2(session, child);
446
447
  const newChunks = session.output.slice(argOutputStart);
447
448
  const argValue = newChunks.join("");
@@ -1244,7 +1245,7 @@ async function executeTagCheck(session, element) {
1244
1245
  const executeTag = correctedTag || tagName;
1245
1246
  console.error(`[tag-check] Executing <${executeTag}/> as all checks passed and execute=true.`);
1246
1247
  const elementToExecute = correctedTag ? { ...child, tag: correctedTag } : child;
1247
- const { integrate: integrate2 } = await import("./interpreter-MCDR5L7R.js");
1248
+ const { integrate: integrate2 } = await import("./interpreter-JTOTDC46.js");
1248
1249
  await integrate2(session, elementToExecute);
1249
1250
  }
1250
1251
  }
@@ -1253,7 +1254,7 @@ async function executeTagCheck(session, element) {
1253
1254
  // src/tags/throw.ts
1254
1255
  async function executeThrow(session, element) {
1255
1256
  const exceptionName = element.attributes?.name || "exception";
1256
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-MCDR5L7R.js");
1257
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-JTOTDC46.js");
1257
1258
  const exceptionDom = {
1258
1259
  tag: "exception-content",
1259
1260
  attributes: { name: exceptionName },
@@ -1266,7 +1267,7 @@ async function executeThrow(session, element) {
1266
1267
  // src/tags/try.ts
1267
1268
  async function executeTry(session, element) {
1268
1269
  setExceptionBoundary(session);
1269
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-MCDR5L7R.js");
1270
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-JTOTDC46.js");
1270
1271
  await integrateChildren2(session, element);
1271
1272
  unsetExceptionBoundary(session);
1272
1273
  }
@@ -1276,7 +1277,7 @@ async function executeCatch(session, element) {
1276
1277
  const exceptionName = element.attributes?.name || "exception";
1277
1278
  const caughtCount = lookupException(session, exceptionName);
1278
1279
  if (caughtCount > 0) {
1279
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-MCDR5L7R.js");
1280
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-JTOTDC46.js");
1280
1281
  await integrateChildren2(session, element);
1281
1282
  }
1282
1283
  flushCurrentException(session);
@@ -1285,7 +1286,7 @@ async function executeCatch(session, element) {
1285
1286
  // src/tags/exception.ts
1286
1287
  async function executeException(session, element) {
1287
1288
  const exceptions = getCurrentExceptions(session);
1288
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-MCDR5L7R.js");
1289
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-JTOTDC46.js");
1289
1290
  for (const exceptionDom of exceptions) {
1290
1291
  await integrateChildren2(session, exceptionDom);
1291
1292
  }
@@ -1425,7 +1426,7 @@ async function executeForeach(session, element) {
1425
1426
  const parser2 = new DiracParser2();
1426
1427
  try {
1427
1428
  const fromElement = parser2.parse(fromAttr);
1428
- const { integrate: integrate2 } = await import("./interpreter-MCDR5L7R.js");
1429
+ const { integrate: integrate2 } = await import("./interpreter-JTOTDC46.js");
1429
1430
  await integrate2(session, fromElement);
1430
1431
  } catch (e) {
1431
1432
  session.output = savedOutput;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  integrate
3
- } from "./chunk-VZEKPMWN.js";
3
+ } from "./chunk-GR6KWGCI.js";
4
4
  import {
5
5
  DiracParser
6
6
  } from "./chunk-HRHAMPOB.js";
package/dist/cli.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  execute
4
- } from "./chunk-E2MR7FMI.js";
5
- import "./chunk-VZEKPMWN.js";
4
+ } from "./chunk-QMFCOZ5D.js";
5
+ import "./chunk-GR6KWGCI.js";
6
6
  import "./chunk-HRHAMPOB.js";
7
7
  import "./chunk-E7PWEMZA.js";
8
8
  import "./chunk-52ED23DR.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.18",
16
+ version: "0.1.19",
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-E2MR7FMI.js";
5
+ } from "./chunk-QMFCOZ5D.js";
6
6
  import {
7
7
  integrate
8
- } from "./chunk-VZEKPMWN.js";
8
+ } from "./chunk-GR6KWGCI.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-VZEKPMWN.js";
4
+ } from "./chunk-GR6KWGCI.js";
5
5
  import "./chunk-HRHAMPOB.js";
6
6
  import "./chunk-E7PWEMZA.js";
7
7
  import "./chunk-52ED23DR.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  integrate
3
- } from "./chunk-VZEKPMWN.js";
3
+ } from "./chunk-GR6KWGCI.js";
4
4
  import {
5
5
  DiracParser
6
6
  } from "./chunk-HRHAMPOB.js";
@@ -18,9 +18,9 @@
18
18
  <output></output>
19
19
 
20
20
  <!-- Define variables in main scope -->
21
- <defvar name="x" trim="true">value-x</defvar>
22
- <defvar name="y" trim="true">value-y</defvar>
23
- <defvar name="z" trim="true">value-z</defvar>
21
+ <defvar name="x">value-x</defvar>
22
+ <defvar name="y">value-y</defvar>
23
+ <defvar name="z">value-z</defvar>
24
24
 
25
25
  <output>Variables defined in main scope:</output>
26
26
  <output> x = <variable name="x" /></output>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dirac-lang",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "LLM-Augmented Declarative Execution",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -14,7 +14,8 @@ export async function executeDefvar(session: DiracSession, element: DiracElement
14
14
  const valueAttr = element.attributes.value;
15
15
  const visibleAttr = element.attributes.visible || 'false';
16
16
  const literal = 'literal' in element.attributes;
17
- const trim = 'trim' in element.attributes; // Support trim attribute to remove leading/trailing whitespace
17
+ const trimAttr = element.attributes.trim;
18
+ const trim = trimAttr !== 'false'; // Trim by default unless explicitly set to false
18
19
 
19
20
  if (!name) {
20
21
  throw new Error('<defvar> requires name attribute');
@@ -18,9 +18,9 @@ main after outer: a=x b=y c=z -->
18
18
  </subroutine>
19
19
 
20
20
  <!-- Define main scope variables -->
21
- <defvar name="a" trim="true">x</defvar>
22
- <defvar name="b" trim="true">y</defvar>
23
- <defvar name="c" trim="true">z</defvar>
21
+ <defvar name="a">x</defvar>
22
+ <defvar name="b">y</defvar>
23
+ <defvar name="c">z</defvar>
24
24
 
25
25
  <output>main: a=<variable name="a" /> b=<variable name="b" /> c=<variable name="c" /></output>
26
26
 
@@ -15,9 +15,9 @@ x=a y=b z=c -->
15
15
  </subroutine>
16
16
 
17
17
  <!-- Define main scope variables -->
18
- <defvar name="x" trim="true">a</defvar>
19
- <defvar name="y" trim="true">b</defvar>
20
- <defvar name="z" trim="true">c</defvar>
18
+ <defvar name="x">a</defvar>
19
+ <defvar name="y">b</defvar>
20
+ <defvar name="z">c</defvar>
21
21
 
22
22
  <!-- Verify initial state -->
23
23
  <output>x=<variable name="x" /> y=<variable name="y" /> z=<variable name="z" /></output>
@@ -18,7 +18,7 @@ Color changed to: red -->
18
18
  </subroutine>
19
19
 
20
20
  <!-- Test: tag-check should auto-correct similar tag names and execute -->
21
- <defvar name="result" trim="true">
21
+ <defvar name="result">
22
22
  <tag-check execute="true" autocorrect="true">
23
23
  <background-set color="red" />
24
24
  </tag-check>
package/test-eval.di DELETED
@@ -1,4 +0,0 @@
1
- <dirac>
2
- <eval name="test">"hello"</eval>
3
- <output>test=$test</output>
4
- </dirac>