@traqula/parser-sparql-1-1-adjust 0.0.19 → 0.0.21

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.
package/lib/Parser.d.ts CHANGED
@@ -159,9 +159,9 @@ export declare const adjustParserBuilder: ParserBuilder<import("@traqula/rules-s
159
159
  serviceGraphPattern: import("@traqula/core").ParserRule<any, "serviceGraphPattern", unknown, any[]> & import("@traqula/rules-sparql-1-1").SparqlGrammarRule<"serviceGraphPattern", import("@traqula/rules-sparql-1-1").PatternService, []> & import("@traqula/rules-sparql-1-1").SparqlGeneratorRule<"serviceGraphPattern", import("@traqula/rules-sparql-1-1").PatternService, []>;
160
160
  inlineData: import("@traqula/core").ParserRule<any, "inlineData", unknown, any[]> & import("@traqula/rules-sparql-1-1").SparqlGrammarRule<"inlineData", import("@traqula/rules-sparql-1-1").PatternValues, []> & import("@traqula/rules-sparql-1-1").SparqlGeneratorRule<"inlineData", import("@traqula/rules-sparql-1-1").PatternValues, []>;
161
161
  constraint: import("@traqula/core").ParserRule<any, "constraint", unknown, any[]> & import("@traqula/rules-sparql-1-1").SparqlGrammarRule<"constraint", import("@traqula/rules-sparql-1-1").Expression, []>;
162
- dataBlock: import("@traqula/core").ParserRule<any, "dataBlock", unknown, any[]> & import("@traqula/rules-sparql-1-1").SparqlGrammarRule<"dataBlock", import("@traqula/core").Wrap<import("@traqula/rules-sparql-1-1").ValuePatternRow[]>, []>;
163
- inlineDataOneVar: import("@traqula/core").ParserRule<any, "inlineDataOneVar", unknown, any[]> & import("@traqula/rules-sparql-1-1").SparqlGrammarRule<"inlineDataOneVar", import("@traqula/core").Wrap<import("@traqula/rules-sparql-1-1").ValuePatternRow[]>, []>;
164
- inlineDataFull: import("@traqula/core").ParserRule<any, "inlineDataFull", unknown, any[]> & import("@traqula/rules-sparql-1-1").SparqlGrammarRule<"inlineDataFull", import("@traqula/core").Wrap<import("@traqula/rules-sparql-1-1").ValuePatternRow[]>, []>;
162
+ dataBlock: import("@traqula/core").ParserRule<any, "dataBlock", unknown, any[]> & import("@traqula/rules-sparql-1-1").SparqlGrammarRule<"dataBlock", import("@traqula/rules-sparql-1-1").PatternValues, []>;
163
+ inlineDataOneVar: import("@traqula/core").ParserRule<any, "inlineDataOneVar", unknown, any[]> & import("@traqula/rules-sparql-1-1").SparqlGrammarRule<"inlineDataOneVar", import("@traqula/rules-sparql-1-1").PatternValues, []>;
164
+ inlineDataFull: import("@traqula/core").ParserRule<any, "inlineDataFull", unknown, any[]> & import("@traqula/rules-sparql-1-1").SparqlGrammarRule<"inlineDataFull", import("@traqula/rules-sparql-1-1").PatternValues, []>;
165
165
  dataBlockValue: import("@traqula/core").ParserRule<any, "dataBlockValue", unknown, any[]> & import("@traqula/rules-sparql-1-1").SparqlGrammarRule<"dataBlockValue", import("@traqula/rules-sparql-1-1").TermIri | import("@traqula/rules-sparql-1-1").TermLiteral | undefined, []>;
166
166
  groupClause: import("@traqula/core").ParserRule<any, "groupClause", unknown, any[]> & import("@traqula/rules-sparql-1-1").SparqlGrammarRule<"groupClause", import("@traqula/rules-sparql-1-1").SolutionModifierGroup, []> & import("@traqula/rules-sparql-1-1").SparqlGeneratorRule<"groupClause", import("@traqula/rules-sparql-1-1").SolutionModifierGroup, []>;
167
167
  havingClause: import("@traqula/core").ParserRule<any, "havingClause", unknown, any[]> & import("@traqula/rules-sparql-1-1").SparqlGrammarRule<"havingClause", import("@traqula/rules-sparql-1-1").SolutionModifierHaving, []> & import("@traqula/rules-sparql-1-1").SparqlGeneratorRule<"havingClause", import("@traqula/rules-sparql-1-1").SolutionModifierHaving, []>;
package/lib/index.cjs CHANGED
@@ -43,7 +43,7 @@ var AstCoreFactory = class {
43
43
  if (filtered.length === 0) {
44
44
  return this.gen();
45
45
  }
46
- const first2 = filtered[0];
46
+ const first2 = filtered.at(0);
47
47
  const last2 = filtered.at(-1);
48
48
  return {
49
49
  sourceLocationType: "source",
@@ -9656,6 +9656,9 @@ var ParserBuilder = class _ParserBuilder {
9656
9656
  delete this.rules[ruleName];
9657
9657
  return this;
9658
9658
  }
9659
+ getRule(ruleName) {
9660
+ return this.rules[ruleName];
9661
+ }
9659
9662
  /**
9660
9663
  * Merge this grammar builder with another.
9661
9664
  * It is best to merge the bigger grammar with the smaller one.
@@ -9742,21 +9745,34 @@ ${firstError.message}`);
9742
9745
  }
9743
9746
  };
9744
9747
 
9745
- // ../../packages/core/lib/Transformers.js
9746
- var TransformerType = class {
9747
- clone(obj) {
9748
- const newObj = Object.create(Object.getPrototypeOf(obj));
9749
- Object.defineProperties(newObj, Object.getOwnPropertyDescriptors(obj));
9750
- return newObj;
9748
+ // ../../packages/core/lib/TransformerObject.js
9749
+ var TransformerObject = class _TransformerObject {
9750
+ defaultContext;
9751
+ maxStackSize = 1e6;
9752
+ /**
9753
+ * Creates stateless transformer.
9754
+ * @param defaultContext
9755
+ */
9756
+ constructor(defaultContext = {}) {
9757
+ this.defaultContext = defaultContext;
9751
9758
  }
9752
- safeObjectVisit(value, mapper) {
9753
- if (value && typeof value === "object") {
9754
- if (Array.isArray(value)) {
9755
- return value.map((x) => this.safeObjectVisit(x, mapper));
9756
- }
9757
- return mapper(value);
9759
+ clone(newDefaultContext = {}) {
9760
+ return new _TransformerObject({ ...this.defaultContext, ...newDefaultContext });
9761
+ }
9762
+ /**
9763
+ * Function to shallow clone any type.
9764
+ * @param obj
9765
+ * @protected
9766
+ */
9767
+ cloneObj(obj) {
9768
+ if (obj === null || typeof obj !== "object") {
9769
+ return obj;
9758
9770
  }
9759
- return value;
9771
+ const proto = Object.getPrototypeOf(obj);
9772
+ if (proto === Object.prototype || proto === null) {
9773
+ return { ...obj };
9774
+ }
9775
+ return Object.assign(Object.create(proto), obj);
9760
9776
  }
9761
9777
  /**
9762
9778
  * Recursively transforms all objects that are not arrays. Mapper is called on deeper objects first.
@@ -9768,90 +9784,231 @@ var TransformerType = class {
9768
9784
  * - Default false
9769
9785
  */
9770
9786
  transformObject(startObject, mapper, preVisitor = () => ({})) {
9787
+ const defaults2 = this.defaultContext;
9788
+ const defaultCopyFlag = defaults2.copy ?? true;
9789
+ const defaultContinues = defaults2.continue ?? true;
9790
+ const defaultIgnoreKeys = defaults2.ignoreKeys;
9791
+ const defaultShallowKeys = defaults2.shallowKeys;
9792
+ const defaultDidShortCut = defaults2.shortcut ?? false;
9771
9793
  let didShortCut = false;
9772
- const recurse = (curObject) => {
9773
- const copy3 = this.clone(curObject);
9774
- const context = preVisitor(copy3);
9775
- didShortCut = context.shortcut ?? false;
9776
- const continues = context.continue ?? true;
9777
- if (continues && !didShortCut) {
9778
- for (const [key, value] of Object.entries(copy3)) {
9779
- if (didShortCut) {
9780
- return copy3;
9794
+ const resultWrap = { res: startObject };
9795
+ const stack = [startObject];
9796
+ const stackParent = [resultWrap];
9797
+ const stackParentKey = ["res"];
9798
+ const handleMapperOnLen = [];
9799
+ const mapperCopyStack = [];
9800
+ const mapperOrigStack = [];
9801
+ const mapperParent = [];
9802
+ const mapperParentKey = [];
9803
+ function handleMapper() {
9804
+ while (stack.length === handleMapperOnLen.at(-1)) {
9805
+ handleMapperOnLen.pop();
9806
+ const copyToMap = mapperCopyStack.pop();
9807
+ const origToMap = mapperOrigStack.pop();
9808
+ const parent = mapperParent.pop();
9809
+ const parentKey = mapperParentKey.pop();
9810
+ parent[parentKey] = mapper(copyToMap, origToMap);
9811
+ }
9812
+ }
9813
+ while (stack.length > 0 && stack.length < this.maxStackSize) {
9814
+ const curObject = stack.pop();
9815
+ const curParent = stackParent.pop();
9816
+ const curKey = stackParentKey.pop();
9817
+ if (!didShortCut) {
9818
+ if (Array.isArray(curObject)) {
9819
+ const newArr = [...curObject];
9820
+ handleMapperOnLen.push(stack.length);
9821
+ mapperCopyStack.push(newArr);
9822
+ mapperOrigStack.push(curObject);
9823
+ mapperParent.push(curParent);
9824
+ mapperParentKey.push(curKey);
9825
+ for (let index = curObject.length - 1; index >= 0; index--) {
9826
+ const val = curObject[index];
9827
+ if (val !== null && typeof val === "object") {
9828
+ stack.push(val);
9829
+ stackParent.push(newArr);
9830
+ stackParentKey.push(index.toString());
9831
+ }
9832
+ }
9833
+ handleMapper();
9834
+ continue;
9835
+ }
9836
+ const context = preVisitor(curObject);
9837
+ const copyFlag = context.copy ?? defaultCopyFlag;
9838
+ const continues = context.continue ?? defaultContinues;
9839
+ const ignoreKeys = context.ignoreKeys ?? defaultIgnoreKeys;
9840
+ const shallowKeys = context.shallowKeys ?? defaultShallowKeys;
9841
+ didShortCut = context.shortcut ?? defaultDidShortCut;
9842
+ const copy3 = copyFlag ? this.cloneObj(curObject) : curObject;
9843
+ handleMapperOnLen.push(stack.length);
9844
+ mapperCopyStack.push(copy3);
9845
+ mapperOrigStack.push(curObject);
9846
+ mapperParent.push(curParent);
9847
+ mapperParentKey.push(curKey);
9848
+ if (continues && !didShortCut) {
9849
+ for (const key in copy3) {
9850
+ if (!Object.hasOwn(copy3, key)) {
9851
+ continue;
9852
+ }
9853
+ const val = copy3[key];
9854
+ const onlyShallow = shallowKeys && shallowKeys?.has(key);
9855
+ if (onlyShallow) {
9856
+ copy3[key] = this.cloneObj(val);
9857
+ }
9858
+ if (ignoreKeys && ignoreKeys.has(key)) {
9859
+ continue;
9860
+ }
9861
+ if (!onlyShallow && val !== null && typeof val === "object") {
9862
+ stack.push(val);
9863
+ stackParentKey.push(key);
9864
+ stackParent.push(copy3);
9865
+ }
9781
9866
  }
9782
- copy3[key] = this.safeObjectVisit(value, (obj) => recurse(obj));
9783
9867
  }
9784
9868
  }
9785
- return mapper(copy3);
9786
- };
9787
- return recurse(startObject);
9869
+ handleMapper();
9870
+ }
9871
+ if (stack.length >= this.maxStackSize) {
9872
+ throw new Error("Transform object stack overflowed");
9873
+ }
9874
+ handleMapper();
9875
+ return resultWrap.res;
9788
9876
  }
9789
9877
  /**
9790
9878
  * Visitor that visits all objects. Visits deeper objects first.
9791
9879
  */
9792
9880
  visitObject(startObject, visitor, preVisitor = () => ({})) {
9881
+ const defaults2 = this.defaultContext;
9882
+ const defaultContinues = defaults2.continue ?? true;
9883
+ const defaultIgnoreKeys = defaults2.ignoreKeys;
9884
+ const defaultShortcut = defaults2.shortcut ?? false;
9793
9885
  let didShortCut = false;
9794
- const recurse = (curObject) => {
9795
- const context = preVisitor(curObject);
9796
- didShortCut = context.shortcut ?? false;
9797
- const continues = context.continue ?? true;
9798
- if (continues && !didShortCut) {
9799
- for (const value of Object.values(curObject)) {
9800
- if (didShortCut) {
9801
- return;
9886
+ const stack = [startObject];
9887
+ const handleVisitorOnLen = [];
9888
+ const visitorStack = [];
9889
+ function handleVisitor() {
9890
+ while (stack.length === handleVisitorOnLen.at(-1)) {
9891
+ handleVisitorOnLen.pop();
9892
+ const toVisit = visitorStack.pop();
9893
+ visitor(toVisit);
9894
+ }
9895
+ }
9896
+ while (stack.length > 0 && stack.length < this.maxStackSize) {
9897
+ const curObject = stack.pop();
9898
+ if (!didShortCut) {
9899
+ if (Array.isArray(curObject)) {
9900
+ for (let i = curObject.length - 1; i >= 0; i--) {
9901
+ stack.push(curObject[i]);
9902
+ }
9903
+ handleVisitor();
9904
+ continue;
9905
+ }
9906
+ const context = preVisitor(curObject);
9907
+ didShortCut = context.shortcut ?? defaultShortcut;
9908
+ const continues = context.continue ?? defaultContinues;
9909
+ const ignoreKeys = context.ignoreKeys ?? defaultIgnoreKeys;
9910
+ handleVisitorOnLen.push(stack.length);
9911
+ visitorStack.push(curObject);
9912
+ if (continues && !didShortCut) {
9913
+ for (const key in curObject) {
9914
+ if (!Object.hasOwn(curObject, key)) {
9915
+ continue;
9916
+ }
9917
+ if (ignoreKeys && ignoreKeys.has(key)) {
9918
+ continue;
9919
+ }
9920
+ const val = curObject[key];
9921
+ if (val && typeof val === "object") {
9922
+ stack.push(val);
9923
+ }
9802
9924
  }
9803
- this.safeObjectVisit(value, (obj) => recurse(obj));
9804
9925
  }
9805
9926
  }
9806
- visitor(curObject);
9807
- };
9808
- recurse(startObject);
9927
+ handleVisitor();
9928
+ }
9929
+ if (stack.length >= this.maxStackSize) {
9930
+ throw new Error("Transform object stack overflowed");
9931
+ }
9932
+ handleVisitor();
9809
9933
  }
9934
+ };
9935
+
9936
+ // ../../packages/core/lib/TransformerTyped.js
9937
+ var TransformerTyped = class _TransformerTyped extends TransformerObject {
9938
+ defaultNodePreVisitor;
9939
+ constructor(defaultContext = {}, defaultNodePreVisitor = {}) {
9940
+ super(defaultContext);
9941
+ this.defaultNodePreVisitor = defaultNodePreVisitor;
9942
+ }
9943
+ clone(newDefaultContext = {}, newDefaultNodePreVisitor = {}) {
9944
+ return new _TransformerTyped({ ...this.defaultContext, ...newDefaultContext }, { ...this.defaultNodePreVisitor, ...newDefaultNodePreVisitor });
9945
+ }
9946
+ /**
9947
+ * Transform a single node.
9948
+ * The transformation calls the preVisitor from starting from the startObject.
9949
+ * The preVisitor can dictate whether transformation should be stopped.
9950
+ * Note that stopping the transformation also prevets further copying.
9951
+ * The transformer itself transforms object starting with the deepest one that can be visited.
9952
+ * The transformer callback is performed on a copy of the original.
9953
+ * @param startObject
9954
+ * @param nodeCallBacks
9955
+ */
9810
9956
  transformNode(startObject, nodeCallBacks) {
9811
- const transformWrapper = (curObject) => {
9812
- const casted = curObject;
9957
+ const transformWrapper = (copy3, orig) => {
9958
+ let ogTransform;
9959
+ const casted = copy3;
9813
9960
  if (casted.type) {
9814
- const ogFunc = nodeCallBacks[casted.type]?.transform;
9815
- if (ogFunc) {
9816
- return ogFunc(casted);
9817
- }
9961
+ ogTransform = nodeCallBacks[casted.type]?.transform;
9818
9962
  }
9819
- return curObject;
9963
+ return ogTransform ? ogTransform(casted, orig) : copy3;
9820
9964
  };
9821
- const preTransformWrapper = (curObject) => {
9965
+ const nodeDefaults = this.defaultNodePreVisitor;
9966
+ const preVisitWrapper = (curObject) => {
9967
+ let ogPreVisit;
9968
+ let nodeContext = {};
9822
9969
  const casted = curObject;
9823
9970
  if (casted.type) {
9824
- const ogFunc = nodeCallBacks[casted.type]?.preVisitor;
9825
- if (ogFunc) {
9826
- return ogFunc(casted);
9827
- }
9971
+ ogPreVisit = nodeCallBacks[casted.type]?.preVisitor;
9972
+ nodeContext = nodeDefaults[casted.type] ?? nodeContext;
9828
9973
  }
9829
- return {};
9974
+ return ogPreVisit ? { ...nodeContext, ...ogPreVisit(casted) } : nodeContext;
9830
9975
  };
9831
- return this.transformObject(startObject, transformWrapper, preTransformWrapper);
9976
+ return this.transformObject(startObject, transformWrapper, preVisitWrapper);
9832
9977
  }
9978
+ /**
9979
+ * Similar to {@link this.transformNode}, but without copying the startObject.
9980
+ * The pre-visitor visits starting from the root, going deeper, while the actual visitor goes in reverse.
9981
+ * @param startObject
9982
+ * @param nodeCallBacks
9983
+ */
9833
9984
  visitNode(startObject, nodeCallBacks) {
9834
- const visitWrapper = (curObject) => {
9985
+ const visitorWrapper = (curObject) => {
9835
9986
  const casted = curObject;
9836
9987
  if (casted.type) {
9837
- const ogFunc = nodeCallBacks[casted.type]?.visitor;
9838
- if (ogFunc) {
9839
- ogFunc(casted);
9988
+ const ogTransform = nodeCallBacks[casted.type]?.visitor;
9989
+ if (ogTransform) {
9990
+ ogTransform(casted);
9840
9991
  }
9841
9992
  }
9842
9993
  };
9994
+ const nodeDefaults = this.defaultNodePreVisitor;
9843
9995
  const preVisitWrapper = (curObject) => {
9996
+ let ogPreVisit;
9997
+ let nodeContext = {};
9844
9998
  const casted = curObject;
9845
9999
  if (casted.type) {
9846
- const ogFunc = nodeCallBacks[casted.type]?.preVisitor;
9847
- if (ogFunc) {
9848
- return ogFunc(casted);
9849
- }
10000
+ ogPreVisit = nodeCallBacks[casted.type]?.preVisitor;
10001
+ nodeContext = nodeDefaults[casted.type] ?? nodeContext;
9850
10002
  }
9851
- return {};
10003
+ return ogPreVisit ? { ...nodeContext, ...ogPreVisit(casted) } : nodeContext;
9852
10004
  };
9853
- this.visitObject(startObject, visitWrapper, preVisitWrapper);
10005
+ return this.visitObject(startObject, visitorWrapper, preVisitWrapper);
9854
10006
  }
10007
+ /**
10008
+ * Traverses only selected nodes as returned by the function.
10009
+ * @param currentNode
10010
+ * @param traverse
10011
+ */
9855
10012
  traverseNodes(currentNode, traverse) {
9856
10013
  let didShortCut = false;
9857
10014
  const recurse = (curNode) => {
@@ -9872,11 +10029,27 @@ var TransformerType = class {
9872
10029
  recurse(currentNode);
9873
10030
  }
9874
10031
  };
9875
- var TransformerSubType = class extends TransformerType {
10032
+
10033
+ // ../../packages/core/lib/TransformerSubTyped.js
10034
+ var TransformerSubTyped = class _TransformerSubTyped extends TransformerTyped {
10035
+ constructor(defaultContext = {}, defaultNodePreVisitor = {}) {
10036
+ super(defaultContext, defaultNodePreVisitor);
10037
+ }
10038
+ clone(newDefaultContext = {}, newDefaultNodePreVisitor = {}) {
10039
+ return new _TransformerSubTyped({ ...this.defaultContext, ...newDefaultContext }, { ...this.defaultNodePreVisitor, ...newDefaultNodePreVisitor });
10040
+ }
10041
+ /**
10042
+ * Shares the functionality and first two arguments with {@link this.transformNode}.
10043
+ * The third argument allows you to also transform based on the subType of objects.
10044
+ * Note that when a callback for the subtype is provided, the callback for the general type is **NOT** executed.
10045
+ * @param startObject
10046
+ * @param nodeCallBacks
10047
+ * @param nodeSpecificCallBacks
10048
+ */
9876
10049
  transformNodeSpecific(startObject, nodeCallBacks, nodeSpecificCallBacks) {
9877
- const transformWrapper = (curObject) => {
10050
+ const transformWrapper = (copy3, orig) => {
9878
10051
  let ogTransform;
9879
- const casted = curObject;
10052
+ const casted = copy3;
9880
10053
  if (casted.type && casted.subType) {
9881
10054
  const specific = nodeSpecificCallBacks[casted.type];
9882
10055
  if (specific) {
@@ -9886,7 +10059,7 @@ var TransformerSubType = class extends TransformerType {
9886
10059
  ogTransform = nodeCallBacks[casted.type]?.transform;
9887
10060
  }
9888
10061
  }
9889
- return ogTransform ? ogTransform(casted) : curObject;
10062
+ return ogTransform ? ogTransform(casted, orig) : copy3;
9890
10063
  };
9891
10064
  const preVisitWrapper = (curObject) => {
9892
10065
  let ogPreVisit;
@@ -9900,12 +10073,13 @@ var TransformerSubType = class extends TransformerType {
9900
10073
  ogPreVisit = nodeCallBacks[casted.type]?.preVisitor;
9901
10074
  }
9902
10075
  }
9903
- return ogPreVisit ? ogPreVisit(casted) : curObject;
10076
+ return ogPreVisit ? ogPreVisit(casted) : {};
9904
10077
  };
9905
10078
  return this.transformObject(startObject, transformWrapper, preVisitWrapper);
9906
10079
  }
9907
10080
  /**
9908
- * When both nodeCallBack and NodeSpecific callBack are matched, will only look at nodeSpecifCallback
10081
+ * Similar to {@link this.visitNode} but also allows you to match based on the subtype of objects.
10082
+ * When both nodeCallBack and NodeSpecific callBack are matched, will only visit nodeSpecifCallback
9909
10083
  */
9910
10084
  visitNodeSpecific(startObject, nodeCallBacks, nodeSpecificCallBacks) {
9911
10085
  const visitWrapper = (curObject) => {
@@ -9936,10 +10110,16 @@ var TransformerSubType = class extends TransformerType {
9936
10110
  ogPreVisit = nodeCallBacks[casted.type]?.preVisitor;
9937
10111
  }
9938
10112
  }
9939
- return ogPreVisit ? ogPreVisit(casted) : curObject;
10113
+ return ogPreVisit ? ogPreVisit(casted) : {};
9940
10114
  };
9941
10115
  this.visitObject(startObject, visitWrapper, preVisitWrapper);
9942
10116
  }
10117
+ /**
10118
+ * Similar to {@link this.traverseNodes} but also allows you to match based on the subtype of objects.
10119
+ * @param currentNode
10120
+ * @param traverseNode
10121
+ * @param traverseSubNode
10122
+ */
9943
10123
  traverseSubNodes(currentNode, traverseNode, traverseSubNode) {
9944
10124
  let didShortCut = false;
9945
10125
  const recurse = (curNode) => {
@@ -11012,8 +11192,8 @@ function PatternFactoryMixin(Base) {
11012
11192
  isPatternOptional(obj) {
11013
11193
  return this.isOfSubType(obj, nodeType5, "optional");
11014
11194
  }
11015
- patternValues(values3, loc) {
11016
- return { type: nodeType5, subType: "values", values: values3, loc };
11195
+ patternValues(variables, values3, loc) {
11196
+ return { type: nodeType5, subType: "values", variables, values: values3, loc };
11017
11197
  }
11018
11198
  isPatternValues(obj) {
11019
11199
  return this.isOfSubType(obj, nodeType5, "values");
@@ -11188,7 +11368,7 @@ function TermFactoryMixin(Base) {
11188
11368
  isTerm(x) {
11189
11369
  return this.isOfType(x, "term");
11190
11370
  }
11191
- blankNode(label, loc) {
11371
+ termBlank(label, loc) {
11192
11372
  const base = {
11193
11373
  type: "term",
11194
11374
  subType: "blankNode",
@@ -11202,7 +11382,7 @@ function TermFactoryMixin(Base) {
11202
11382
  isTermBlank(obj) {
11203
11383
  return this.isOfSubType(obj, nodeType8, "blankNode");
11204
11384
  }
11205
- literalTerm(loc, value, langOrIri) {
11385
+ termLiteral(loc, value, langOrIri) {
11206
11386
  return {
11207
11387
  type: nodeType8,
11208
11388
  subType: "literal",
@@ -11224,7 +11404,7 @@ function TermFactoryMixin(Base) {
11224
11404
  const casted = obj;
11225
11405
  return this.isTermLiteral(obj) && typeof casted.langOrIri === "object" && casted.langOrIri !== null && this.isTermNamed(casted.langOrIri);
11226
11406
  }
11227
- variable(value, loc) {
11407
+ termVariable(value, loc) {
11228
11408
  return {
11229
11409
  type: nodeType8,
11230
11410
  subType: "variable",
@@ -11235,7 +11415,7 @@ function TermFactoryMixin(Base) {
11235
11415
  isTermVariable(obj) {
11236
11416
  return this.isOfSubType(obj, nodeType8, "variable");
11237
11417
  }
11238
- namedNode(loc, value, prefix) {
11418
+ termNamed(loc, value, prefix) {
11239
11419
  const base = {
11240
11420
  type: nodeType8,
11241
11421
  subType: "namedNode",
@@ -11498,7 +11678,7 @@ var CommonIRIs;
11498
11678
  CommonIRIs2["NIL"] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil";
11499
11679
  CommonIRIs2["TYPE"] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
11500
11680
  })(CommonIRIs || (CommonIRIs = {}));
11501
- var AstTransformer = class extends TransformerSubType {
11681
+ var AstTransformer = class extends TransformerSubTyped {
11502
11682
  };
11503
11683
 
11504
11684
  // ../../packages/rules-sparql-1-1/lib/validation/validators.js
@@ -11626,8 +11806,7 @@ function findPatternBoundedVars(iter, boundedVars) {
11626
11806
  optional: (op) => ({ next: op.patterns }),
11627
11807
  service: (op) => ({ next: [op.name, ...op.patterns] }),
11628
11808
  bind: (op) => ({ next: [op.variable] }),
11629
- graph: (op) => ({ next: [op.name, ...op.patterns] }),
11630
- minus: (op) => ({ next: op.patterns.slice(0, 1) })
11809
+ graph: (op) => ({ next: [op.name, ...op.patterns] })
11631
11810
  },
11632
11811
  term: {
11633
11812
  variable: (op) => {
@@ -11714,17 +11893,20 @@ var rdfLiteral = {
11714
11893
  return OPTION(() => OR([
11715
11894
  { ALT: () => {
11716
11895
  const lang2 = CONSUME(terminals_exports.langTag);
11717
- return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(value, lang2), value.value, lang2.image.slice(1).toLowerCase()));
11896
+ return ACTION(() => C.astFactory.termLiteral(C.astFactory.sourceLocation(value, lang2), value.value, lang2.image.slice(1).toLowerCase()));
11718
11897
  } },
11719
11898
  { ALT: () => {
11720
11899
  CONSUME(symbols_exports.hathat);
11721
11900
  const iriVal = SUBRULE1(iri2);
11722
- return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(value, iriVal), value.value, iriVal));
11901
+ return ACTION(() => C.astFactory.termLiteral(C.astFactory.sourceLocation(value, iriVal), value.value, iriVal));
11723
11902
  } }
11724
11903
  ])) ?? value;
11725
11904
  },
11726
- gImpl: ({ SUBRULE, PRINT, PRINT_SPACE_LEFT }) => (ast, { astFactory }) => {
11727
- astFactory.printFilter(ast, () => PRINT_SPACE_LEFT(stringEscapedLexical(ast.value)));
11905
+ gImpl: ({ SUBRULE, PRINT, PRINT_WORD }) => (ast, { astFactory }) => {
11906
+ astFactory.printFilter(ast, () => {
11907
+ PRINT_WORD("");
11908
+ PRINT(stringEscapedLexical(ast.value));
11909
+ });
11728
11910
  if (ast.langOrIri) {
11729
11911
  if (typeof ast.langOrIri === "string") {
11730
11912
  astFactory.printFilter(ast, () => PRINT("@", ast.langOrIri));
@@ -11751,7 +11933,7 @@ var numericLiteralUnsigned = {
11751
11933
  { ALT: () => [CONSUME(terminals_exports.decimal), CommonIRIs.DECIMAL] },
11752
11934
  { ALT: () => [CONSUME(terminals_exports.double), CommonIRIs.DOUBLE] }
11753
11935
  ]);
11754
- return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(parsed[0]), parsed[0].image, C.astFactory.namedNode(C.astFactory.sourceLocationNoMaterialize(), parsed[1])));
11936
+ return ACTION(() => C.astFactory.termLiteral(C.astFactory.sourceLocation(parsed[0]), parsed[0].image, C.astFactory.termNamed(C.astFactory.sourceLocationNoMaterialize(), parsed[1])));
11755
11937
  }
11756
11938
  };
11757
11939
  var numericLiteralPositive = {
@@ -11762,7 +11944,7 @@ var numericLiteralPositive = {
11762
11944
  { ALT: () => [CONSUME(terminals_exports.decimalPositive), CommonIRIs.DECIMAL] },
11763
11945
  { ALT: () => [CONSUME(terminals_exports.doublePositive), CommonIRIs.DOUBLE] }
11764
11946
  ]);
11765
- return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(parsed[0]), parsed[0].image, C.astFactory.namedNode(C.astFactory.sourceLocationNoMaterialize(), parsed[1])));
11947
+ return ACTION(() => C.astFactory.termLiteral(C.astFactory.sourceLocation(parsed[0]), parsed[0].image, C.astFactory.termNamed(C.astFactory.sourceLocationNoMaterialize(), parsed[1])));
11766
11948
  }
11767
11949
  };
11768
11950
  var numericLiteralNegative = {
@@ -11773,7 +11955,7 @@ var numericLiteralNegative = {
11773
11955
  { ALT: () => [CONSUME(terminals_exports.decimalNegative), CommonIRIs.DECIMAL] },
11774
11956
  { ALT: () => [CONSUME(terminals_exports.doubleNegative), CommonIRIs.DOUBLE] }
11775
11957
  ]);
11776
- return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(parsed[0]), parsed[0].image, C.astFactory.namedNode(C.astFactory.sourceLocationNoMaterialize(), parsed[1])));
11958
+ return ACTION(() => C.astFactory.termLiteral(C.astFactory.sourceLocation(parsed[0]), parsed[0].image, C.astFactory.termNamed(C.astFactory.sourceLocationNoMaterialize(), parsed[1])));
11777
11959
  }
11778
11960
  };
11779
11961
  var booleanLiteral = {
@@ -11783,7 +11965,7 @@ var booleanLiteral = {
11783
11965
  { ALT: () => CONSUME(true_) },
11784
11966
  { ALT: () => CONSUME(false_) }
11785
11967
  ]);
11786
- return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(token), token.image.toLowerCase(), C.astFactory.namedNode(C.astFactory.sourceLocationNoMaterialize(), CommonIRIs.BOOLEAN)));
11968
+ return ACTION(() => C.astFactory.termLiteral(C.astFactory.sourceLocation(token), token.image.toLowerCase(), C.astFactory.termNamed(C.astFactory.sourceLocationNoMaterialize(), CommonIRIs.BOOLEAN)));
11787
11969
  }
11788
11970
  };
11789
11971
  var string = {
@@ -11825,7 +12007,7 @@ var string = {
11825
12007
  return char;
11826
12008
  }
11827
12009
  });
11828
- return F2.literalTerm(F2.sourceLocation(x[0]), value);
12010
+ return F2.termLiteral(F2.sourceLocation(x[0]), value);
11829
12011
  });
11830
12012
  }
11831
12013
  };
@@ -11841,7 +12023,7 @@ var iriFull = {
11841
12023
  name: "iriFull",
11842
12024
  impl: ({ ACTION, CONSUME }) => (C) => {
11843
12025
  const iriToken = CONSUME(terminals_exports.iriRef);
11844
- return ACTION(() => C.astFactory.namedNode(C.astFactory.sourceLocation(iriToken), iriToken.image.slice(1, -1)));
12026
+ return ACTION(() => C.astFactory.termNamed(C.astFactory.sourceLocation(iriToken), iriToken.image.slice(1, -1)));
11845
12027
  },
11846
12028
  gImpl: ({ PRINT }) => (ast, { astFactory: F2 }) => {
11847
12029
  F2.printFilter(ast, () => PRINT("<", ast.value, ">"));
@@ -11854,16 +12036,16 @@ var prefixedName = {
11854
12036
  const longName = CONSUME(terminals_exports.pNameLn);
11855
12037
  return ACTION(() => {
11856
12038
  const [prefix, localName] = longName.image.split(":");
11857
- return C.astFactory.namedNode(C.astFactory.sourceLocation(longName), localName, prefix);
12039
+ return C.astFactory.termNamed(C.astFactory.sourceLocation(longName), localName, prefix);
11858
12040
  });
11859
12041
  } },
11860
12042
  { ALT: () => {
11861
12043
  const shortName = CONSUME(terminals_exports.pNameNs);
11862
- return ACTION(() => C.astFactory.namedNode(C.astFactory.sourceLocation(shortName), "", shortName.image.slice(0, -1)));
12044
+ return ACTION(() => C.astFactory.termNamed(C.astFactory.sourceLocation(shortName), "", shortName.image.slice(0, -1)));
11863
12045
  } }
11864
12046
  ]),
11865
- gImpl: ({ PRINT_WORD }) => (ast, { astFactory: F2 }) => {
11866
- F2.printFilter(ast, () => PRINT_WORD(ast.prefix, ":", ast.value));
12047
+ gImpl: ({ PRINT }) => (ast, { astFactory: F2 }) => {
12048
+ F2.printFilter(ast, () => PRINT(ast.prefix, ":", ast.value));
11867
12049
  }
11868
12050
  };
11869
12051
  var canCreateBlankNodes = Symbol("canCreateBlankNodes");
@@ -11873,11 +12055,11 @@ var blankNode = {
11873
12055
  const result = OR([
11874
12056
  { ALT: () => {
11875
12057
  const labelToken = CONSUME(terminals_exports.blankNodeLabel);
11876
- return ACTION(() => C.astFactory.blankNode(labelToken.image.slice(2), C.astFactory.sourceLocation(labelToken)));
12058
+ return ACTION(() => C.astFactory.termBlank(labelToken.image.slice(2), C.astFactory.sourceLocation(labelToken)));
11877
12059
  } },
11878
12060
  { ALT: () => {
11879
12061
  const anonToken = CONSUME(terminals_exports.anon);
11880
- return ACTION(() => C.astFactory.blankNode(void 0, C.astFactory.sourceLocation(anonToken)));
12062
+ return ACTION(() => C.astFactory.termBlank(void 0, C.astFactory.sourceLocation(anonToken)));
11881
12063
  } }
11882
12064
  ]);
11883
12065
  ACTION(() => {
@@ -11887,15 +12069,15 @@ var blankNode = {
11887
12069
  });
11888
12070
  return result;
11889
12071
  },
11890
- gImpl: ({ PRINT_WORD }) => (ast, { astFactory }) => {
11891
- astFactory.printFilter(ast, () => PRINT_WORD("_:", ast.label.replace(/^e_/u, "")));
12072
+ gImpl: ({ PRINT }) => (ast, { astFactory }) => {
12073
+ astFactory.printFilter(ast, () => PRINT("_:", ast.label.replace(/^e_/u, "")));
11892
12074
  }
11893
12075
  };
11894
12076
  var verbA = {
11895
12077
  name: "VerbA",
11896
12078
  impl: ({ ACTION, CONSUME }) => (C) => {
11897
12079
  const token = CONSUME(a);
11898
- return ACTION(() => C.astFactory.namedNode(C.astFactory.sourceLocation(token), CommonIRIs.TYPE, void 0));
12080
+ return ACTION(() => C.astFactory.termNamed(C.astFactory.sourceLocation(token), CommonIRIs.TYPE, void 0));
11899
12081
  }
11900
12082
  };
11901
12083
 
@@ -11929,10 +12111,10 @@ var baseDecl2 = {
11929
12111
  const val = SUBRULE(iriFull);
11930
12112
  return ACTION(() => C.astFactory.contextDefinitionBase(C.astFactory.sourceLocation(base, val), val));
11931
12113
  },
11932
- gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F2 }) => {
11933
- F2.printFilter(ast, () => PRINT_WORD("BASE"));
12114
+ gImpl: ({ SUBRULE, PRINT_ON_EMPTY, NEW_LINE }) => (ast, { astFactory: F2 }) => {
12115
+ F2.printFilter(ast, () => PRINT_ON_EMPTY("BASE "));
11934
12116
  SUBRULE(iri2, ast.value);
11935
- F2.printFilter(ast, () => PRINT_WORD("\n"));
12117
+ F2.printFilter(ast, () => NEW_LINE());
11936
12118
  }
11937
12119
  };
11938
12120
  var prefixDecl2 = {
@@ -11943,12 +12125,12 @@ var prefixDecl2 = {
11943
12125
  const value = SUBRULE(iriFull);
11944
12126
  return ACTION(() => C.astFactory.contextDefinitionPrefix(C.astFactory.sourceLocation(prefix, value), name, value));
11945
12127
  },
11946
- gImpl: ({ SUBRULE, PRINT_WORDS }) => (ast, { astFactory: F2 }) => {
12128
+ gImpl: ({ SUBRULE, PRINT_ON_EMPTY, NEW_LINE }) => (ast, { astFactory: F2 }) => {
11947
12129
  F2.printFilter(ast, () => {
11948
- PRINT_WORDS("PREFIX", `${ast.key}:`);
12130
+ PRINT_ON_EMPTY("PREFIX ", `${ast.key}: `);
11949
12131
  });
11950
12132
  SUBRULE(iri2, ast.value);
11951
- F2.printFilter(ast, () => PRINT_WORDS("\n"));
12133
+ F2.printFilter(ast, () => NEW_LINE());
11952
12134
  }
11953
12135
  };
11954
12136
  var verb = {
@@ -11985,10 +12167,10 @@ var var_ = {
11985
12167
  { ALT: () => CONSUME(terminals_exports.var1) },
11986
12168
  { ALT: () => CONSUME(terminals_exports.var2) }
11987
12169
  ]);
11988
- return ACTION(() => C.astFactory.variable(varToken.image.slice(1), C.astFactory.sourceLocation(varToken)));
12170
+ return ACTION(() => C.astFactory.termVariable(varToken.image.slice(1), C.astFactory.sourceLocation(varToken)));
11989
12171
  },
11990
- gImpl: ({ PRINT_WORD }) => (ast, { astFactory: F2 }) => {
11991
- F2.printFilter(ast, () => PRINT_WORD(`?${ast.value}`));
12172
+ gImpl: ({ PRINT }) => (ast, { astFactory: F2 }) => {
12173
+ F2.printFilter(ast, () => PRINT(`?${ast.value}`));
11992
12174
  }
11993
12175
  };
11994
12176
  var graphTerm = {
@@ -12001,7 +12183,7 @@ var graphTerm = {
12001
12183
  { GATE: () => C.parseMode.has("canCreateBlankNodes"), ALT: () => SUBRULE(blankNode) },
12002
12184
  { ALT: () => {
12003
12185
  const tokenNil = CONSUME(terminals_exports.nil);
12004
- return ACTION(() => C.astFactory.namedNode(C.astFactory.sourceLocation(tokenNil), CommonIRIs.NIL));
12186
+ return ACTION(() => C.astFactory.termNamed(C.astFactory.sourceLocation(tokenNil), CommonIRIs.NIL));
12005
12187
  } }
12006
12188
  ]),
12007
12189
  gImpl: ({ SUBRULE }) => (ast, { astFactory: F2 }) => {
@@ -12631,13 +12813,16 @@ function triplesDotSeperated(triplesSameSubjectSubrule) {
12631
12813
  var triplesBlock = {
12632
12814
  name: "triplesBlock",
12633
12815
  impl: (implArgs) => (C) => triplesDotSeperated(triplesSameSubjectPath)(implArgs)(C),
12634
- gImpl: ({ SUBRULE, PRINT_WORD, HANDLE_LOC }) => (ast, { astFactory: F2 }) => {
12816
+ gImpl: ({ SUBRULE, PRINT_WORD, HANDLE_LOC, NEW_LINE }) => (ast, { astFactory: F2 }) => {
12635
12817
  for (const [index, triple] of ast.triples.entries()) {
12636
12818
  HANDLE_LOC(triple, () => {
12637
12819
  const nextTriple = ast.triples.at(index);
12638
12820
  if (F2.isTripleCollection(triple)) {
12639
12821
  SUBRULE(graphNodePath, triple);
12640
- F2.printFilter(triple, () => PRINT_WORD(".\n"));
12822
+ F2.printFilter(triple, () => {
12823
+ PRINT_WORD(".");
12824
+ NEW_LINE();
12825
+ });
12641
12826
  } else {
12642
12827
  SUBRULE(graphNodePath, triple.subject);
12643
12828
  F2.printFilter(triple, () => PRINT_WORD(""));
@@ -12649,11 +12834,17 @@ var triplesBlock = {
12649
12834
  F2.printFilter(triple, () => PRINT_WORD(""));
12650
12835
  SUBRULE(graphNodePath, triple.object);
12651
12836
  if (nextTriple === void 0 || F2.isTripleCollection(nextTriple) || !F2.isSourceLocationNoMaterialize(nextTriple.subject.loc)) {
12652
- F2.printFilter(ast, () => PRINT_WORD(".\n"));
12837
+ F2.printFilter(ast, () => {
12838
+ PRINT_WORD(".");
12839
+ NEW_LINE();
12840
+ });
12653
12841
  } else if (F2.isSourceLocationNoMaterialize(nextTriple.predicate.loc)) {
12654
12842
  F2.printFilter(ast, () => PRINT_WORD(","));
12655
12843
  } else {
12656
- F2.printFilter(ast, () => PRINT_WORD(";\n"));
12844
+ F2.printFilter(ast, () => {
12845
+ PRINT_WORD(";");
12846
+ NEW_LINE();
12847
+ });
12657
12848
  }
12658
12849
  }
12659
12850
  });
@@ -12786,10 +12977,10 @@ function collectionImpl(name, allowPaths) {
12786
12977
  return ACTION(() => {
12787
12978
  const F2 = C.astFactory;
12788
12979
  const triples = [];
12789
- const predFirst = F2.namedNode(F2.sourceLocationNoMaterialize(), CommonIRIs.FIRST, void 0);
12790
- const predRest = F2.namedNode(F2.sourceLocationNoMaterialize(), CommonIRIs.REST, void 0);
12791
- const predNil = F2.namedNode(F2.sourceLocationNoMaterialize(), CommonIRIs.NIL, void 0);
12792
- const listHead = F2.blankNode(void 0, F2.sourceLocationNoMaterialize());
12980
+ const predFirst = F2.termNamed(F2.sourceLocationNoMaterialize(), CommonIRIs.FIRST, void 0);
12981
+ const predRest = F2.termNamed(F2.sourceLocationNoMaterialize(), CommonIRIs.REST, void 0);
12982
+ const predNil = F2.termNamed(F2.sourceLocationNoMaterialize(), CommonIRIs.NIL, void 0);
12983
+ const listHead = F2.termBlank(void 0, F2.sourceLocationNoMaterialize());
12793
12984
  let iterHead = listHead;
12794
12985
  for (const [index, term] of terms.entries()) {
12795
12986
  const lastInList = index === terms.length - 1;
@@ -12799,7 +12990,7 @@ function collectionImpl(name, allowPaths) {
12799
12990
  const nilTriple = F2.triple(iterHead, predRest, predNil);
12800
12991
  triples.push(nilTriple);
12801
12992
  } else {
12802
- const tail = F2.blankNode(void 0, F2.sourceLocationNoMaterialize());
12993
+ const tail = F2.termBlank(void 0, F2.sourceLocationNoMaterialize());
12803
12994
  const linkTriple = F2.triple(iterHead, predRest, tail);
12804
12995
  triples.push(linkTriple);
12805
12996
  iterHead = tail;
@@ -12839,16 +13030,17 @@ function blankNodePropertyListImpl(name, allowPaths) {
12839
13030
  name,
12840
13031
  impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
12841
13032
  const startToken = CONSUME(symbols_exports.LSquare);
12842
- const blankNode2 = ACTION(() => C.astFactory.blankNode(void 0, C.astFactory.sourceLocationNoMaterialize()));
13033
+ const blankNode2 = ACTION(() => C.astFactory.termBlank(void 0, C.astFactory.sourceLocationNoMaterialize()));
12843
13034
  const propList = SUBRULE(propertyPathNotEmptyImpl, blankNode2);
12844
13035
  const endToken = CONSUME(symbols_exports.RSquare);
12845
13036
  return ACTION(() => C.astFactory.tripleCollectionBlankNodeProperties(blankNode2, propList, C.astFactory.sourceLocation(startToken, endToken)));
12846
13037
  },
12847
- gImpl: ({ SUBRULE, PRINT, PRINT_WORD, HANDLE_LOC, PRINT_ON_EMPTY }) => (ast, c) => {
13038
+ gImpl: ({ SUBRULE, PRINT, PRINT_WORD, HANDLE_LOC, PRINT_ON_EMPTY, NEW_LINE }) => (ast, c) => {
12848
13039
  const { astFactory: F2, indentInc } = c;
12849
13040
  F2.printFilter(ast, () => {
12850
13041
  c[traqulaIndentation] += indentInc;
12851
- PRINT("[\n");
13042
+ PRINT("[");
13043
+ NEW_LINE();
12852
13044
  });
12853
13045
  for (const triple of ast.triples) {
12854
13046
  HANDLE_LOC(triple, () => {
@@ -12859,7 +13051,10 @@ function blankNodePropertyListImpl(name, allowPaths) {
12859
13051
  }
12860
13052
  F2.printFilter(triple, () => PRINT_WORD(""));
12861
13053
  SUBRULE(graphNodePath, triple.object);
12862
- F2.printFilter(ast, () => PRINT_WORD(";\n"));
13054
+ F2.printFilter(ast, () => {
13055
+ PRINT_WORD(";");
13056
+ NEW_LINE();
13057
+ });
12863
13058
  });
12864
13059
  }
12865
13060
  F2.printFilter(ast, () => {
@@ -12918,18 +13113,19 @@ var groupGraphPattern = {
12918
13113
  const close = CONSUME(symbols_exports.RCurly);
12919
13114
  return ACTION(() => C.astFactory.patternGroup(patterns, C.astFactory.sourceLocation(open, close)));
12920
13115
  },
12921
- gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, C) => {
13116
+ gImpl: ({ SUBRULE, PRINT_WORD, NEW_LINE, PRINT_ON_OWN_LINE }) => (ast, C) => {
12922
13117
  const { astFactory: F2, indentInc } = C;
12923
13118
  F2.printFilter(ast, () => {
12924
13119
  C[traqulaIndentation] += indentInc;
12925
- PRINT_WORD("{\n");
13120
+ PRINT_WORD("{");
13121
+ NEW_LINE();
12926
13122
  });
12927
13123
  for (const pattern of ast.patterns) {
12928
13124
  SUBRULE(generatePattern, pattern);
12929
13125
  }
12930
13126
  F2.printFilter(ast, () => {
12931
13127
  C[traqulaIndentation] -= indentInc;
12932
- PRINT_ON_EMPTY("}\n");
13128
+ PRINT_ON_OWN_LINE("}");
12933
13129
  });
12934
13130
  }
12935
13131
  };
@@ -13079,12 +13275,15 @@ var bind2 = {
13079
13275
  const close = CONSUME(symbols_exports.RParen);
13080
13276
  return ACTION(() => C.astFactory.patternBind(expressionVal, variable, C.astFactory.sourceLocation(bind3, close)));
13081
13277
  },
13082
- gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F2 }) => {
13278
+ gImpl: ({ SUBRULE, PRINT_WORD, NEW_LINE }) => (ast, { astFactory: F2 }) => {
13083
13279
  F2.printFilter(ast, () => PRINT_WORD("BIND", "("));
13084
13280
  SUBRULE(expression, ast.expression);
13085
13281
  F2.printFilter(ast, () => PRINT_WORD("AS"));
13086
13282
  SUBRULE(var_, ast.variable);
13087
- F2.printFilter(ast, () => PRINT_WORD(")\n"));
13283
+ F2.printFilter(ast, () => {
13284
+ PRINT_WORD(")");
13285
+ NEW_LINE();
13286
+ });
13088
13287
  }
13089
13288
  };
13090
13289
  var inlineData = {
@@ -13092,34 +13291,46 @@ var inlineData = {
13092
13291
  impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
13093
13292
  const values3 = CONSUME(values2);
13094
13293
  const datablock = SUBRULE(dataBlock);
13095
- return ACTION(() => C.astFactory.patternValues(datablock.val, C.astFactory.sourceLocation(values3, datablock)));
13294
+ return ACTION(() => {
13295
+ datablock.loc = C.astFactory.sourceLocation(values3, datablock);
13296
+ return datablock;
13297
+ });
13096
13298
  },
13097
- gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, C) => {
13299
+ gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY, NEW_LINE, PRINT_ON_OWN_LINE }) => (ast, C) => {
13098
13300
  const { astFactory: F2, indentInc } = C;
13099
- const variables = Object.keys(ast.values.at(0) ?? {});
13301
+ const variables = ast.variables;
13302
+ const singleVar = variables.length === 1;
13303
+ F2.printFilter(ast, () => {
13304
+ PRINT_ON_EMPTY("VALUES", singleVar ? "" : "( ");
13305
+ });
13306
+ for (const variable of variables) {
13307
+ F2.printFilter(ast, () => PRINT_WORD(""));
13308
+ SUBRULE(varOrTerm, variable);
13309
+ F2.printFilter(ast, () => PRINT_WORD(""));
13310
+ }
13100
13311
  F2.printFilter(ast, () => {
13101
- PRINT_ON_EMPTY("");
13102
- PRINT_WORD("VALUES", "(");
13103
- for (const variable of variables) {
13104
- PRINT_WORD(`?${variable}`);
13105
- }
13106
13312
  C[traqulaIndentation] += indentInc;
13107
- PRINT_WORD(")", "{\n");
13313
+ PRINT_WORD(singleVar ? "" : ")", "{");
13314
+ NEW_LINE();
13108
13315
  });
13109
13316
  for (const mapping of ast.values) {
13110
- F2.printFilter(ast, () => PRINT_WORD("("));
13317
+ F2.printFilter(ast, () => !singleVar && PRINT_WORD("("));
13111
13318
  for (const variable of variables) {
13112
- if (mapping[variable] === void 0) {
13319
+ const var_2 = variable.value;
13320
+ if (mapping[var_2] === void 0) {
13113
13321
  F2.printFilter(ast, () => PRINT_WORD("UNDEF"));
13114
13322
  } else {
13115
- SUBRULE(graphNodePath, mapping[variable]);
13323
+ SUBRULE(graphNodePath, mapping[var_2]);
13116
13324
  }
13117
13325
  }
13118
- F2.printFilter(ast, () => PRINT_WORD(")\n"));
13326
+ F2.printFilter(ast, () => {
13327
+ PRINT_WORD(singleVar ? "" : ")");
13328
+ NEW_LINE();
13329
+ });
13119
13330
  }
13120
13331
  F2.printFilter(ast, () => {
13121
13332
  C[traqulaIndentation] -= indentInc;
13122
- PRINT_ON_EMPTY("}\n");
13333
+ PRINT_ON_OWN_LINE("}");
13123
13334
  });
13124
13335
  }
13125
13336
  };
@@ -13143,7 +13354,7 @@ var inlineDataOneVar = {
13143
13354
  });
13144
13355
  });
13145
13356
  const close = CONSUME(symbols_exports.RCurly);
13146
- return ACTION(() => C.astFactory.wrap(res, C.astFactory.sourceLocation(varVal, close)));
13357
+ return ACTION(() => C.astFactory.patternValues([varVal], res, C.astFactory.sourceLocation(varVal, close)));
13147
13358
  }
13148
13359
  };
13149
13360
  var inlineDataFull = {
@@ -13160,7 +13371,7 @@ var inlineDataFull = {
13160
13371
  res.push({});
13161
13372
  });
13162
13373
  const close = CONSUME1(symbols_exports.RCurly);
13163
- return ACTION(() => C.astFactory.wrap(res, C.astFactory.sourceLocation(nil2, close)));
13374
+ return ACTION(() => C.astFactory.patternValues(vars, res, C.astFactory.sourceLocation(nil2, close)));
13164
13375
  } },
13165
13376
  { ALT: () => {
13166
13377
  const open = CONSUME1(symbols_exports.LParen);
@@ -13192,7 +13403,7 @@ var inlineDataFull = {
13192
13403
  });
13193
13404
  });
13194
13405
  const close = CONSUME2(symbols_exports.RCurly);
13195
- return ACTION(() => C.astFactory.wrap(res, C.astFactory.sourceLocation(open, close)));
13406
+ return ACTION(() => C.astFactory.patternValues(vars, res, C.astFactory.sourceLocation(open, close)));
13196
13407
  } }
13197
13408
  ]);
13198
13409
  }
@@ -13255,10 +13466,13 @@ var filter3 = {
13255
13466
  const expression2 = SUBRULE(constraint);
13256
13467
  return ACTION(() => C.astFactory.patternFilter(expression2, C.astFactory.sourceLocation(filterToken, expression2)));
13257
13468
  },
13258
- gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F2 }) => {
13469
+ gImpl: ({ SUBRULE, PRINT_WORD, NEW_LINE }) => (ast, { astFactory: F2 }) => {
13259
13470
  F2.printFilter(ast, () => PRINT_WORD("FILTER ("));
13260
13471
  SUBRULE(expression, ast.expression);
13261
- F2.printFilter(ast, () => PRINT_WORD(")\n"));
13472
+ F2.printFilter(ast, () => {
13473
+ PRINT_WORD(")");
13474
+ NEW_LINE();
13475
+ });
13262
13476
  }
13263
13477
  };
13264
13478
  var constraint = {
@@ -13644,8 +13858,7 @@ var groupClause = {
13644
13858
  },
13645
13859
  gImpl: ({ PRINT_WORDS, SUBRULE, PRINT_ON_EMPTY }) => (ast, { astFactory: F2 }) => {
13646
13860
  F2.printFilter(ast, () => {
13647
- PRINT_ON_EMPTY("");
13648
- PRINT_WORDS("GROUP", "BY");
13861
+ PRINT_ON_EMPTY("GROUP BY ");
13649
13862
  });
13650
13863
  for (const grouping of ast.groupings) {
13651
13864
  if (F2.isExpression(grouping)) {
@@ -13701,10 +13914,9 @@ var havingClause = {
13701
13914
  ACTION(() => !couldParseAgg && C.parseMode.delete("canParseAggregate"));
13702
13915
  return ACTION(() => C.astFactory.solutionModifierHaving(expressions, C.astFactory.sourceLocation(having2, expressions.at(-1))));
13703
13916
  },
13704
- gImpl: ({ PRINT_WORD, PRINT_ON_EMPTY, SUBRULE }) => (ast, { astFactory: F2 }) => {
13917
+ gImpl: ({ PRINT_ON_EMPTY, SUBRULE }) => (ast, { astFactory: F2 }) => {
13705
13918
  F2.printFilter(ast, () => {
13706
- PRINT_ON_EMPTY("");
13707
- PRINT_WORD("HAVING");
13919
+ PRINT_ON_EMPTY("HAVING ");
13708
13920
  });
13709
13921
  for (const having2 of ast.having) {
13710
13922
  SUBRULE(expression, having2);
@@ -13730,8 +13942,7 @@ var orderClause = {
13730
13942
  },
13731
13943
  gImpl: ({ PRINT_WORDS, PRINT_ON_EMPTY, SUBRULE }) => (ast, { astFactory: F2 }) => {
13732
13944
  F2.printFilter(ast, () => {
13733
- PRINT_ON_EMPTY("");
13734
- PRINT_WORDS("ORDER", "BY");
13945
+ PRINT_ON_EMPTY("ORDER BY ");
13735
13946
  });
13736
13947
  for (const ordering of ast.orderDefs) {
13737
13948
  if (ordering.descending) {
@@ -13790,9 +14001,9 @@ var limitOffsetClauses = {
13790
14001
  return ACTION(() => C.astFactory.solutionModifierLimitOffset(limit2?.val, offset2.val, C.astFactory.sourceLocation(offset2, limit2)));
13791
14002
  } }
13792
14003
  ]),
13793
- gImpl: ({ PRINT_WORDS, PRINT_ON_EMPTY }) => (ast, { astFactory: F2 }) => {
14004
+ gImpl: ({ PRINT_WORDS, NEW_LINE }) => (ast, { astFactory: F2 }) => {
13794
14005
  F2.printFilter(ast, () => {
13795
- PRINT_ON_EMPTY("");
14006
+ NEW_LINE();
13796
14007
  if (ast.limit) {
13797
14008
  PRINT_WORDS("LIMIT", String(ast.limit));
13798
14009
  }
@@ -13977,9 +14188,9 @@ var selectClause = {
13977
14188
  ACTION(() => !couldParseAgg && C.parseMode.delete("canParseAggregate"));
13978
14189
  return ACTION(() => C.astFactory.wrap(val, C.astFactory.sourceLocation(select2, last2)));
13979
14190
  },
13980
- gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F2 }) => {
14191
+ gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, { astFactory: F2 }) => {
13981
14192
  F2.printFilter(ast, () => {
13982
- PRINT_WORD("SELECT");
14193
+ PRINT_ON_EMPTY("SELECT ");
13983
14194
  if (ast.val.distinct) {
13984
14195
  PRINT_WORD("DISTINCT");
13985
14196
  } else if (ast.val.reduced) {
@@ -13998,7 +14209,9 @@ var selectClause = {
13998
14209
  SUBRULE(var_, variable.variable);
13999
14210
  F2.printFilter(ast, () => PRINT_WORD(")"));
14000
14211
  }
14212
+ F2.printFilter(ast, () => PRINT_WORD(""));
14001
14213
  }
14214
+ F2.printFilter(ast, () => PRINT_WORD(""));
14002
14215
  }
14003
14216
  };
14004
14217
  var constructQuery = {
@@ -14036,18 +14249,19 @@ var constructQuery = {
14036
14249
  } }
14037
14250
  ]);
14038
14251
  },
14039
- gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, C) => {
14252
+ gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY, PRINT_ON_OWN_LINE, NEW_LINE }) => (ast, C) => {
14040
14253
  const { astFactory: F2, indentInc } = C;
14041
- F2.printFilter(ast, () => PRINT_WORD("CONSTRUCT"));
14254
+ F2.printFilter(ast, () => PRINT_ON_EMPTY("CONSTRUCT "));
14042
14255
  if (!F2.isSourceLocationNoMaterialize(ast.where.loc)) {
14043
14256
  F2.printFilter(ast, () => {
14044
14257
  C[traqulaIndentation] += indentInc;
14045
- PRINT_WORD("{\n");
14258
+ PRINT_WORD("{");
14259
+ NEW_LINE();
14046
14260
  });
14047
14261
  SUBRULE(triplesBlock, ast.template);
14048
14262
  F2.printFilter(ast, () => {
14049
14263
  C[traqulaIndentation] -= indentInc;
14050
- PRINT_ON_EMPTY("}\n");
14264
+ PRINT_ON_OWN_LINE("}");
14051
14265
  });
14052
14266
  }
14053
14267
  SUBRULE(datasetClauseStar, ast.datasets);
@@ -14088,8 +14302,8 @@ var describeQuery = {
14088
14302
  loc: C.astFactory.sourceLocation(describe2, ...variables, from2, where2, modifiers.group, modifiers.having, modifiers.order, modifiers.limitOffset)
14089
14303
  }));
14090
14304
  },
14091
- gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F2 }) => {
14092
- F2.printFilter(ast, () => PRINT_WORD("DESCRIBE"));
14305
+ gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, { astFactory: F2 }) => {
14306
+ F2.printFilter(ast, () => PRINT_ON_EMPTY("DESCRIBE "));
14093
14307
  if (F2.isWildcard(ast.variables[0])) {
14094
14308
  F2.printFilter(ast, () => PRINT_WORD("*"));
14095
14309
  } else {
@@ -14119,8 +14333,8 @@ var askQuery = {
14119
14333
  loc: C.astFactory.sourceLocation(ask2, from2, where2, modifiers.group, modifiers.having, modifiers.order, modifiers.limitOffset)
14120
14334
  }));
14121
14335
  },
14122
- gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F2 }) => {
14123
- F2.printFilter(ast, () => PRINT_WORD("ASK"));
14336
+ gImpl: ({ SUBRULE, PRINT_ON_EMPTY }) => (ast, { astFactory: F2 }) => {
14337
+ F2.printFilter(ast, () => PRINT_ON_EMPTY("ASK "));
14124
14338
  SUBRULE(datasetClauseStar, ast.datasets);
14125
14339
  SUBRULE(whereClause, F2.wrap(ast.where, ast.loc));
14126
14340
  SUBRULE(solutionModifier, ast.solutionModifiers);
@@ -14179,7 +14393,7 @@ var update = {
14179
14393
  return update2;
14180
14394
  });
14181
14395
  },
14182
- gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F2 }) => {
14396
+ gImpl: ({ SUBRULE, PRINT, NEW_LINE }) => (ast, { astFactory: F2 }) => {
14183
14397
  const [head2, ...tail] = ast.updates;
14184
14398
  if (head2) {
14185
14399
  SUBRULE(prologue, head2.context);
@@ -14188,7 +14402,10 @@ var update = {
14188
14402
  }
14189
14403
  }
14190
14404
  for (const update2 of tail) {
14191
- F2.printFilter(ast, () => PRINT_WORD(";\n"));
14405
+ F2.printFilter(ast, () => {
14406
+ PRINT(";");
14407
+ NEW_LINE();
14408
+ });
14192
14409
  SUBRULE(prologue, update2.context);
14193
14410
  if (update2.operation) {
14194
14411
  SUBRULE(update1, update2.operation);
@@ -14261,9 +14478,9 @@ var load2 = {
14261
14478
  });
14262
14479
  return ACTION(() => C.astFactory.updateOperationLoad(C.astFactory.sourceLocation(loadToken, source, destination), source, Boolean(silent2), destination));
14263
14480
  },
14264
- gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F2 }) => {
14481
+ gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, { astFactory: F2 }) => {
14265
14482
  F2.printFilter(ast, () => {
14266
- PRINT_WORD("LOAD");
14483
+ PRINT_ON_EMPTY("LOAD ");
14267
14484
  if (ast.silent) {
14268
14485
  PRINT_WORD("SILENT");
14269
14486
  }
@@ -14284,9 +14501,9 @@ function clearOrDrop(operation) {
14284
14501
  const destination = SUBRULE1(graphRefAll);
14285
14502
  return ACTION(() => C.astFactory.updateOperationClearDrop(unCapitalize(operation.name), Boolean(silent2), destination, C.astFactory.sourceLocation(opToken, destination)));
14286
14503
  },
14287
- gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F2 }) => {
14504
+ gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, { astFactory: F2 }) => {
14288
14505
  F2.printFilter(ast, () => {
14289
- PRINT_WORD(operation.name.toUpperCase());
14506
+ PRINT_ON_EMPTY(operation.name.toUpperCase(), " ");
14290
14507
  if (ast.silent) {
14291
14508
  PRINT_WORD("SILENT");
14292
14509
  }
@@ -14305,9 +14522,9 @@ var create2 = {
14305
14522
  const destination = SUBRULE1(graphRef);
14306
14523
  return ACTION(() => C.astFactory.updateOperationCreate(destination, Boolean(silent2), C.astFactory.sourceLocation(createToken3, destination)));
14307
14524
  },
14308
- gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F2 }) => {
14525
+ gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, { astFactory: F2 }) => {
14309
14526
  F2.printFilter(ast, () => {
14310
- PRINT_WORD("CREATE");
14527
+ PRINT_ON_EMPTY("CREATE ");
14311
14528
  if (ast.silent) {
14312
14529
  PRINT_WORD("SILENT");
14313
14530
  }
@@ -14326,9 +14543,9 @@ function copyMoveAddOperation(operation) {
14326
14543
  const destination = SUBRULE2(graphOrDefault);
14327
14544
  return ACTION(() => C.astFactory.updateOperationAddMoveCopy(unCapitalize(operation.name), source, destination, Boolean(silent2), C.astFactory.sourceLocation(op, destination)));
14328
14545
  },
14329
- gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F2 }) => {
14546
+ gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, { astFactory: F2 }) => {
14330
14547
  F2.printFilter(ast, () => {
14331
- PRINT_WORD(operation.name.toUpperCase());
14548
+ PRINT_ON_EMPTY(operation.name.toUpperCase(), " ");
14332
14549
  if (ast.silent) {
14333
14550
  PRINT_WORD("SILENT");
14334
14551
  }
@@ -14377,23 +14594,24 @@ function insertDeleteDelWhere(name, subType, cons1, dataRule) {
14377
14594
  }
14378
14595
  return ACTION(() => C.astFactory.updateOperationInsDelDataWhere(subType, data.val, C.astFactory.sourceLocation(insDelToken, data)));
14379
14596
  },
14380
- gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, C) => {
14597
+ gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY, PRINT_ON_OWN_LINE, NEW_LINE }) => (ast, C) => {
14381
14598
  const { astFactory: F2, indentInc } = C;
14382
14599
  F2.printFilter(ast, () => {
14383
- C[traqulaIndentation] += indentInc;
14384
14600
  if (subType === "insertdata") {
14385
- PRINT_WORD("INSERT DATA");
14601
+ PRINT_ON_EMPTY("INSERT DATA ");
14386
14602
  } else if (subType === "deletedata") {
14387
- PRINT_WORD("DELETE DATA");
14603
+ PRINT_ON_EMPTY("DELETE DATA ");
14388
14604
  } else if (subType === "deletewhere") {
14389
- PRINT_WORD("DELETE WHERE");
14605
+ PRINT_ON_EMPTY("DELETE WHERE ");
14390
14606
  }
14391
- PRINT_WORD("{\n");
14607
+ C[traqulaIndentation] += indentInc;
14608
+ PRINT_WORD("{");
14609
+ NEW_LINE();
14392
14610
  });
14393
14611
  SUBRULE(quads, F2.wrap(ast.data, ast.loc));
14394
14612
  F2.printFilter(ast, () => {
14395
14613
  C[traqulaIndentation] -= indentInc;
14396
- PRINT_ON_EMPTY("}\n");
14614
+ PRINT_ON_OWN_LINE("}");
14397
14615
  });
14398
14616
  }
14399
14617
  };
@@ -14425,36 +14643,40 @@ var modify = {
14425
14643
  const where2 = SUBRULE1(groupGraphPattern);
14426
14644
  return ACTION(() => C.astFactory.updateOperationModify(C.astFactory.sourceLocation(graph2?.withToken, del, insert, where2), insert?.val ?? [], del?.val ?? [], where2, using, graph2?.graph));
14427
14645
  },
14428
- gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, C) => {
14646
+ gImpl: ({ SUBRULE, PRINT_WORDS, PRINT_ON_EMPTY, NEW_LINE }) => (ast, C) => {
14429
14647
  const { astFactory: F2, indentInc } = C;
14430
14648
  if (ast.graph) {
14431
- F2.printFilter(ast, () => PRINT_WORD("WITH"));
14649
+ F2.printFilter(ast, () => PRINT_WORDS("WITH"));
14432
14650
  SUBRULE(iri2, ast.graph);
14433
14651
  }
14434
14652
  if (ast.delete.length > 0) {
14435
14653
  F2.printFilter(ast, () => {
14436
14654
  C[traqulaIndentation] += indentInc;
14437
- PRINT_WORD("DELETE", "{\n");
14655
+ PRINT_WORDS("DELETE", "{");
14656
+ NEW_LINE();
14438
14657
  });
14439
14658
  SUBRULE(quads, F2.wrap(ast.delete, ast.loc));
14440
14659
  F2.printFilter(ast, () => {
14441
14660
  C[traqulaIndentation] -= indentInc;
14442
- PRINT_ON_EMPTY("}\n");
14661
+ PRINT_ON_EMPTY("}");
14662
+ NEW_LINE();
14443
14663
  });
14444
14664
  }
14445
14665
  if (ast.insert.length > 0) {
14446
14666
  F2.printFilter(ast, () => {
14447
14667
  C[traqulaIndentation] += indentInc;
14448
- PRINT_WORD("INSERT", "{\n");
14668
+ PRINT_WORDS("INSERT", "{");
14669
+ NEW_LINE();
14449
14670
  });
14450
14671
  SUBRULE(quads, F2.wrap(ast.insert, ast.loc));
14451
14672
  F2.printFilter(ast, () => {
14452
14673
  C[traqulaIndentation] -= indentInc;
14453
- PRINT_ON_EMPTY("}\n");
14674
+ PRINT_ON_EMPTY("} ");
14675
+ NEW_LINE();
14454
14676
  });
14455
14677
  }
14456
14678
  SUBRULE(usingClauseStar, ast.from);
14457
- F2.printFilter(ast, () => PRINT_WORD("WHERE"));
14679
+ F2.printFilter(ast, () => PRINT_WORDS("WHERE"));
14458
14680
  SUBRULE(groupGraphPattern, ast.where);
14459
14681
  }
14460
14682
  };
@@ -14578,18 +14800,19 @@ var quadsNotTriples = {
14578
14800
  const close = CONSUME(symbols_exports.RCurly);
14579
14801
  return ACTION(() => C.astFactory.graphQuads(name, triples ?? C.astFactory.patternBgp([], C.astFactory.sourceLocationNoMaterialize()), C.astFactory.sourceLocation(graph2, close)));
14580
14802
  },
14581
- gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, C) => {
14803
+ gImpl: ({ SUBRULE, PRINT_WORD, NEW_LINE, PRINT_ON_OWN_LINE }) => (ast, C) => {
14582
14804
  const { astFactory: F2, indentInc } = C;
14583
14805
  F2.printFilter(ast, () => PRINT_WORD("GRAPH"));
14584
14806
  SUBRULE(varOrTerm, ast.graph);
14585
14807
  F2.printFilter(ast, () => {
14586
14808
  C[traqulaIndentation] += indentInc;
14587
- PRINT_WORD("{\n");
14809
+ PRINT_WORD("{");
14810
+ NEW_LINE();
14588
14811
  });
14589
14812
  SUBRULE(triplesBlock, ast.triples);
14590
14813
  F2.printFilter(ast, () => {
14591
14814
  C[traqulaIndentation] -= indentInc;
14592
- PRINT_ON_EMPTY("}\n");
14815
+ PRINT_ON_OWN_LINE("}");
14593
14816
  });
14594
14817
  }
14595
14818
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@traqula/parser-sparql-1-1-adjust",
3
3
  "type": "module",
4
- "version": "0.0.19",
4
+ "version": "0.0.21",
5
5
  "description": "SPARQL 1.1 + ADJUST parser",
6
6
  "lsd:module": true,
7
7
  "license": "MIT",
@@ -51,16 +51,16 @@
51
51
  "spec:earl": "yarn spec:earl:query && yarn spec:earl:update"
52
52
  },
53
53
  "dependencies": {
54
- "@traqula/core": "^0.0.19",
55
- "@traqula/parser-sparql-1-1": "^0.0.19",
56
- "@traqula/rules-sparql-1-1": "^0.0.19",
57
- "@traqula/rules-sparql-1-1-adjust": "^0.0.19"
54
+ "@traqula/core": "^0.0.21",
55
+ "@traqula/parser-sparql-1-1": "^0.0.21",
56
+ "@traqula/rules-sparql-1-1": "^0.0.21",
57
+ "@traqula/rules-sparql-1-1-adjust": "^0.0.21"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@rdfjs/types": "^2.0.0",
61
- "@traqula/test-utils": "^0.0.19",
61
+ "@traqula/test-utils": "^0.0.21",
62
62
  "rdf-data-factory": "^2.0.1",
63
63
  "rdf-test-suite": "^2.0.0"
64
64
  },
65
- "gitHead": "095b4ba917f7602e6c26acbf763f44e86dd97862"
65
+ "gitHead": "6e27b4bab942e473c11576196320bd52894ea5a4"
66
66
  }