@danielx/civet 0.6.6 → 0.6.7

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/browser.js CHANGED
@@ -1106,6 +1106,16 @@ var Civet = (() => {
1106
1106
  }
1107
1107
  return node;
1108
1108
  }
1109
+ function makeEmptyBlock() {
1110
+ const expressions = [];
1111
+ return {
1112
+ type: "BlockStatement",
1113
+ expressions,
1114
+ children: ["{", expressions, "}"],
1115
+ bare: false,
1116
+ empty: true
1117
+ };
1118
+ }
1109
1119
  function makeLeftHandSideExpression(expression) {
1110
1120
  switch (expression.type) {
1111
1121
  case "Ref":
@@ -1334,14 +1344,25 @@ var Civet = (() => {
1334
1344
  }
1335
1345
  });
1336
1346
  gatherRecursiveAll(statements, ({ type }) => type === "MethodDefinition").forEach((f) => {
1347
+ const { abstract, block, signature } = f;
1348
+ if (!abstract && !block) {
1349
+ const { name } = signature, { parent } = f, { elements } = parent, currentIndex = elements.findIndex(([, def]) => def === f);
1350
+ const following = elements[currentIndex + 1]?.[1];
1351
+ if (following?.signature?.name !== name) {
1352
+ const block2 = makeEmptyBlock();
1353
+ block2.parent = f;
1354
+ f.block = block2;
1355
+ f.children.push(block2);
1356
+ }
1357
+ }
1337
1358
  processParams(f);
1338
1359
  if (!processReturnValue(f) && config.implicitReturns) {
1339
- const { signature, block } = f;
1340
- const isConstructor = signature.name === "constructor";
1341
- const isVoid = isVoidType(signature.returnType?.t);
1342
- const isSet = signature.modifier?.set;
1360
+ const { signature: signature2, block: block2 } = f;
1361
+ const isConstructor = signature2.name === "constructor";
1362
+ const isVoid = isVoidType(signature2.returnType?.t);
1363
+ const isSet = signature2.modifier?.set;
1343
1364
  if (!isConstructor && !isSet && !isVoid) {
1344
- insertReturn(block);
1365
+ insertReturn(block2);
1345
1366
  }
1346
1367
  }
1347
1368
  });
@@ -2462,6 +2483,7 @@ var Civet = (() => {
2462
2483
  lastAccessInCallExpression,
2463
2484
  literalValue,
2464
2485
  makeAsConst,
2486
+ makeEmptyBlock,
2465
2487
  makeLeftHandSideExpression,
2466
2488
  maybeRef,
2467
2489
  modifyString,
@@ -5692,8 +5714,22 @@ ${input.slice(result.pos)}
5692
5714
  return result;
5693
5715
  }
5694
5716
  }
5695
- var ClassBody$0 = $S(__, OpenBrace, $E(NestedClassElements), __, CloseBrace);
5696
- var ClassBody$1 = $S(InsertOpenBrace, $E(NestedClassElements), InsertNewline, InsertIndent, InsertCloseBrace);
5717
+ var ClassBody$0 = $TS($S(__, OpenBrace, $E(NestedClassElements), __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
5718
+ var elements = $3;
5719
+ return {
5720
+ type: "ClassBody",
5721
+ children: $0,
5722
+ elements
5723
+ };
5724
+ });
5725
+ var ClassBody$1 = $TS($S(InsertOpenBrace, $E(NestedClassElements), InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
5726
+ var elements = $2;
5727
+ return {
5728
+ type: "ClassBody",
5729
+ children: $0,
5730
+ elements
5731
+ };
5732
+ });
5697
5733
  function ClassBody(state) {
5698
5734
  let eventData;
5699
5735
  if (state.events) {
@@ -5767,8 +5803,19 @@ ${input.slice(result.pos)}
5767
5803
  return result;
5768
5804
  }
5769
5805
  }
5770
- var ClassElement$0 = $S($E(Decorators), $E(AccessModifier), $E($S(Static, $E(_))), ClassElementDefinition);
5771
- var ClassElement$1 = $S(Static, BracedBlock);
5806
+ var ClassElement$0 = $TS($S($E(Decorators), $E(AccessModifier), $E($S(Static, $E(_))), ClassElementDefinition), function($skip, $loc, $0, $1, $2, $3, $4) {
5807
+ var definition = $4;
5808
+ return {
5809
+ ...definition,
5810
+ children: [$1, $2, $3, ...definition.children]
5811
+ };
5812
+ });
5813
+ var ClassElement$1 = $TS($S(Static, BracedBlock), function($skip, $loc, $0, $1, $2) {
5814
+ return {
5815
+ type: "ClassStaticBlock",
5816
+ children: $0
5817
+ };
5818
+ });
5772
5819
  function ClassElement(state) {
5773
5820
  let eventData;
5774
5821
  if (state.events) {
@@ -5984,7 +6031,10 @@ ${input.slice(result.pos)}
5984
6031
  children
5985
6032
  };
5986
6033
  default:
5987
- return [id, " = ", exp];
6034
+ return {
6035
+ type: "FieldDefinition",
6036
+ children: [id, " = ", exp]
6037
+ };
5988
6038
  }
5989
6039
  });
5990
6040
  var FieldDefinition$1 = $TS($S(InsertReadonly, ClassElementName, $E(TypeSuffix), __, ConstAssignment, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
@@ -5994,12 +6044,18 @@ ${input.slice(result.pos)}
5994
6044
  pos: ca.$loc.pos - 1,
5995
6045
  length: ca.$loc.length + 1
5996
6046
  };
5997
- return $0;
6047
+ return {
6048
+ type: "FieldDefinition",
6049
+ children: $0
6050
+ };
5998
6051
  });
5999
6052
  var FieldDefinition$2 = $TS($S($E($S(Abstract, $E(_))), $E($S(Readonly, $E(_))), ClassElementName, $E(TypeSuffix), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
6000
6053
  if ($1)
6001
6054
  return { children: $0, ts: true };
6002
- return $0;
6055
+ return {
6056
+ type: "FieldDefinition",
6057
+ children: $0
6058
+ };
6003
6059
  });
6004
6060
  function FieldDefinition(state) {
6005
6061
  let eventData;
@@ -9713,7 +9769,7 @@ ${input.slice(result.pos)}
9713
9769
  var PropertyDefinition$3 = $TS($S(__, MethodDefinition), function($skip, $loc, $0, $1, $2) {
9714
9770
  var ws = $1;
9715
9771
  var def = $2;
9716
- if (def.block.empty)
9772
+ if (!def.block || def.block.empty)
9717
9773
  return $skip;
9718
9774
  return {
9719
9775
  ...def,
@@ -10036,12 +10092,13 @@ ${input.slice(result.pos)}
10036
10092
  type: "MethodDefinition",
10037
10093
  children: $0,
10038
10094
  name: signature.name,
10095
+ abstract: true,
10039
10096
  signature,
10040
10097
  parameters: signature.parameters,
10041
10098
  ts: true
10042
10099
  };
10043
10100
  });
10044
- var MethodDefinition$1 = $TS($S(MethodSignature, $N(PropertyAccess), BracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3) {
10101
+ var MethodDefinition$1 = $TS($S(MethodSignature, $N(PropertyAccess), $E(BracedBlock)), function($skip, $loc, $0, $1, $2, $3) {
10045
10102
  var signature = $1;
10046
10103
  var block = $3;
10047
10104
  let children = $0;
@@ -10171,7 +10228,7 @@ ${input.slice(result.pos)}
10171
10228
  var modifier = $1;
10172
10229
  var name = $2;
10173
10230
  var parameters = $4;
10174
- var suffix = $5;
10231
+ var returnType = $5;
10175
10232
  if (name.name) {
10176
10233
  name = name.name;
10177
10234
  } else if (name.token) {
@@ -10182,7 +10239,7 @@ ${input.slice(result.pos)}
10182
10239
  children: $0,
10183
10240
  name,
10184
10241
  modifier,
10185
- returnType: suffix,
10242
+ returnType,
10186
10243
  parameters
10187
10244
  };
10188
10245
  });
@@ -12684,14 +12741,7 @@ ${input.slice(result.pos)}
12684
12741
  var c = $4;
12685
12742
  var f = $5;
12686
12743
  if (!c && !f) {
12687
- const e = [];
12688
- const emptyCatchBlock = {
12689
- type: "BlockStatement",
12690
- expressions: e,
12691
- children: ["{", e, "}"],
12692
- bare: false,
12693
- empty: true
12694
- };
12744
+ const emptyCatchBlock = makeEmptyBlock();
12695
12745
  c = {
12696
12746
  type: "CatchClause",
12697
12747
  children: [" catch(e) ", emptyCatchBlock],
@@ -23405,6 +23455,7 @@ ${input.slice(result.pos)}
23405
23455
  isWhitespaceOrEmpty,
23406
23456
  lastAccessInCallExpression,
23407
23457
  literalValue,
23458
+ makeEmptyBlock,
23408
23459
  makeLeftHandSideExpression,
23409
23460
  maybeRef,
23410
23461
  modifyString,
package/dist/main.js CHANGED
@@ -1105,6 +1105,16 @@ var require_lib = __commonJS({
1105
1105
  }
1106
1106
  return node;
1107
1107
  }
1108
+ function makeEmptyBlock() {
1109
+ const expressions = [];
1110
+ return {
1111
+ type: "BlockStatement",
1112
+ expressions,
1113
+ children: ["{", expressions, "}"],
1114
+ bare: false,
1115
+ empty: true
1116
+ };
1117
+ }
1108
1118
  function makeLeftHandSideExpression(expression) {
1109
1119
  switch (expression.type) {
1110
1120
  case "Ref":
@@ -1333,14 +1343,25 @@ var require_lib = __commonJS({
1333
1343
  }
1334
1344
  });
1335
1345
  gatherRecursiveAll(statements, ({ type }) => type === "MethodDefinition").forEach((f) => {
1346
+ const { abstract, block, signature } = f;
1347
+ if (!abstract && !block) {
1348
+ const { name } = signature, { parent } = f, { elements } = parent, currentIndex = elements.findIndex(([, def]) => def === f);
1349
+ const following = elements[currentIndex + 1]?.[1];
1350
+ if (following?.signature?.name !== name) {
1351
+ const block2 = makeEmptyBlock();
1352
+ block2.parent = f;
1353
+ f.block = block2;
1354
+ f.children.push(block2);
1355
+ }
1356
+ }
1336
1357
  processParams(f);
1337
1358
  if (!processReturnValue(f) && config.implicitReturns) {
1338
- const { signature, block } = f;
1339
- const isConstructor = signature.name === "constructor";
1340
- const isVoid = isVoidType(signature.returnType?.t);
1341
- const isSet = signature.modifier?.set;
1359
+ const { signature: signature2, block: block2 } = f;
1360
+ const isConstructor = signature2.name === "constructor";
1361
+ const isVoid = isVoidType(signature2.returnType?.t);
1362
+ const isSet = signature2.modifier?.set;
1342
1363
  if (!isConstructor && !isSet && !isVoid) {
1343
- insertReturn(block);
1364
+ insertReturn(block2);
1344
1365
  }
1345
1366
  }
1346
1367
  });
@@ -2461,6 +2482,7 @@ var require_lib = __commonJS({
2461
2482
  lastAccessInCallExpression,
2462
2483
  literalValue,
2463
2484
  makeAsConst,
2485
+ makeEmptyBlock,
2464
2486
  makeLeftHandSideExpression,
2465
2487
  maybeRef,
2466
2488
  modifyString,
@@ -5691,8 +5713,22 @@ ${input.slice(result.pos)}
5691
5713
  return result;
5692
5714
  }
5693
5715
  }
5694
- var ClassBody$0 = $S(__, OpenBrace, $E(NestedClassElements), __, CloseBrace);
5695
- var ClassBody$1 = $S(InsertOpenBrace, $E(NestedClassElements), InsertNewline, InsertIndent, InsertCloseBrace);
5716
+ var ClassBody$0 = $TS($S(__, OpenBrace, $E(NestedClassElements), __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
5717
+ var elements = $3;
5718
+ return {
5719
+ type: "ClassBody",
5720
+ children: $0,
5721
+ elements
5722
+ };
5723
+ });
5724
+ var ClassBody$1 = $TS($S(InsertOpenBrace, $E(NestedClassElements), InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
5725
+ var elements = $2;
5726
+ return {
5727
+ type: "ClassBody",
5728
+ children: $0,
5729
+ elements
5730
+ };
5731
+ });
5696
5732
  function ClassBody(state) {
5697
5733
  let eventData;
5698
5734
  if (state.events) {
@@ -5766,8 +5802,19 @@ ${input.slice(result.pos)}
5766
5802
  return result;
5767
5803
  }
5768
5804
  }
5769
- var ClassElement$0 = $S($E(Decorators), $E(AccessModifier), $E($S(Static, $E(_))), ClassElementDefinition);
5770
- var ClassElement$1 = $S(Static, BracedBlock);
5805
+ var ClassElement$0 = $TS($S($E(Decorators), $E(AccessModifier), $E($S(Static, $E(_))), ClassElementDefinition), function($skip, $loc, $0, $1, $2, $3, $4) {
5806
+ var definition = $4;
5807
+ return {
5808
+ ...definition,
5809
+ children: [$1, $2, $3, ...definition.children]
5810
+ };
5811
+ });
5812
+ var ClassElement$1 = $TS($S(Static, BracedBlock), function($skip, $loc, $0, $1, $2) {
5813
+ return {
5814
+ type: "ClassStaticBlock",
5815
+ children: $0
5816
+ };
5817
+ });
5771
5818
  function ClassElement(state) {
5772
5819
  let eventData;
5773
5820
  if (state.events) {
@@ -5983,7 +6030,10 @@ ${input.slice(result.pos)}
5983
6030
  children
5984
6031
  };
5985
6032
  default:
5986
- return [id, " = ", exp];
6033
+ return {
6034
+ type: "FieldDefinition",
6035
+ children: [id, " = ", exp]
6036
+ };
5987
6037
  }
5988
6038
  });
5989
6039
  var FieldDefinition$1 = $TS($S(InsertReadonly, ClassElementName, $E(TypeSuffix), __, ConstAssignment, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
@@ -5993,12 +6043,18 @@ ${input.slice(result.pos)}
5993
6043
  pos: ca.$loc.pos - 1,
5994
6044
  length: ca.$loc.length + 1
5995
6045
  };
5996
- return $0;
6046
+ return {
6047
+ type: "FieldDefinition",
6048
+ children: $0
6049
+ };
5997
6050
  });
5998
6051
  var FieldDefinition$2 = $TS($S($E($S(Abstract, $E(_))), $E($S(Readonly, $E(_))), ClassElementName, $E(TypeSuffix), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
5999
6052
  if ($1)
6000
6053
  return { children: $0, ts: true };
6001
- return $0;
6054
+ return {
6055
+ type: "FieldDefinition",
6056
+ children: $0
6057
+ };
6002
6058
  });
6003
6059
  function FieldDefinition(state) {
6004
6060
  let eventData;
@@ -9712,7 +9768,7 @@ ${input.slice(result.pos)}
9712
9768
  var PropertyDefinition$3 = $TS($S(__, MethodDefinition), function($skip, $loc, $0, $1, $2) {
9713
9769
  var ws = $1;
9714
9770
  var def = $2;
9715
- if (def.block.empty)
9771
+ if (!def.block || def.block.empty)
9716
9772
  return $skip;
9717
9773
  return {
9718
9774
  ...def,
@@ -10035,12 +10091,13 @@ ${input.slice(result.pos)}
10035
10091
  type: "MethodDefinition",
10036
10092
  children: $0,
10037
10093
  name: signature.name,
10094
+ abstract: true,
10038
10095
  signature,
10039
10096
  parameters: signature.parameters,
10040
10097
  ts: true
10041
10098
  };
10042
10099
  });
10043
- var MethodDefinition$1 = $TS($S(MethodSignature, $N(PropertyAccess), BracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3) {
10100
+ var MethodDefinition$1 = $TS($S(MethodSignature, $N(PropertyAccess), $E(BracedBlock)), function($skip, $loc, $0, $1, $2, $3) {
10044
10101
  var signature = $1;
10045
10102
  var block = $3;
10046
10103
  let children = $0;
@@ -10170,7 +10227,7 @@ ${input.slice(result.pos)}
10170
10227
  var modifier = $1;
10171
10228
  var name = $2;
10172
10229
  var parameters = $4;
10173
- var suffix = $5;
10230
+ var returnType = $5;
10174
10231
  if (name.name) {
10175
10232
  name = name.name;
10176
10233
  } else if (name.token) {
@@ -10181,7 +10238,7 @@ ${input.slice(result.pos)}
10181
10238
  children: $0,
10182
10239
  name,
10183
10240
  modifier,
10184
- returnType: suffix,
10241
+ returnType,
10185
10242
  parameters
10186
10243
  };
10187
10244
  });
@@ -12683,14 +12740,7 @@ ${input.slice(result.pos)}
12683
12740
  var c = $4;
12684
12741
  var f = $5;
12685
12742
  if (!c && !f) {
12686
- const e = [];
12687
- const emptyCatchBlock = {
12688
- type: "BlockStatement",
12689
- expressions: e,
12690
- children: ["{", e, "}"],
12691
- bare: false,
12692
- empty: true
12693
- };
12743
+ const emptyCatchBlock = makeEmptyBlock();
12694
12744
  c = {
12695
12745
  type: "CatchClause",
12696
12746
  children: [" catch(e) ", emptyCatchBlock],
@@ -23404,6 +23454,7 @@ ${input.slice(result.pos)}
23404
23454
  isWhitespaceOrEmpty,
23405
23455
  lastAccessInCallExpression,
23406
23456
  literalValue,
23457
+ makeEmptyBlock,
23407
23458
  makeLeftHandSideExpression,
23408
23459
  maybeRef,
23409
23460
  modifyString,
package/dist/main.mjs CHANGED
@@ -1103,6 +1103,16 @@ var require_lib = __commonJS({
1103
1103
  }
1104
1104
  return node;
1105
1105
  }
1106
+ function makeEmptyBlock() {
1107
+ const expressions = [];
1108
+ return {
1109
+ type: "BlockStatement",
1110
+ expressions,
1111
+ children: ["{", expressions, "}"],
1112
+ bare: false,
1113
+ empty: true
1114
+ };
1115
+ }
1106
1116
  function makeLeftHandSideExpression(expression) {
1107
1117
  switch (expression.type) {
1108
1118
  case "Ref":
@@ -1331,14 +1341,25 @@ var require_lib = __commonJS({
1331
1341
  }
1332
1342
  });
1333
1343
  gatherRecursiveAll(statements, ({ type }) => type === "MethodDefinition").forEach((f) => {
1344
+ const { abstract, block, signature } = f;
1345
+ if (!abstract && !block) {
1346
+ const { name } = signature, { parent } = f, { elements } = parent, currentIndex = elements.findIndex(([, def]) => def === f);
1347
+ const following = elements[currentIndex + 1]?.[1];
1348
+ if (following?.signature?.name !== name) {
1349
+ const block2 = makeEmptyBlock();
1350
+ block2.parent = f;
1351
+ f.block = block2;
1352
+ f.children.push(block2);
1353
+ }
1354
+ }
1334
1355
  processParams(f);
1335
1356
  if (!processReturnValue(f) && config.implicitReturns) {
1336
- const { signature, block } = f;
1337
- const isConstructor = signature.name === "constructor";
1338
- const isVoid = isVoidType(signature.returnType?.t);
1339
- const isSet = signature.modifier?.set;
1357
+ const { signature: signature2, block: block2 } = f;
1358
+ const isConstructor = signature2.name === "constructor";
1359
+ const isVoid = isVoidType(signature2.returnType?.t);
1360
+ const isSet = signature2.modifier?.set;
1340
1361
  if (!isConstructor && !isSet && !isVoid) {
1341
- insertReturn(block);
1362
+ insertReturn(block2);
1342
1363
  }
1343
1364
  }
1344
1365
  });
@@ -2459,6 +2480,7 @@ var require_lib = __commonJS({
2459
2480
  lastAccessInCallExpression,
2460
2481
  literalValue,
2461
2482
  makeAsConst,
2483
+ makeEmptyBlock,
2462
2484
  makeLeftHandSideExpression,
2463
2485
  maybeRef,
2464
2486
  modifyString,
@@ -5689,8 +5711,22 @@ ${input.slice(result.pos)}
5689
5711
  return result;
5690
5712
  }
5691
5713
  }
5692
- var ClassBody$0 = $S(__, OpenBrace, $E(NestedClassElements), __, CloseBrace);
5693
- var ClassBody$1 = $S(InsertOpenBrace, $E(NestedClassElements), InsertNewline, InsertIndent, InsertCloseBrace);
5714
+ var ClassBody$0 = $TS($S(__, OpenBrace, $E(NestedClassElements), __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
5715
+ var elements = $3;
5716
+ return {
5717
+ type: "ClassBody",
5718
+ children: $0,
5719
+ elements
5720
+ };
5721
+ });
5722
+ var ClassBody$1 = $TS($S(InsertOpenBrace, $E(NestedClassElements), InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
5723
+ var elements = $2;
5724
+ return {
5725
+ type: "ClassBody",
5726
+ children: $0,
5727
+ elements
5728
+ };
5729
+ });
5694
5730
  function ClassBody(state) {
5695
5731
  let eventData;
5696
5732
  if (state.events) {
@@ -5764,8 +5800,19 @@ ${input.slice(result.pos)}
5764
5800
  return result;
5765
5801
  }
5766
5802
  }
5767
- var ClassElement$0 = $S($E(Decorators), $E(AccessModifier), $E($S(Static, $E(_))), ClassElementDefinition);
5768
- var ClassElement$1 = $S(Static, BracedBlock);
5803
+ var ClassElement$0 = $TS($S($E(Decorators), $E(AccessModifier), $E($S(Static, $E(_))), ClassElementDefinition), function($skip, $loc, $0, $1, $2, $3, $4) {
5804
+ var definition = $4;
5805
+ return {
5806
+ ...definition,
5807
+ children: [$1, $2, $3, ...definition.children]
5808
+ };
5809
+ });
5810
+ var ClassElement$1 = $TS($S(Static, BracedBlock), function($skip, $loc, $0, $1, $2) {
5811
+ return {
5812
+ type: "ClassStaticBlock",
5813
+ children: $0
5814
+ };
5815
+ });
5769
5816
  function ClassElement(state) {
5770
5817
  let eventData;
5771
5818
  if (state.events) {
@@ -5981,7 +6028,10 @@ ${input.slice(result.pos)}
5981
6028
  children
5982
6029
  };
5983
6030
  default:
5984
- return [id, " = ", exp];
6031
+ return {
6032
+ type: "FieldDefinition",
6033
+ children: [id, " = ", exp]
6034
+ };
5985
6035
  }
5986
6036
  });
5987
6037
  var FieldDefinition$1 = $TS($S(InsertReadonly, ClassElementName, $E(TypeSuffix), __, ConstAssignment, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
@@ -5991,12 +6041,18 @@ ${input.slice(result.pos)}
5991
6041
  pos: ca.$loc.pos - 1,
5992
6042
  length: ca.$loc.length + 1
5993
6043
  };
5994
- return $0;
6044
+ return {
6045
+ type: "FieldDefinition",
6046
+ children: $0
6047
+ };
5995
6048
  });
5996
6049
  var FieldDefinition$2 = $TS($S($E($S(Abstract, $E(_))), $E($S(Readonly, $E(_))), ClassElementName, $E(TypeSuffix), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
5997
6050
  if ($1)
5998
6051
  return { children: $0, ts: true };
5999
- return $0;
6052
+ return {
6053
+ type: "FieldDefinition",
6054
+ children: $0
6055
+ };
6000
6056
  });
6001
6057
  function FieldDefinition(state) {
6002
6058
  let eventData;
@@ -9710,7 +9766,7 @@ ${input.slice(result.pos)}
9710
9766
  var PropertyDefinition$3 = $TS($S(__, MethodDefinition), function($skip, $loc, $0, $1, $2) {
9711
9767
  var ws = $1;
9712
9768
  var def = $2;
9713
- if (def.block.empty)
9769
+ if (!def.block || def.block.empty)
9714
9770
  return $skip;
9715
9771
  return {
9716
9772
  ...def,
@@ -10033,12 +10089,13 @@ ${input.slice(result.pos)}
10033
10089
  type: "MethodDefinition",
10034
10090
  children: $0,
10035
10091
  name: signature.name,
10092
+ abstract: true,
10036
10093
  signature,
10037
10094
  parameters: signature.parameters,
10038
10095
  ts: true
10039
10096
  };
10040
10097
  });
10041
- var MethodDefinition$1 = $TS($S(MethodSignature, $N(PropertyAccess), BracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3) {
10098
+ var MethodDefinition$1 = $TS($S(MethodSignature, $N(PropertyAccess), $E(BracedBlock)), function($skip, $loc, $0, $1, $2, $3) {
10042
10099
  var signature = $1;
10043
10100
  var block = $3;
10044
10101
  let children = $0;
@@ -10168,7 +10225,7 @@ ${input.slice(result.pos)}
10168
10225
  var modifier = $1;
10169
10226
  var name = $2;
10170
10227
  var parameters = $4;
10171
- var suffix = $5;
10228
+ var returnType = $5;
10172
10229
  if (name.name) {
10173
10230
  name = name.name;
10174
10231
  } else if (name.token) {
@@ -10179,7 +10236,7 @@ ${input.slice(result.pos)}
10179
10236
  children: $0,
10180
10237
  name,
10181
10238
  modifier,
10182
- returnType: suffix,
10239
+ returnType,
10183
10240
  parameters
10184
10241
  };
10185
10242
  });
@@ -12681,14 +12738,7 @@ ${input.slice(result.pos)}
12681
12738
  var c = $4;
12682
12739
  var f = $5;
12683
12740
  if (!c && !f) {
12684
- const e = [];
12685
- const emptyCatchBlock = {
12686
- type: "BlockStatement",
12687
- expressions: e,
12688
- children: ["{", e, "}"],
12689
- bare: false,
12690
- empty: true
12691
- };
12741
+ const emptyCatchBlock = makeEmptyBlock();
12692
12742
  c = {
12693
12743
  type: "CatchClause",
12694
12744
  children: [" catch(e) ", emptyCatchBlock],
@@ -23402,6 +23452,7 @@ ${input.slice(result.pos)}
23402
23452
  isWhitespaceOrEmpty,
23403
23453
  lastAccessInCallExpression,
23404
23454
  literalValue,
23455
+ makeEmptyBlock,
23405
23456
  makeLeftHandSideExpression,
23406
23457
  maybeRef,
23407
23458
  modifyString,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielx/civet",
3
- "version": "0.6.6",
3
+ "version": "0.6.7",
4
4
  "description": "CoffeeScript style syntax for TypeScript",
5
5
  "main": "dist/main.js",
6
6
  "module": "dist/main.mjs",