@traqula/rules-sparql-1-1-adjust 0.0.8 → 0.0.9

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.
Files changed (2) hide show
  1. package/lib/index.cjs +21 -7
  2. package/package.json +4 -4
package/lib/index.cjs CHANGED
@@ -12798,7 +12798,7 @@ var inlineData = {
12798
12798
  return ACTION(() => C.factory.patternValues(datablock.val, C.factory.sourceLocation(values3, datablock)));
12799
12799
  },
12800
12800
  gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { factory: F2 }) => {
12801
- const variables = Object.keys(ast.values[0]);
12801
+ const variables = Object.keys(ast.values.at(0) ?? {});
12802
12802
  F2.printFilter(ast, () => {
12803
12803
  PRINT_WORD("VALUES", "(");
12804
12804
  for (const variable of variables) {
@@ -13023,7 +13023,7 @@ var argList = {
13023
13023
  F2.printFilter(ast, () => {
13024
13024
  PRINT_WORD("(");
13025
13025
  if (ast.val.distinct) {
13026
- PRINT_WORD("distinct");
13026
+ PRINT_WORD("DISTINCT");
13027
13027
  }
13028
13028
  });
13029
13029
  const [head2, ...tail] = ast.val.args;
@@ -13077,7 +13077,7 @@ var expression = {
13077
13077
  } else if (ast.operator === "in") {
13078
13078
  PRINT_WORD("IN");
13079
13079
  } else {
13080
- PRINT_WORD(ast.operator);
13080
+ PRINT_WORD(ast.operator.toUpperCase());
13081
13081
  }
13082
13082
  });
13083
13083
  if (right.length === 1) {
@@ -13088,10 +13088,10 @@ var expression = {
13088
13088
  F2.printFilter(ast, () => PRINT_WORD(")"));
13089
13089
  } else if (prefixOperator.has(ast.operator)) {
13090
13090
  const [expr] = ast.args;
13091
- F2.printFilter(ast, () => PRINT_WORD(ast.operator));
13091
+ F2.printFilter(ast, () => PRINT_WORD(ast.operator.toUpperCase()));
13092
13092
  SUBRULE(expression, expr);
13093
13093
  } else {
13094
- F2.printFilter(ast, () => PRINT_WORD(ast.operator, "("));
13094
+ F2.printFilter(ast, () => PRINT_WORD(ast.operator.toUpperCase(), "("));
13095
13095
  const [head2, ...tail] = ast.args;
13096
13096
  if (head2) {
13097
13097
  SUBRULE(expression, head2);
@@ -14001,11 +14001,18 @@ var update = {
14001
14001
  });
14002
14002
  },
14003
14003
  gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { factory: F2 }) => {
14004
- for (const update2 of ast.updates) {
14004
+ const [head2, ...tail] = ast.updates;
14005
+ if (head2) {
14006
+ SUBRULE(prologue, head2.context);
14007
+ if (head2.operation) {
14008
+ SUBRULE(update1, head2.operation);
14009
+ }
14010
+ }
14011
+ for (const update2 of tail) {
14012
+ F2.printFilter(ast, () => PRINT_WORD(";\n"));
14005
14013
  SUBRULE(prologue, update2.context);
14006
14014
  if (update2.operation) {
14007
14015
  SUBRULE(update1, update2.operation);
14008
- F2.printFilter(ast, () => PRINT_WORD(" ;\n"));
14009
14016
  }
14010
14017
  }
14011
14018
  }
@@ -14468,6 +14475,13 @@ var queryOrUpdate = {
14468
14475
  });
14469
14476
  } }
14470
14477
  ]);
14478
+ },
14479
+ gImpl: ({ SUBRULE }) => (ast, { factory: F2 }) => {
14480
+ if (F2.isQuery(ast)) {
14481
+ SUBRULE(query, ast);
14482
+ } else {
14483
+ SUBRULE(update, ast);
14484
+ }
14471
14485
  }
14472
14486
  };
14473
14487
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@traqula/rules-sparql-1-1-adjust",
3
3
  "type": "module",
4
- "version": "0.0.8",
4
+ "version": "0.0.9",
5
5
  "description": "Traqula Lexer and Grammar Rules for sparql 1.1-ADJUST",
6
6
  "lsd:module": true,
7
7
  "license": "MIT",
@@ -41,8 +41,8 @@
41
41
  "build:transpile": " node \"../../node_modules/esbuild/bin/esbuild\" --format=cjs --bundle --log-level=error --outfile=lib/index.cjs lib/index.ts"
42
42
  },
43
43
  "dependencies": {
44
- "@traqula/core": "^0.0.8",
45
- "@traqula/rules-sparql-1-1": "^0.0.8"
44
+ "@traqula/core": "^0.0.9",
45
+ "@traqula/rules-sparql-1-1": "^0.0.9"
46
46
  },
47
- "gitHead": "83f3476c64e149c0546c9fbb63fb30a95ca6b410"
47
+ "gitHead": "c13cd255122c688daad98bf313a3397cbffdc45d"
48
48
  }