@ldclabs/kip-lang 2.0.2 → 2.2.0

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/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEnC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAEvC,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEjD,OAAO,EACL,SAAS,EACT,QAAQ,EACR,SAAS,EACT,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,SAAS,EACT,QAAQ,EACR,gBAAgB,EACjB,MAAM,YAAY,CAAA;AAuHnB,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AA8E9E,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEnC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAEvC,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEjD,OAAO,EACL,SAAS,EACT,QAAQ,EACR,SAAS,EACT,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,SAAS,EACT,QAAQ,EACR,gBAAgB,EACjB,MAAM,YAAY,CAAA;AAkHnB,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AA6E9E,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"lower.d.ts","sourceRoot":"","sources":["../src/lower.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,SAAS,EAoDV,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EAKV,OAAO,EA4CR,MAAM,eAAe,CAAA;AA6FtB;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAa/C;AAED,6DAA6D;AAC7D,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,CAKpD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAsCvD"}
1
+ {"version":3,"file":"lower.d.ts","sourceRoot":"","sources":["../src/lower.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,SAAS,EAgDV,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EAKV,OAAO,EA+CR,MAAM,eAAe,CAAA;AA6FtB;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAa/C;AAED,6DAA6D;AAC7D,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,CAKpD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAkCvD"}
package/dist/lower.js CHANGED
@@ -122,14 +122,10 @@ export function lowerStatement(stmt) {
122
122
  case 'CreateAssertionStatement':
123
123
  case 'CreateActivityStatement':
124
124
  case 'UpdateStatement':
125
- case 'RetractAssertionStatement':
126
- case 'SupersedeAssertionStatement':
127
- case 'CorrectEvidenceStatement':
128
- case 'TransitionActivityStatement':
125
+ case 'TransitionStatement':
129
126
  case 'SetRetentionStatement':
130
- case 'ArchiveStatement':
131
- case 'TombstoneStatement':
132
127
  case 'PurgeStatement':
128
+ case 'PurgePayloadStatement':
133
129
  case 'MergeConceptStatement':
134
130
  const clauses = lowerMutationClause(stmt, 0);
135
131
  assertUniqueHandles(clauses, stmt.range);
@@ -165,15 +161,46 @@ function lowerFind(stmt) {
165
161
  };
166
162
  }
167
163
  function lowerAsOf(clause) {
168
- const value = lowerScalar(clause.value);
169
- switch (clause.basis) {
170
- case 'SEQ':
171
- return { Seq: value };
172
- case 'TX':
173
- return { Tx: value };
174
- case 'TIME':
175
- return { Time: value };
176
- }
164
+ return { Seq: lowerScalar(clause.value) };
165
+ }
166
+ /**
167
+ * `{ expect_version_clause }` → at most one guard per plane. Two guards on one
168
+ * plane cannot both be meant, so the duplicate is rejected here rather than
169
+ * left for the engine to pick one.
170
+ */
171
+ function lowerExpectVersions(clauses) {
172
+ const seen = new Set();
173
+ return clauses.map((clause) => {
174
+ let plane = null;
175
+ let key = 'element';
176
+ if (clause.plane) {
177
+ switch (clause.plane.kind) {
178
+ case 'ATTRIBUTES':
179
+ plane = 'Attributes';
180
+ key = 'attributes';
181
+ break;
182
+ case 'STRUCTURAL':
183
+ plane = 'Structural';
184
+ key = 'structural';
185
+ break;
186
+ case 'RETENTION':
187
+ plane = 'Retention';
188
+ key = 'retention';
189
+ break;
190
+ case 'FACET': {
191
+ const facet = lowerSymbol(clause.plane.facet);
192
+ plane = { Facet: facet };
193
+ key = 'facet:' + ('Name' in facet ? facet.Name : ':' + facet.Param);
194
+ break;
195
+ }
196
+ }
197
+ }
198
+ if (seen.has(key)) {
199
+ throw invalidSyntax(`duplicate EXPECT VERSION guard on the same ${key === 'element' ? 'element' : 'plane'}`, clause.range);
200
+ }
201
+ seen.add(key);
202
+ return { version: lowerScalar(clause.value), plane };
203
+ });
177
204
  }
178
205
  function lowerFindExpression(expr) {
179
206
  if (expr.kind === 'AggregateExpr') {
@@ -641,45 +668,8 @@ function lowerMutationClause(stmt, seq) {
641
668
  return [{ CreateActivity: lowerRecordCreate(stmt) }];
642
669
  case 'UpdateStatement':
643
670
  return [{ Update: lowerUpdate(stmt) }];
644
- case 'RetractAssertionStatement':
645
- return [
646
- {
647
- RetractAssertion: {
648
- target: lowerElementRef(stmt.target),
649
- where_clauses: stmt.where ? lowerWhere(stmt.where) : null,
650
- limit: stmt.limit ? lowerScalar(stmt.limit.value) : null,
651
- expect_state: stmt.expectState
652
- ? lowerScalar(stmt.expectState.value)
653
- : null
654
- }
655
- }
656
- ];
657
- case 'SupersedeAssertionStatement':
658
- return [
659
- {
660
- SupersedeAssertion: {
661
- target: lowerElementRef(stmt.target),
662
- by: lowerElementRef(stmt.by),
663
- expect_state: stmt.expectState
664
- ? lowerScalar(stmt.expectState.value)
665
- : null
666
- }
667
- }
668
- ];
669
- case 'CorrectEvidenceStatement':
670
- return [
671
- {
672
- CorrectEvidence: {
673
- target: lowerElementRef(stmt.target),
674
- by: lowerElementRef(stmt.by),
675
- expect_state: stmt.expectState
676
- ? lowerScalar(stmt.expectState.value)
677
- : null
678
- }
679
- }
680
- ];
681
- case 'TransitionActivityStatement':
682
- return [{ TransitionActivity: lowerTransition(stmt) }];
671
+ case 'TransitionStatement':
672
+ return [{ Transition: lowerTransition(stmt) }];
683
673
  case 'SetRetentionStatement':
684
674
  return [
685
675
  {
@@ -688,18 +678,14 @@ function lowerMutationClause(stmt, seq) {
688
678
  values: lowerAssignments(stmt.assignments, null),
689
679
  where_clauses: stmt.where ? lowerWhere(stmt.where) : null,
690
680
  limit: stmt.limit ? lowerScalar(stmt.limit.value) : null,
691
- expect_version: stmt.expectVersion
692
- ? lowerScalar(stmt.expectVersion.value)
693
- : null
681
+ expect_versions: lowerExpectVersions(stmt.expectVersions)
694
682
  }
695
683
  }
696
684
  ];
697
- case 'ArchiveStatement':
698
- return [{ Archive: lowerRemoval(stmt) }];
699
- case 'TombstoneStatement':
700
- return [{ Tombstone: lowerRemoval(stmt) }];
701
685
  case 'PurgeStatement':
702
686
  return [{ Purge: lowerPurge(stmt) }];
687
+ case 'PurgePayloadStatement':
688
+ return [{ PurgePayload: lowerPurgePayload(stmt) }];
703
689
  case 'MergeConceptStatement':
704
690
  return [
705
691
  {
@@ -707,9 +693,7 @@ function lowerMutationClause(stmt, seq) {
707
693
  source: lowerElementRef(stmt.source),
708
694
  into: lowerElementRef(stmt.into),
709
695
  where_clauses: stmt.where ? lowerWhere(stmt.where) : null,
710
- expect_version: stmt.expectVersion
711
- ? lowerScalar(stmt.expectVersion.value)
712
- : null
696
+ expect_versions: lowerExpectVersions(stmt.expectVersions)
713
697
  }
714
698
  }
715
699
  ];
@@ -771,9 +755,7 @@ function lowerUpsertConcept(stmt) {
771
755
  return {
772
756
  handle: varName(stmt.handle.name, stmt.handle.range),
773
757
  match,
774
- expect_version: stmt.expectVersion
775
- ? lowerScalar(stmt.expectVersion.value)
776
- : null,
758
+ expect_versions: lowerExpectVersions(stmt.expectVersions),
777
759
  set_fields: stmt.setFields
778
760
  ? lowerAssignments(stmt.setFields.assignments, null)
779
761
  : null,
@@ -801,9 +783,7 @@ function lowerEnsureProposition(stmt) {
801
783
  return {
802
784
  handle: stmt.handle ? varName(stmt.handle.name, stmt.handle.range) : null,
803
785
  ...triple,
804
- expect_version: stmt.expectVersion
805
- ? lowerScalar(stmt.expectVersion.value)
806
- : null
786
+ expect_versions: lowerExpectVersions(stmt.expectVersions)
807
787
  };
808
788
  }
809
789
  function lowerRecordCreate(stmt) {
@@ -822,7 +802,7 @@ function lowerRecordCreate(stmt) {
822
802
  }
823
803
  /**
824
804
  * Desugars `ASSERT` into exactly what the Spec defines it as (§55.1):
825
- * `ENSURE PROPOSITION` + `CREATE ASSERTION`, plus `SUPERSEDE` when written.
805
+ * `ENSURE PROPOSITION` + `CREATE ASSERTION`, plus `TRANSITION ... TO "superseded"` when `SUPERSEDING` is written.
826
806
  *
827
807
  * Nothing else is fabricated. The sugar exists because recording an
828
808
  * attributed claim is the hot path, not because it means anything new.
@@ -876,7 +856,7 @@ function lowerAssertSugar(stmt, seq) {
876
856
  EnsureProposition: {
877
857
  handle: propositionHandle,
878
858
  ...triple,
879
- expect_version: null
859
+ expect_versions: []
880
860
  }
881
861
  }
882
862
  ];
@@ -929,16 +909,40 @@ function lowerAssertSugar(stmt, seq) {
929
909
  });
930
910
  if (stmt.superseding) {
931
911
  clauses.push({
932
- SupersedeAssertion: {
912
+ Transition: {
933
913
  target: lowerElementRef(stmt.superseding),
914
+ to: { Literal: { String: 'superseded' } },
934
915
  by: { Handle: assertionHandle },
935
- expect_state: null
916
+ set_fields: null,
917
+ set_structural: null,
918
+ where_clauses: null,
919
+ limit: null,
920
+ expect_versions: []
936
921
  }
937
922
  });
938
923
  }
939
924
  return clauses;
940
925
  }
926
+ /** Moves that name the replacing element with `BY` (Spec §52.5). */
927
+ const TRANSITION_WITH_BY = new Set(['superseded', 'corrected']);
928
+ /** Activity status moves: the only ones that may finalize fields or topology. */
929
+ const TRANSITION_ACTIVITY_STATES = new Set(['running', 'completed', 'failed', 'cancelled']);
941
930
  function lowerTransition(stmt) {
931
+ // Spec §52.5: BY exactly for superseded / corrected, SET clauses only on
932
+ // Activity states. These are syntax errors, so they belong to the
933
+ // executability contract, not only to the editor diagnostics.
934
+ if (stmt.to.kind === 'StringLiteral') {
935
+ const to = stmt.to.parsed;
936
+ if (TRANSITION_WITH_BY.has(to) && !stmt.by) {
937
+ throw invalidSyntax(`TRANSITION TO "${to}" names the replacing element with BY`, stmt.to.range);
938
+ }
939
+ if (!TRANSITION_WITH_BY.has(to) && stmt.by) {
940
+ throw invalidSyntax(`TRANSITION TO "${to}" takes no BY`, stmt.by.range);
941
+ }
942
+ if (stmt.finalize.length > 0 && !TRANSITION_ACTIVITY_STATES.has(to)) {
943
+ throw invalidSyntax(`TRANSITION TO "${to}" cannot finalize fields or topology; only a pending Activity does`, stmt.finalize[0].range);
944
+ }
945
+ }
942
946
  let setFields = null;
943
947
  let setStructural = null;
944
948
  for (const clause of stmt.finalize) {
@@ -958,17 +962,12 @@ function lowerTransition(stmt) {
958
962
  return {
959
963
  target: lowerElementRef(stmt.target),
960
964
  to: lowerScalar(stmt.to),
965
+ by: stmt.by ? lowerElementRef(stmt.by) : null,
961
966
  set_fields: setFields,
962
967
  set_structural: setStructural,
963
- expect_state: stmt.expectState ? lowerScalar(stmt.expectState.value) : null
964
- };
965
- }
966
- function lowerRemoval(stmt) {
967
- return {
968
- target: lowerElementRef(stmt.target),
969
968
  where_clauses: stmt.where ? lowerWhere(stmt.where) : null,
970
969
  limit: stmt.limit ? lowerScalar(stmt.limit.value) : null,
971
- expect_state: stmt.expectState ? lowerScalar(stmt.expectState.value) : null
970
+ expect_versions: lowerExpectVersions(stmt.expectVersions)
972
971
  };
973
972
  }
974
973
  function lowerPurge(stmt) {
@@ -979,12 +978,25 @@ function lowerPurge(stmt) {
979
978
  target: lowerElementRef(stmt.target),
980
979
  where_clauses: stmt.where ? lowerWhere(stmt.where) : null,
981
980
  limit: stmt.limit ? lowerScalar(stmt.limit.value) : null,
981
+ expect_versions: lowerExpectVersions(stmt.expectVersions),
982
982
  reference_policy: stmt.referencePolicy
983
983
  ? lowerScalar(stmt.referencePolicy)
984
984
  : null,
985
985
  confirm: 'PURGE'
986
986
  };
987
987
  }
988
+ function lowerPurgePayload(stmt) {
989
+ if (stmt.confirm.parsed !== 'PURGE') {
990
+ throw invalidSyntax('PURGE PAYLOAD must be confirmed with the exact literal "PURGE"', stmt.confirm.range);
991
+ }
992
+ return {
993
+ target: lowerElementRef(stmt.target),
994
+ where_clauses: stmt.where ? lowerWhere(stmt.where) : null,
995
+ limit: stmt.limit ? lowerScalar(stmt.limit.value) : null,
996
+ expect_versions: lowerExpectVersions(stmt.expectVersions),
997
+ confirm: 'PURGE'
998
+ };
999
+ }
988
1000
  // ---------------------------------------------------------------------------
989
1001
  // UPDATE
990
1002
  // ---------------------------------------------------------------------------
@@ -998,12 +1010,10 @@ function lowerUpdate(stmt) {
998
1010
  const actions = stmt.actions.map((action) => lowerUpdateAction(action, targetVar, kind));
999
1011
  return {
1000
1012
  target,
1001
- expect_version: stmt.expectVersion
1002
- ? lowerScalar(stmt.expectVersion.value)
1003
- : null,
1004
1013
  actions,
1005
1014
  where_clauses: stmt.where ? lowerWhere(stmt.where) : null,
1006
- limit: stmt.limit ? lowerScalar(stmt.limit.value) : null
1015
+ limit: stmt.limit ? lowerScalar(stmt.limit.value) : null,
1016
+ expect_versions: lowerExpectVersions(stmt.expectVersions)
1007
1017
  };
1008
1018
  }
1009
1019
  function boundKindOf(variable, patterns) {
@@ -1086,18 +1096,18 @@ function lowerUpdateAction(action, targetVar, kind) {
1086
1096
  * Structural mutation reaches mutable Concept topology only (Spec §17.5).
1087
1097
  * Record kinds keep their topology: an Assertion's citations and an
1088
1098
  * Evidence's lineage are immutable payload, a Proposition has no structural
1089
- * fields, and a pending Activity finalizes through TRANSITION ACTIVITY.
1099
+ * fields, and a pending Activity finalizes through TRANSITION.
1090
1100
  */
1091
1101
  function guardStructuralMutation(verb, kind, range) {
1092
1102
  switch (kind) {
1093
1103
  case 'assertion':
1094
1104
  throw invalidSyntax(`${verb} cannot change an Assertion's citations: they are immutable payload — record a new Assertion with SUPERSEDING`, range);
1095
1105
  case 'evidence':
1096
- throw invalidSyntax(`${verb} cannot change Evidence topology: correct it with CORRECT EVIDENCE :old BY :new`, range);
1106
+ throw invalidSyntax(`${verb} cannot change Evidence topology: correct it with TRANSITION :old TO "corrected" BY :new`, range);
1097
1107
  case 'proposition':
1098
1108
  throw invalidSyntax(`${verb} has no target on a Proposition: a Proposition is its tuple and carries no structural fields`, range);
1099
1109
  case 'activity':
1100
- throw invalidSyntax(`${verb} cannot change Activity topology: finalize a pending Activity with TRANSITION ACTIVITY ... SET STRUCTURAL; a terminal Activity is immutable`, range);
1110
+ throw invalidSyntax(`${verb} cannot change Activity topology: finalize a pending Activity with TRANSITION ... TO "completed" SET STRUCTURAL; a terminal Activity is immutable`, range);
1101
1111
  default:
1102
1112
  return;
1103
1113
  }
@@ -1115,7 +1125,7 @@ function guardImmutableField(field, kind, range) {
1115
1125
  'never by rewriting the old one', range);
1116
1126
  }
1117
1127
  if (kind === 'evidence' && EVIDENCE_IMMUTABLE.has(field)) {
1118
- throw invalidSyntax(`${field} is immutable Evidence payload: correct it with CORRECT EVIDENCE :old BY :new`, range);
1128
+ throw invalidSyntax(`${field} is immutable Evidence payload: correct it with TRANSITION :old TO "corrected" BY :new`, range);
1119
1129
  }
1120
1130
  if (kind === 'proposition' && PROPOSITION_IMMUTABLE.has(field)) {
1121
1131
  throw invalidSyntax(`${field} is part of the immutable Proposition tuple: a different tuple is a different Proposition`, range);
@@ -1331,8 +1341,6 @@ function lowerMeta(stmt) {
1331
1341
  }
1332
1342
  }
1333
1343
  };
1334
- case 'SnapshotStatement':
1335
- return { Snapshot: { as_of: stmt.asOf ? lowerAsOf(stmt.asOf) : null } };
1336
1344
  case 'ExportCapsuleStatement':
1337
1345
  return { ExportCapsule: lowerExport(stmt) };
1338
1346
  default:
@@ -1360,7 +1368,8 @@ const LIST_TARGETS = {
1360
1368
  PREDICATES: 'Predicates',
1361
1369
  FACETS: 'Facets',
1362
1370
  STRUCTURAL_FIELDS: 'StructuralFields',
1363
- EPISTEMIC_POLICIES: 'EpistemicPolicies'
1371
+ EPISTEMIC_POLICIES: 'EpistemicPolicies',
1372
+ DEPENDENTS: 'Dependents'
1364
1373
  };
1365
1374
  const SEARCH_TARGETS = {
1366
1375
  CONCEPT: 'Concept',
@@ -1382,8 +1391,6 @@ function lowerDescribe(stmt) {
1382
1391
  return { Primer: { mode: stmt.mode ? lowerScalar(stmt.mode) : null } };
1383
1392
  case 'PROTOCOL':
1384
1393
  return 'Protocol';
1385
- case 'EXECUTION_CONTEXT':
1386
- return 'ExecutionContext';
1387
1394
  case 'CAPABILITIES':
1388
1395
  return 'Capabilities';
1389
1396
  case 'SPACE':
@@ -1416,15 +1423,18 @@ function lowerDescribe(stmt) {
1416
1423
  case 'TRANSACTION_BY_IDEMPOTENCY_KEY':
1417
1424
  return { TransactionByIdempotencyKey: value() };
1418
1425
  case 'SNAPSHOT':
1419
- return { Snapshot: { as_of: stmt.asOf ? lowerAsOf(stmt.asOf) : null } };
1426
+ return {
1427
+ Snapshot: {
1428
+ as_of: stmt.asOf ? lowerAsOf(stmt.asOf) : null,
1429
+ at_time: stmt.atTime ? lowerScalar(stmt.atTime) : null
1430
+ }
1431
+ };
1420
1432
  case 'CAPSULE':
1421
1433
  return { Capsule: value() };
1422
1434
  case 'EPISTEMIC_POLICY':
1423
1435
  return {
1424
1436
  EpistemicPolicy: { value: stmt.value ? lowerScalar(stmt.value) : null }
1425
1437
  };
1426
- case 'PROJECTION_CAPABILITY':
1427
- return 'ProjectionCapability';
1428
1438
  case 'TRUST':
1429
1439
  return { Trust: { value: stmt.value ? lowerScalar(stmt.value) : null } };
1430
1440
  case 'ACCESS':
@@ -1434,9 +1444,14 @@ function lowerDescribe(stmt) {
1434
1444
  }
1435
1445
  }
1436
1446
  function lowerList(stmt) {
1447
+ if (stmt.target === 'DEPENDENTS' && !stmt.element) {
1448
+ throw invalidSyntax('LIST DEPENDENTS requires an element operand', stmt.range);
1449
+ }
1437
1450
  return {
1438
1451
  target: LIST_TARGETS[stmt.target],
1439
1452
  status: stmt.status ? lowerScalar(stmt.status) : null,
1453
+ element: stmt.element ? lowerScalar(stmt.element) : null,
1454
+ depth: stmt.depth ? lowerScalar(stmt.depth) : null,
1440
1455
  limit: stmt.limit ? lowerScalar(stmt.limit.value) : null,
1441
1456
  cursor: stmt.cursor ? lowerScalar(stmt.cursor.value) : null
1442
1457
  };