@danielx/civet 0.6.84 → 0.6.85

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
@@ -2121,7 +2121,7 @@ var Civet = (() => {
2121
2121
  ws = exp[0];
2122
2122
  exp = exp[1];
2123
2123
  }
2124
- if (!(exp.type === "StatementExpression")) {
2124
+ if (!(exp?.type === "StatementExpression")) {
2125
2125
  return;
2126
2126
  }
2127
2127
  const pre = [];
@@ -2139,7 +2139,8 @@ var Civet = (() => {
2139
2139
  assignResults(blockStatement, (resultNode) => {
2140
2140
  return makeNode({
2141
2141
  type: "AssignmentExpression",
2142
- children: [ref, " = ", resultNode]
2142
+ children: [ref, " = ", resultNode],
2143
+ parent: statement2
2143
2144
  });
2144
2145
  });
2145
2146
  const refDec = {
@@ -2157,7 +2158,8 @@ var Civet = (() => {
2157
2158
  assignResults(blockStatement, (resultNode) => {
2158
2159
  return makeNode({
2159
2160
  type: "AssignmentExpression",
2160
- children: [ref, " = ", resultNode]
2161
+ children: [ref, " = ", resultNode],
2162
+ parent: statement
2161
2163
  });
2162
2164
  });
2163
2165
  const refDec = {
@@ -3230,6 +3232,7 @@ var Civet = (() => {
3230
3232
  case "BlockStatement":
3231
3233
  case "DebuggerStatement":
3232
3234
  case "Declaration":
3235
+ case "ForStatement":
3233
3236
  case "IfStatement":
3234
3237
  case "IterationStatement":
3235
3238
  case "ReturnStatement":
@@ -6137,9 +6140,7 @@ ${input.slice(result.pos)}
6137
6140
  return $EVENT_C(ctx, state, "UnaryWithoutParenthesizedAssignmentBody", UnaryWithoutParenthesizedAssignmentBody$$);
6138
6141
  }
6139
6142
  var UnaryPostfix$0 = QuestionMark;
6140
- var UnaryPostfix$1 = $T($P(TypePostfix), function(value) {
6141
- return { "ts": true, "children": value };
6142
- });
6143
+ var UnaryPostfix$1 = $P(TypePostfix);
6143
6144
  var UnaryPostfix$$ = [UnaryPostfix$0, UnaryPostfix$1];
6144
6145
  function UnaryPostfix(ctx, state) {
6145
6146
  return $EVENT_C(ctx, state, "UnaryPostfix", UnaryPostfix$$);
@@ -6147,7 +6148,7 @@ ${input.slice(result.pos)}
6147
6148
  var TypePostfix$0 = $TS($S(_, NWTypePostfix), function($skip, $loc, $0, $1, $2) {
6148
6149
  var ws = $1;
6149
6150
  var postfix = $2;
6150
- return [ws, ...postfix];
6151
+ return [ws, postfix];
6151
6152
  });
6152
6153
  function TypePostfix(ctx, state) {
6153
6154
  return $EVENT(ctx, state, "TypePostfix", TypePostfix$0);
@@ -6162,18 +6163,26 @@ ${input.slice(result.pos)}
6162
6163
  return $EVENT(ctx, state, "Tuple", Tuple$0);
6163
6164
  }
6164
6165
  var NWTypePostfix$0 = $TS($S(As, _, Tuple), function($skip, $loc, $0, $1, $2, $3) {
6165
- return [{ $loc: $1.$loc, token: "satisfies" }, $2, $3];
6166
+ return {
6167
+ ts: true,
6168
+ children: [{ $loc: $1.$loc, token: "satisfies" }, $2, $3]
6169
+ };
6166
6170
  });
6167
6171
  var NWTypePostfix$1 = $TS($S(As, $E(ExclamationPoint), Type), function($skip, $loc, $0, $1, $2, $3) {
6168
6172
  var as = $1;
6169
6173
  var ex = $2;
6170
6174
  var type = $3;
6175
+ let children;
6171
6176
  if (ex) {
6172
- return [{ $loc: ex.$loc, token: "as unknown " }, as, type];
6177
+ children = [{ $loc: ex.$loc, token: "as unknown " }, as, type];
6178
+ } else {
6179
+ children = [as, type];
6173
6180
  }
6174
- return [as, type];
6181
+ return { ts: true, children };
6182
+ });
6183
+ var NWTypePostfix$2 = $TS($S(Satisfies, Type), function($skip, $loc, $0, $1, $2) {
6184
+ return { ts: true, children: $0 };
6175
6185
  });
6176
- var NWTypePostfix$2 = $S(Satisfies, Type);
6177
6186
  var NWTypePostfix$$ = [NWTypePostfix$0, NWTypePostfix$1, NWTypePostfix$2];
6178
6187
  function NWTypePostfix(ctx, state) {
6179
6188
  return $EVENT_C(ctx, state, "NWTypePostfix", NWTypePostfix$$);
package/dist/main.js CHANGED
@@ -2113,7 +2113,7 @@ function prependStatementExpressionBlock(initializer, statement) {
2113
2113
  ws = exp[0];
2114
2114
  exp = exp[1];
2115
2115
  }
2116
- if (!(exp.type === "StatementExpression")) {
2116
+ if (!(exp?.type === "StatementExpression")) {
2117
2117
  return;
2118
2118
  }
2119
2119
  const pre = [];
@@ -2131,7 +2131,8 @@ function prependStatementExpressionBlock(initializer, statement) {
2131
2131
  assignResults(blockStatement, (resultNode) => {
2132
2132
  return makeNode({
2133
2133
  type: "AssignmentExpression",
2134
- children: [ref, " = ", resultNode]
2134
+ children: [ref, " = ", resultNode],
2135
+ parent: statement2
2135
2136
  });
2136
2137
  });
2137
2138
  const refDec = {
@@ -2149,7 +2150,8 @@ function prependStatementExpressionBlock(initializer, statement) {
2149
2150
  assignResults(blockStatement, (resultNode) => {
2150
2151
  return makeNode({
2151
2152
  type: "AssignmentExpression",
2152
- children: [ref, " = ", resultNode]
2153
+ children: [ref, " = ", resultNode],
2154
+ parent: statement
2153
2155
  });
2154
2156
  });
2155
2157
  const refDec = {
@@ -3222,6 +3224,7 @@ function isExpression(node) {
3222
3224
  case "BlockStatement":
3223
3225
  case "DebuggerStatement":
3224
3226
  case "Declaration":
3227
+ case "ForStatement":
3225
3228
  case "IfStatement":
3226
3229
  case "IterationStatement":
3227
3230
  case "ReturnStatement":
@@ -6129,9 +6132,7 @@ var require_parser = __commonJS({
6129
6132
  return $EVENT_C(ctx, state, "UnaryWithoutParenthesizedAssignmentBody", UnaryWithoutParenthesizedAssignmentBody$$);
6130
6133
  }
6131
6134
  var UnaryPostfix$0 = QuestionMark;
6132
- var UnaryPostfix$1 = $T($P(TypePostfix), function(value) {
6133
- return { "ts": true, "children": value };
6134
- });
6135
+ var UnaryPostfix$1 = $P(TypePostfix);
6135
6136
  var UnaryPostfix$$ = [UnaryPostfix$0, UnaryPostfix$1];
6136
6137
  function UnaryPostfix(ctx, state) {
6137
6138
  return $EVENT_C(ctx, state, "UnaryPostfix", UnaryPostfix$$);
@@ -6139,7 +6140,7 @@ var require_parser = __commonJS({
6139
6140
  var TypePostfix$0 = $TS($S(_, NWTypePostfix), function($skip, $loc, $0, $1, $2) {
6140
6141
  var ws = $1;
6141
6142
  var postfix = $2;
6142
- return [ws, ...postfix];
6143
+ return [ws, postfix];
6143
6144
  });
6144
6145
  function TypePostfix(ctx, state) {
6145
6146
  return $EVENT(ctx, state, "TypePostfix", TypePostfix$0);
@@ -6154,18 +6155,26 @@ var require_parser = __commonJS({
6154
6155
  return $EVENT(ctx, state, "Tuple", Tuple$0);
6155
6156
  }
6156
6157
  var NWTypePostfix$0 = $TS($S(As, _, Tuple), function($skip, $loc, $0, $1, $2, $3) {
6157
- return [{ $loc: $1.$loc, token: "satisfies" }, $2, $3];
6158
+ return {
6159
+ ts: true,
6160
+ children: [{ $loc: $1.$loc, token: "satisfies" }, $2, $3]
6161
+ };
6158
6162
  });
6159
6163
  var NWTypePostfix$1 = $TS($S(As, $E(ExclamationPoint), Type), function($skip, $loc, $0, $1, $2, $3) {
6160
6164
  var as = $1;
6161
6165
  var ex = $2;
6162
6166
  var type = $3;
6167
+ let children;
6163
6168
  if (ex) {
6164
- return [{ $loc: ex.$loc, token: "as unknown " }, as, type];
6169
+ children = [{ $loc: ex.$loc, token: "as unknown " }, as, type];
6170
+ } else {
6171
+ children = [as, type];
6165
6172
  }
6166
- return [as, type];
6173
+ return { ts: true, children };
6174
+ });
6175
+ var NWTypePostfix$2 = $TS($S(Satisfies, Type), function($skip, $loc, $0, $1, $2) {
6176
+ return { ts: true, children: $0 };
6167
6177
  });
6168
- var NWTypePostfix$2 = $S(Satisfies, Type);
6169
6178
  var NWTypePostfix$$ = [NWTypePostfix$0, NWTypePostfix$1, NWTypePostfix$2];
6170
6179
  function NWTypePostfix(ctx, state) {
6171
6180
  return $EVENT_C(ctx, state, "NWTypePostfix", NWTypePostfix$$);
package/dist/main.mjs CHANGED
@@ -2111,7 +2111,7 @@ function prependStatementExpressionBlock(initializer, statement) {
2111
2111
  ws = exp[0];
2112
2112
  exp = exp[1];
2113
2113
  }
2114
- if (!(exp.type === "StatementExpression")) {
2114
+ if (!(exp?.type === "StatementExpression")) {
2115
2115
  return;
2116
2116
  }
2117
2117
  const pre = [];
@@ -2129,7 +2129,8 @@ function prependStatementExpressionBlock(initializer, statement) {
2129
2129
  assignResults(blockStatement, (resultNode) => {
2130
2130
  return makeNode({
2131
2131
  type: "AssignmentExpression",
2132
- children: [ref, " = ", resultNode]
2132
+ children: [ref, " = ", resultNode],
2133
+ parent: statement2
2133
2134
  });
2134
2135
  });
2135
2136
  const refDec = {
@@ -2147,7 +2148,8 @@ function prependStatementExpressionBlock(initializer, statement) {
2147
2148
  assignResults(blockStatement, (resultNode) => {
2148
2149
  return makeNode({
2149
2150
  type: "AssignmentExpression",
2150
- children: [ref, " = ", resultNode]
2151
+ children: [ref, " = ", resultNode],
2152
+ parent: statement
2151
2153
  });
2152
2154
  });
2153
2155
  const refDec = {
@@ -3220,6 +3222,7 @@ function isExpression(node) {
3220
3222
  case "BlockStatement":
3221
3223
  case "DebuggerStatement":
3222
3224
  case "Declaration":
3225
+ case "ForStatement":
3223
3226
  case "IfStatement":
3224
3227
  case "IterationStatement":
3225
3228
  case "ReturnStatement":
@@ -6127,9 +6130,7 @@ var require_parser = __commonJS({
6127
6130
  return $EVENT_C(ctx, state, "UnaryWithoutParenthesizedAssignmentBody", UnaryWithoutParenthesizedAssignmentBody$$);
6128
6131
  }
6129
6132
  var UnaryPostfix$0 = QuestionMark;
6130
- var UnaryPostfix$1 = $T($P(TypePostfix), function(value) {
6131
- return { "ts": true, "children": value };
6132
- });
6133
+ var UnaryPostfix$1 = $P(TypePostfix);
6133
6134
  var UnaryPostfix$$ = [UnaryPostfix$0, UnaryPostfix$1];
6134
6135
  function UnaryPostfix(ctx, state) {
6135
6136
  return $EVENT_C(ctx, state, "UnaryPostfix", UnaryPostfix$$);
@@ -6137,7 +6138,7 @@ var require_parser = __commonJS({
6137
6138
  var TypePostfix$0 = $TS($S(_, NWTypePostfix), function($skip, $loc, $0, $1, $2) {
6138
6139
  var ws = $1;
6139
6140
  var postfix = $2;
6140
- return [ws, ...postfix];
6141
+ return [ws, postfix];
6141
6142
  });
6142
6143
  function TypePostfix(ctx, state) {
6143
6144
  return $EVENT(ctx, state, "TypePostfix", TypePostfix$0);
@@ -6152,18 +6153,26 @@ var require_parser = __commonJS({
6152
6153
  return $EVENT(ctx, state, "Tuple", Tuple$0);
6153
6154
  }
6154
6155
  var NWTypePostfix$0 = $TS($S(As, _, Tuple), function($skip, $loc, $0, $1, $2, $3) {
6155
- return [{ $loc: $1.$loc, token: "satisfies" }, $2, $3];
6156
+ return {
6157
+ ts: true,
6158
+ children: [{ $loc: $1.$loc, token: "satisfies" }, $2, $3]
6159
+ };
6156
6160
  });
6157
6161
  var NWTypePostfix$1 = $TS($S(As, $E(ExclamationPoint), Type), function($skip, $loc, $0, $1, $2, $3) {
6158
6162
  var as = $1;
6159
6163
  var ex = $2;
6160
6164
  var type = $3;
6165
+ let children;
6161
6166
  if (ex) {
6162
- return [{ $loc: ex.$loc, token: "as unknown " }, as, type];
6167
+ children = [{ $loc: ex.$loc, token: "as unknown " }, as, type];
6168
+ } else {
6169
+ children = [as, type];
6163
6170
  }
6164
- return [as, type];
6171
+ return { ts: true, children };
6172
+ });
6173
+ var NWTypePostfix$2 = $TS($S(Satisfies, Type), function($skip, $loc, $0, $1, $2) {
6174
+ return { ts: true, children: $0 };
6165
6175
  });
6166
- var NWTypePostfix$2 = $S(Satisfies, Type);
6167
6176
  var NWTypePostfix$$ = [NWTypePostfix$0, NWTypePostfix$1, NWTypePostfix$2];
6168
6177
  function NWTypePostfix(ctx, state) {
6169
6178
  return $EVENT_C(ctx, state, "NWTypePostfix", NWTypePostfix$$);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@danielx/civet",
3
3
  "type": "commonjs",
4
- "version": "0.6.84",
4
+ "version": "0.6.85",
5
5
  "description": "CoffeeScript style syntax for TypeScript",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/main.mjs",