@danielx/civet 0.5.27 → 0.5.28
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/README.md +1 -1
- package/dist/browser.js +44 -23
- package/dist/civet +8 -1
- package/dist/main.js +44 -23
- package/dist/main.mjs +44 -23
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Civet
|
|
|
6
6
|
[](https://www.npmjs.com/package/@danielx/civet)
|
|
7
7
|
[](https://discord.com/invite/xkrW9GebBc)
|
|
8
8
|
|
|
9
|
-
The
|
|
9
|
+
The modern way to write TypeScript.
|
|
10
10
|
|
|
11
11
|
- [Documentation](https://civet.dev/)
|
|
12
12
|
- [Online Civet Playground](https://civet-web.vercel.app/)
|
package/dist/browser.js
CHANGED
|
@@ -498,6 +498,7 @@ ${input.slice(result.pos)}
|
|
|
498
498
|
ParameterElement,
|
|
499
499
|
ParameterElementDelimiter,
|
|
500
500
|
BindingIdentifier,
|
|
501
|
+
NWBindingIdentifier,
|
|
501
502
|
AtIdentifierRef,
|
|
502
503
|
BindingPattern,
|
|
503
504
|
ObjectBindingPattern,
|
|
@@ -3030,7 +3031,8 @@ ${input.slice(result.pos)}
|
|
|
3030
3031
|
return {
|
|
3031
3032
|
type: "Parameters",
|
|
3032
3033
|
children: [{ $loc, token: "()" }],
|
|
3033
|
-
names: []
|
|
3034
|
+
names: [],
|
|
3035
|
+
implicit: true
|
|
3034
3036
|
};
|
|
3035
3037
|
});
|
|
3036
3038
|
function Parameters(state) {
|
|
@@ -3190,22 +3192,10 @@ ${input.slice(result.pos)}
|
|
|
3190
3192
|
return result;
|
|
3191
3193
|
}
|
|
3192
3194
|
}
|
|
3193
|
-
var BindingIdentifier$0 = $TS($S(__,
|
|
3194
|
-
var ws = $1;
|
|
3195
|
-
var ref = $3;
|
|
3196
|
-
return {
|
|
3197
|
-
type: "AtBinding",
|
|
3198
|
-
children: [...ws, ref],
|
|
3199
|
-
ref
|
|
3200
|
-
};
|
|
3201
|
-
});
|
|
3202
|
-
var BindingIdentifier$1 = $TS($S(__, Identifier), function($skip, $loc, $0, $1, $2) {
|
|
3195
|
+
var BindingIdentifier$0 = $TS($S(__, NWBindingIdentifier), function($skip, $loc, $0, $1, $2) {
|
|
3203
3196
|
var ws = $1;
|
|
3204
|
-
var
|
|
3205
|
-
return {
|
|
3206
|
-
...id,
|
|
3207
|
-
children: [...ws, ...id.children]
|
|
3208
|
-
};
|
|
3197
|
+
var identifier = $2;
|
|
3198
|
+
return { ...identifier, children: [...ws, ...identifier.children] };
|
|
3209
3199
|
});
|
|
3210
3200
|
function BindingIdentifier(state) {
|
|
3211
3201
|
if (state.events) {
|
|
@@ -3214,17 +3204,44 @@ ${input.slice(result.pos)}
|
|
|
3214
3204
|
return result.cache;
|
|
3215
3205
|
}
|
|
3216
3206
|
if (state.tokenize) {
|
|
3217
|
-
const result = $TOKEN("BindingIdentifier", state, BindingIdentifier$0(state)
|
|
3207
|
+
const result = $TOKEN("BindingIdentifier", state, BindingIdentifier$0(state));
|
|
3218
3208
|
if (state.events)
|
|
3219
3209
|
state.events.exit?.("BindingIdentifier", state, result);
|
|
3220
3210
|
return result;
|
|
3221
3211
|
} else {
|
|
3222
|
-
const result = BindingIdentifier$0(state)
|
|
3212
|
+
const result = BindingIdentifier$0(state);
|
|
3223
3213
|
if (state.events)
|
|
3224
3214
|
state.events.exit?.("BindingIdentifier", state, result);
|
|
3225
3215
|
return result;
|
|
3226
3216
|
}
|
|
3227
3217
|
}
|
|
3218
|
+
var NWBindingIdentifier$0 = $TS($S(At, AtIdentifierRef), function($skip, $loc, $0, $1, $2) {
|
|
3219
|
+
var ref = $2;
|
|
3220
|
+
return {
|
|
3221
|
+
type: "AtBinding",
|
|
3222
|
+
children: [ref],
|
|
3223
|
+
ref
|
|
3224
|
+
};
|
|
3225
|
+
});
|
|
3226
|
+
var NWBindingIdentifier$1 = Identifier;
|
|
3227
|
+
function NWBindingIdentifier(state) {
|
|
3228
|
+
if (state.events) {
|
|
3229
|
+
const result = state.events.enter?.("NWBindingIdentifier", state);
|
|
3230
|
+
if (result)
|
|
3231
|
+
return result.cache;
|
|
3232
|
+
}
|
|
3233
|
+
if (state.tokenize) {
|
|
3234
|
+
const result = $TOKEN("NWBindingIdentifier", state, NWBindingIdentifier$0(state) || NWBindingIdentifier$1(state));
|
|
3235
|
+
if (state.events)
|
|
3236
|
+
state.events.exit?.("NWBindingIdentifier", state, result);
|
|
3237
|
+
return result;
|
|
3238
|
+
} else {
|
|
3239
|
+
const result = NWBindingIdentifier$0(state) || NWBindingIdentifier$1(state);
|
|
3240
|
+
if (state.events)
|
|
3241
|
+
state.events.exit?.("NWBindingIdentifier", state, result);
|
|
3242
|
+
return result;
|
|
3243
|
+
}
|
|
3244
|
+
}
|
|
3228
3245
|
var AtIdentifierRef$0 = $TV(ReservedWord, function($skip, $loc, $0, $1) {
|
|
3229
3246
|
var r = $0;
|
|
3230
3247
|
return {
|
|
@@ -3800,18 +3817,22 @@ ${input.slice(result.pos)}
|
|
|
3800
3817
|
return result;
|
|
3801
3818
|
}
|
|
3802
3819
|
}
|
|
3803
|
-
var FunctionSignature$0 = $TS($S($E($S(Async,
|
|
3804
|
-
var
|
|
3820
|
+
var FunctionSignature$0 = $TS($S($E($S(Async, $E(_))), Function, $E($S($E(_), Star)), $E($S($E(_), NWBindingIdentifier)), $E(_), Parameters, $E(ReturnTypeSuffix)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
3821
|
+
var async = $1;
|
|
3822
|
+
var func = $2;
|
|
3823
|
+
var star = $3;
|
|
3824
|
+
var wid = $4;
|
|
3825
|
+
var w = $5;
|
|
3805
3826
|
var parameters = $6;
|
|
3806
3827
|
var suffix = $7;
|
|
3807
3828
|
return {
|
|
3808
3829
|
type: "FunctionSignature",
|
|
3809
|
-
id,
|
|
3830
|
+
id: wid?.[1],
|
|
3810
3831
|
parameters,
|
|
3811
3832
|
returnType: suffix?.children?.[1]?.[0]?.[1]?.token,
|
|
3812
3833
|
ts: false,
|
|
3813
3834
|
block: null,
|
|
3814
|
-
children: $0
|
|
3835
|
+
children: !parameters.implicit ? $0 : [async, func, star, wid, parameters, w, suffix]
|
|
3815
3836
|
};
|
|
3816
3837
|
});
|
|
3817
3838
|
function FunctionSignature(state) {
|
|
@@ -15648,7 +15669,7 @@ ${input.slice(result.pos)}
|
|
|
15648
15669
|
({ parse } = import_parser.default);
|
|
15649
15670
|
({ SourceMap: SourceMap2, base64Encode: base64Encode2 } = util_exports);
|
|
15650
15671
|
defaultOptions = {};
|
|
15651
|
-
uncacheable = /* @__PURE__ */ new Set(["TrackIndented", "Samedent", "IndentedFurther", "PushIndent", "PopIndent", "Nested", "InsertIndent", "Arguments", "ArgumentsWithTrailingCallExpressions", "ApplicationStart", "CallExpression", "CallExpressionRest", "LeftHandSideExpression", "ActualAssignment", "UpdateExpression", "UnaryExpression", "BinaryOpExpression", "BinaryOpRHS", "ConditionalExpression", "ShortCircuitExpression", "InlineObjectLiteral", "ImplicitInlineObjectPropertyDelimiter", "FatArrowBody", "ThinArrowFunction", "ArrowFunctionTail", "ArrowFunction", "ImplicitNestedBlock", "BracedBlock", "BracedOrEmptyBlock", "NestedBlockExpression", "NestedBlockExpression", "NestedBlockStatements", "SingleLineStatements", "ExpressionStatement", "Statement", "IndentedJSXChildExpression", "NestedJSXChildExpression", "ObjectLiteral", "NestedObject", "NestedImplicitObjectLiteral", "BracedObjectLiteralContent", "NestedPropertyDefinitions", "NestedImplicitPropertyDefinition", "NestedImplicitPropertyDefinitions", "NestedBlockStatement", "NestedElement", "NestedElementList", "NestedBindingElement", "NestedBindingElements", "NestedInterfaceProperty", "MemberExpression", "PrimaryExpression", "IndentedApplicationAllowed", "ExpressionWithIndentedApplicationSuppressed", "SuppressIndentedApplication", "AssignmentExpressionTail", "AssignmentExpression", "ExtendedExpression", "Expression", "MemberExpressionRest", "ElseClause", "CoffeeCommentEnabled", "SingleLineComment", "Debugger", "JSXImplicitFragment", "JSXTag", "JSXElement", "TypedJSXElement", "JSXFragment", "TypedJSXFragment", "JSXChild", "JSXChildren", "JSXNestedChildren", "JSXMixedChildren"]);
|
|
15672
|
+
uncacheable = /* @__PURE__ */ new Set(["TrackIndented", "Samedent", "IndentedFurther", "PushIndent", "PopIndent", "Nested", "InsertIndent", "Arguments", "ArgumentsWithTrailingCallExpressions", "ApplicationStart", "CallExpression", "CallExpressionRest", "LeftHandSideExpression", "ActualAssignment", "UpdateExpression", "UnaryExpression", "BinaryOpExpression", "BinaryOpRHS", "ConditionalExpression", "ShortCircuitExpression", "InlineObjectLiteral", "ImplicitInlineObjectPropertyDelimiter", "FatArrowBody", "ThinArrowFunction", "ArrowFunctionTail", "ArrowFunction", "ImplicitNestedBlock", "BracedBlock", "BracedOrEmptyBlock", "NestedBlockExpression", "NestedBlockExpression", "NestedBlockStatements", "SingleLineStatements", "ExpressionStatement", "Statement", "IndentedJSXChildExpression", "NestedJSXChildExpression", "ObjectLiteral", "NestedObject", "NestedImplicitObjectLiteral", "BracedObjectLiteralContent", "NestedPropertyDefinitions", "NestedImplicitPropertyDefinition", "NestedImplicitPropertyDefinitions", "NestedBlockStatement", "NestedElement", "NestedElementList", "NestedBindingElement", "NestedBindingElements", "NestedInterfaceProperty", "SnugNamedProperty", "MemberExpression", "PrimaryExpression", "IndentedApplicationAllowed", "ExpressionWithIndentedApplicationSuppressed", "SuppressIndentedApplication", "AssignmentExpressionTail", "AssignmentExpression", "ExtendedExpression", "Expression", "MemberExpressionRest", "ElseClause", "CoffeeCommentEnabled", "SingleLineComment", "Debugger", "JSXImplicitFragment", "JSXTag", "JSXElement", "TypedJSXElement", "JSXFragment", "TypedJSXFragment", "JSXChild", "JSXChildren", "JSXNestedChildren", "JSXMixedChildren"]);
|
|
15652
15673
|
var compile = function(src, options = defaultOptions) {
|
|
15653
15674
|
var ast, code, events, filename, sm, srcMapJSON;
|
|
15654
15675
|
filename = options.filename || "unknown";
|
package/dist/civet
CHANGED
|
@@ -137,6 +137,8 @@ readFiles = async function* (filenames, options) {
|
|
|
137
137
|
filename = await fs.realpath("/dev/stdin");
|
|
138
138
|
} catch (error1) {
|
|
139
139
|
}
|
|
140
|
+
}
|
|
141
|
+
if (filename === "<stdin>") {
|
|
140
142
|
lines = [];
|
|
141
143
|
rl = require("readline").createInterface(process.stdin, process.stdout);
|
|
142
144
|
rl.on("line", function(buffer) {
|
|
@@ -277,7 +279,7 @@ cli = async function() {
|
|
|
277
279
|
} catch (error1) {
|
|
278
280
|
stat = null;
|
|
279
281
|
}
|
|
280
|
-
if (stat != null ? stat.isDirectory() : void 0) {
|
|
282
|
+
if ((stat != null ? stat.isDirectory() : void 0) || options.output.endsWith(path.sep) || options.output.endsWith("/")) {
|
|
281
283
|
outputPath.dir = options.output;
|
|
282
284
|
} else if (/^(\.[^.]+)+$/.test(optionsPath.base)) {
|
|
283
285
|
outputPath.ext = optionsPath.base;
|
|
@@ -288,6 +290,11 @@ cli = async function() {
|
|
|
288
290
|
outputPath = optionsPath;
|
|
289
291
|
}
|
|
290
292
|
}
|
|
293
|
+
if (outputPath.dir) {
|
|
294
|
+
fs.mkdir(outputPath.dir, {
|
|
295
|
+
recursive: true
|
|
296
|
+
});
|
|
297
|
+
}
|
|
291
298
|
outputFilename = path.format(outputPath);
|
|
292
299
|
try {
|
|
293
300
|
results.push(await fs.writeFile(outputFilename, output));
|
package/dist/main.js
CHANGED
|
@@ -497,6 +497,7 @@ ${input.slice(result.pos)}
|
|
|
497
497
|
ParameterElement,
|
|
498
498
|
ParameterElementDelimiter,
|
|
499
499
|
BindingIdentifier,
|
|
500
|
+
NWBindingIdentifier,
|
|
500
501
|
AtIdentifierRef,
|
|
501
502
|
BindingPattern,
|
|
502
503
|
ObjectBindingPattern,
|
|
@@ -3029,7 +3030,8 @@ ${input.slice(result.pos)}
|
|
|
3029
3030
|
return {
|
|
3030
3031
|
type: "Parameters",
|
|
3031
3032
|
children: [{ $loc, token: "()" }],
|
|
3032
|
-
names: []
|
|
3033
|
+
names: [],
|
|
3034
|
+
implicit: true
|
|
3033
3035
|
};
|
|
3034
3036
|
});
|
|
3035
3037
|
function Parameters(state) {
|
|
@@ -3189,22 +3191,10 @@ ${input.slice(result.pos)}
|
|
|
3189
3191
|
return result;
|
|
3190
3192
|
}
|
|
3191
3193
|
}
|
|
3192
|
-
var BindingIdentifier$0 = $TS($S(__,
|
|
3193
|
-
var ws = $1;
|
|
3194
|
-
var ref = $3;
|
|
3195
|
-
return {
|
|
3196
|
-
type: "AtBinding",
|
|
3197
|
-
children: [...ws, ref],
|
|
3198
|
-
ref
|
|
3199
|
-
};
|
|
3200
|
-
});
|
|
3201
|
-
var BindingIdentifier$1 = $TS($S(__, Identifier), function($skip, $loc, $0, $1, $2) {
|
|
3194
|
+
var BindingIdentifier$0 = $TS($S(__, NWBindingIdentifier), function($skip, $loc, $0, $1, $2) {
|
|
3202
3195
|
var ws = $1;
|
|
3203
|
-
var
|
|
3204
|
-
return {
|
|
3205
|
-
...id,
|
|
3206
|
-
children: [...ws, ...id.children]
|
|
3207
|
-
};
|
|
3196
|
+
var identifier = $2;
|
|
3197
|
+
return { ...identifier, children: [...ws, ...identifier.children] };
|
|
3208
3198
|
});
|
|
3209
3199
|
function BindingIdentifier(state) {
|
|
3210
3200
|
if (state.events) {
|
|
@@ -3213,17 +3203,44 @@ ${input.slice(result.pos)}
|
|
|
3213
3203
|
return result.cache;
|
|
3214
3204
|
}
|
|
3215
3205
|
if (state.tokenize) {
|
|
3216
|
-
const result = $TOKEN("BindingIdentifier", state, BindingIdentifier$0(state)
|
|
3206
|
+
const result = $TOKEN("BindingIdentifier", state, BindingIdentifier$0(state));
|
|
3217
3207
|
if (state.events)
|
|
3218
3208
|
state.events.exit?.("BindingIdentifier", state, result);
|
|
3219
3209
|
return result;
|
|
3220
3210
|
} else {
|
|
3221
|
-
const result = BindingIdentifier$0(state)
|
|
3211
|
+
const result = BindingIdentifier$0(state);
|
|
3222
3212
|
if (state.events)
|
|
3223
3213
|
state.events.exit?.("BindingIdentifier", state, result);
|
|
3224
3214
|
return result;
|
|
3225
3215
|
}
|
|
3226
3216
|
}
|
|
3217
|
+
var NWBindingIdentifier$0 = $TS($S(At, AtIdentifierRef), function($skip, $loc, $0, $1, $2) {
|
|
3218
|
+
var ref = $2;
|
|
3219
|
+
return {
|
|
3220
|
+
type: "AtBinding",
|
|
3221
|
+
children: [ref],
|
|
3222
|
+
ref
|
|
3223
|
+
};
|
|
3224
|
+
});
|
|
3225
|
+
var NWBindingIdentifier$1 = Identifier;
|
|
3226
|
+
function NWBindingIdentifier(state) {
|
|
3227
|
+
if (state.events) {
|
|
3228
|
+
const result = state.events.enter?.("NWBindingIdentifier", state);
|
|
3229
|
+
if (result)
|
|
3230
|
+
return result.cache;
|
|
3231
|
+
}
|
|
3232
|
+
if (state.tokenize) {
|
|
3233
|
+
const result = $TOKEN("NWBindingIdentifier", state, NWBindingIdentifier$0(state) || NWBindingIdentifier$1(state));
|
|
3234
|
+
if (state.events)
|
|
3235
|
+
state.events.exit?.("NWBindingIdentifier", state, result);
|
|
3236
|
+
return result;
|
|
3237
|
+
} else {
|
|
3238
|
+
const result = NWBindingIdentifier$0(state) || NWBindingIdentifier$1(state);
|
|
3239
|
+
if (state.events)
|
|
3240
|
+
state.events.exit?.("NWBindingIdentifier", state, result);
|
|
3241
|
+
return result;
|
|
3242
|
+
}
|
|
3243
|
+
}
|
|
3227
3244
|
var AtIdentifierRef$0 = $TV(ReservedWord, function($skip, $loc, $0, $1) {
|
|
3228
3245
|
var r = $0;
|
|
3229
3246
|
return {
|
|
@@ -3799,18 +3816,22 @@ ${input.slice(result.pos)}
|
|
|
3799
3816
|
return result;
|
|
3800
3817
|
}
|
|
3801
3818
|
}
|
|
3802
|
-
var FunctionSignature$0 = $TS($S($E($S(Async,
|
|
3803
|
-
var
|
|
3819
|
+
var FunctionSignature$0 = $TS($S($E($S(Async, $E(_))), Function, $E($S($E(_), Star)), $E($S($E(_), NWBindingIdentifier)), $E(_), Parameters, $E(ReturnTypeSuffix)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
3820
|
+
var async = $1;
|
|
3821
|
+
var func = $2;
|
|
3822
|
+
var star = $3;
|
|
3823
|
+
var wid = $4;
|
|
3824
|
+
var w = $5;
|
|
3804
3825
|
var parameters = $6;
|
|
3805
3826
|
var suffix = $7;
|
|
3806
3827
|
return {
|
|
3807
3828
|
type: "FunctionSignature",
|
|
3808
|
-
id,
|
|
3829
|
+
id: wid?.[1],
|
|
3809
3830
|
parameters,
|
|
3810
3831
|
returnType: suffix?.children?.[1]?.[0]?.[1]?.token,
|
|
3811
3832
|
ts: false,
|
|
3812
3833
|
block: null,
|
|
3813
|
-
children: $0
|
|
3834
|
+
children: !parameters.implicit ? $0 : [async, func, star, wid, parameters, w, suffix]
|
|
3814
3835
|
};
|
|
3815
3836
|
});
|
|
3816
3837
|
function FunctionSignature(state) {
|
|
@@ -15648,7 +15669,7 @@ var uncacheable;
|
|
|
15648
15669
|
({ parse } = import_parser.default);
|
|
15649
15670
|
({ SourceMap: SourceMap2, base64Encode: base64Encode2 } = util_exports);
|
|
15650
15671
|
defaultOptions = {};
|
|
15651
|
-
uncacheable = /* @__PURE__ */ new Set(["TrackIndented", "Samedent", "IndentedFurther", "PushIndent", "PopIndent", "Nested", "InsertIndent", "Arguments", "ArgumentsWithTrailingCallExpressions", "ApplicationStart", "CallExpression", "CallExpressionRest", "LeftHandSideExpression", "ActualAssignment", "UpdateExpression", "UnaryExpression", "BinaryOpExpression", "BinaryOpRHS", "ConditionalExpression", "ShortCircuitExpression", "InlineObjectLiteral", "ImplicitInlineObjectPropertyDelimiter", "FatArrowBody", "ThinArrowFunction", "ArrowFunctionTail", "ArrowFunction", "ImplicitNestedBlock", "BracedBlock", "BracedOrEmptyBlock", "NestedBlockExpression", "NestedBlockExpression", "NestedBlockStatements", "SingleLineStatements", "ExpressionStatement", "Statement", "IndentedJSXChildExpression", "NestedJSXChildExpression", "ObjectLiteral", "NestedObject", "NestedImplicitObjectLiteral", "BracedObjectLiteralContent", "NestedPropertyDefinitions", "NestedImplicitPropertyDefinition", "NestedImplicitPropertyDefinitions", "NestedBlockStatement", "NestedElement", "NestedElementList", "NestedBindingElement", "NestedBindingElements", "NestedInterfaceProperty", "MemberExpression", "PrimaryExpression", "IndentedApplicationAllowed", "ExpressionWithIndentedApplicationSuppressed", "SuppressIndentedApplication", "AssignmentExpressionTail", "AssignmentExpression", "ExtendedExpression", "Expression", "MemberExpressionRest", "ElseClause", "CoffeeCommentEnabled", "SingleLineComment", "Debugger", "JSXImplicitFragment", "JSXTag", "JSXElement", "TypedJSXElement", "JSXFragment", "TypedJSXFragment", "JSXChild", "JSXChildren", "JSXNestedChildren", "JSXMixedChildren"]);
|
|
15672
|
+
uncacheable = /* @__PURE__ */ new Set(["TrackIndented", "Samedent", "IndentedFurther", "PushIndent", "PopIndent", "Nested", "InsertIndent", "Arguments", "ArgumentsWithTrailingCallExpressions", "ApplicationStart", "CallExpression", "CallExpressionRest", "LeftHandSideExpression", "ActualAssignment", "UpdateExpression", "UnaryExpression", "BinaryOpExpression", "BinaryOpRHS", "ConditionalExpression", "ShortCircuitExpression", "InlineObjectLiteral", "ImplicitInlineObjectPropertyDelimiter", "FatArrowBody", "ThinArrowFunction", "ArrowFunctionTail", "ArrowFunction", "ImplicitNestedBlock", "BracedBlock", "BracedOrEmptyBlock", "NestedBlockExpression", "NestedBlockExpression", "NestedBlockStatements", "SingleLineStatements", "ExpressionStatement", "Statement", "IndentedJSXChildExpression", "NestedJSXChildExpression", "ObjectLiteral", "NestedObject", "NestedImplicitObjectLiteral", "BracedObjectLiteralContent", "NestedPropertyDefinitions", "NestedImplicitPropertyDefinition", "NestedImplicitPropertyDefinitions", "NestedBlockStatement", "NestedElement", "NestedElementList", "NestedBindingElement", "NestedBindingElements", "NestedInterfaceProperty", "SnugNamedProperty", "MemberExpression", "PrimaryExpression", "IndentedApplicationAllowed", "ExpressionWithIndentedApplicationSuppressed", "SuppressIndentedApplication", "AssignmentExpressionTail", "AssignmentExpression", "ExtendedExpression", "Expression", "MemberExpressionRest", "ElseClause", "CoffeeCommentEnabled", "SingleLineComment", "Debugger", "JSXImplicitFragment", "JSXTag", "JSXElement", "TypedJSXElement", "JSXFragment", "TypedJSXFragment", "JSXChild", "JSXChildren", "JSXNestedChildren", "JSXMixedChildren"]);
|
|
15652
15673
|
var compile = function(src, options = defaultOptions) {
|
|
15653
15674
|
var ast, code, events, filename, sm, srcMapJSON;
|
|
15654
15675
|
filename = options.filename || "unknown";
|
package/dist/main.mjs
CHANGED
|
@@ -495,6 +495,7 @@ ${input.slice(result.pos)}
|
|
|
495
495
|
ParameterElement,
|
|
496
496
|
ParameterElementDelimiter,
|
|
497
497
|
BindingIdentifier,
|
|
498
|
+
NWBindingIdentifier,
|
|
498
499
|
AtIdentifierRef,
|
|
499
500
|
BindingPattern,
|
|
500
501
|
ObjectBindingPattern,
|
|
@@ -3027,7 +3028,8 @@ ${input.slice(result.pos)}
|
|
|
3027
3028
|
return {
|
|
3028
3029
|
type: "Parameters",
|
|
3029
3030
|
children: [{ $loc, token: "()" }],
|
|
3030
|
-
names: []
|
|
3031
|
+
names: [],
|
|
3032
|
+
implicit: true
|
|
3031
3033
|
};
|
|
3032
3034
|
});
|
|
3033
3035
|
function Parameters(state) {
|
|
@@ -3187,22 +3189,10 @@ ${input.slice(result.pos)}
|
|
|
3187
3189
|
return result;
|
|
3188
3190
|
}
|
|
3189
3191
|
}
|
|
3190
|
-
var BindingIdentifier$0 = $TS($S(__,
|
|
3191
|
-
var ws = $1;
|
|
3192
|
-
var ref = $3;
|
|
3193
|
-
return {
|
|
3194
|
-
type: "AtBinding",
|
|
3195
|
-
children: [...ws, ref],
|
|
3196
|
-
ref
|
|
3197
|
-
};
|
|
3198
|
-
});
|
|
3199
|
-
var BindingIdentifier$1 = $TS($S(__, Identifier), function($skip, $loc, $0, $1, $2) {
|
|
3192
|
+
var BindingIdentifier$0 = $TS($S(__, NWBindingIdentifier), function($skip, $loc, $0, $1, $2) {
|
|
3200
3193
|
var ws = $1;
|
|
3201
|
-
var
|
|
3202
|
-
return {
|
|
3203
|
-
...id,
|
|
3204
|
-
children: [...ws, ...id.children]
|
|
3205
|
-
};
|
|
3194
|
+
var identifier = $2;
|
|
3195
|
+
return { ...identifier, children: [...ws, ...identifier.children] };
|
|
3206
3196
|
});
|
|
3207
3197
|
function BindingIdentifier(state) {
|
|
3208
3198
|
if (state.events) {
|
|
@@ -3211,17 +3201,44 @@ ${input.slice(result.pos)}
|
|
|
3211
3201
|
return result.cache;
|
|
3212
3202
|
}
|
|
3213
3203
|
if (state.tokenize) {
|
|
3214
|
-
const result = $TOKEN("BindingIdentifier", state, BindingIdentifier$0(state)
|
|
3204
|
+
const result = $TOKEN("BindingIdentifier", state, BindingIdentifier$0(state));
|
|
3215
3205
|
if (state.events)
|
|
3216
3206
|
state.events.exit?.("BindingIdentifier", state, result);
|
|
3217
3207
|
return result;
|
|
3218
3208
|
} else {
|
|
3219
|
-
const result = BindingIdentifier$0(state)
|
|
3209
|
+
const result = BindingIdentifier$0(state);
|
|
3220
3210
|
if (state.events)
|
|
3221
3211
|
state.events.exit?.("BindingIdentifier", state, result);
|
|
3222
3212
|
return result;
|
|
3223
3213
|
}
|
|
3224
3214
|
}
|
|
3215
|
+
var NWBindingIdentifier$0 = $TS($S(At, AtIdentifierRef), function($skip, $loc, $0, $1, $2) {
|
|
3216
|
+
var ref = $2;
|
|
3217
|
+
return {
|
|
3218
|
+
type: "AtBinding",
|
|
3219
|
+
children: [ref],
|
|
3220
|
+
ref
|
|
3221
|
+
};
|
|
3222
|
+
});
|
|
3223
|
+
var NWBindingIdentifier$1 = Identifier;
|
|
3224
|
+
function NWBindingIdentifier(state) {
|
|
3225
|
+
if (state.events) {
|
|
3226
|
+
const result = state.events.enter?.("NWBindingIdentifier", state);
|
|
3227
|
+
if (result)
|
|
3228
|
+
return result.cache;
|
|
3229
|
+
}
|
|
3230
|
+
if (state.tokenize) {
|
|
3231
|
+
const result = $TOKEN("NWBindingIdentifier", state, NWBindingIdentifier$0(state) || NWBindingIdentifier$1(state));
|
|
3232
|
+
if (state.events)
|
|
3233
|
+
state.events.exit?.("NWBindingIdentifier", state, result);
|
|
3234
|
+
return result;
|
|
3235
|
+
} else {
|
|
3236
|
+
const result = NWBindingIdentifier$0(state) || NWBindingIdentifier$1(state);
|
|
3237
|
+
if (state.events)
|
|
3238
|
+
state.events.exit?.("NWBindingIdentifier", state, result);
|
|
3239
|
+
return result;
|
|
3240
|
+
}
|
|
3241
|
+
}
|
|
3225
3242
|
var AtIdentifierRef$0 = $TV(ReservedWord, function($skip, $loc, $0, $1) {
|
|
3226
3243
|
var r = $0;
|
|
3227
3244
|
return {
|
|
@@ -3797,18 +3814,22 @@ ${input.slice(result.pos)}
|
|
|
3797
3814
|
return result;
|
|
3798
3815
|
}
|
|
3799
3816
|
}
|
|
3800
|
-
var FunctionSignature$0 = $TS($S($E($S(Async,
|
|
3801
|
-
var
|
|
3817
|
+
var FunctionSignature$0 = $TS($S($E($S(Async, $E(_))), Function, $E($S($E(_), Star)), $E($S($E(_), NWBindingIdentifier)), $E(_), Parameters, $E(ReturnTypeSuffix)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
3818
|
+
var async = $1;
|
|
3819
|
+
var func = $2;
|
|
3820
|
+
var star = $3;
|
|
3821
|
+
var wid = $4;
|
|
3822
|
+
var w = $5;
|
|
3802
3823
|
var parameters = $6;
|
|
3803
3824
|
var suffix = $7;
|
|
3804
3825
|
return {
|
|
3805
3826
|
type: "FunctionSignature",
|
|
3806
|
-
id,
|
|
3827
|
+
id: wid?.[1],
|
|
3807
3828
|
parameters,
|
|
3808
3829
|
returnType: suffix?.children?.[1]?.[0]?.[1]?.token,
|
|
3809
3830
|
ts: false,
|
|
3810
3831
|
block: null,
|
|
3811
|
-
children: $0
|
|
3832
|
+
children: !parameters.implicit ? $0 : [async, func, star, wid, parameters, w, suffix]
|
|
3812
3833
|
};
|
|
3813
3834
|
});
|
|
3814
3835
|
function FunctionSignature(state) {
|
|
@@ -15637,7 +15658,7 @@ var uncacheable;
|
|
|
15637
15658
|
({ parse } = import_parser.default);
|
|
15638
15659
|
({ SourceMap: SourceMap2, base64Encode: base64Encode2 } = util_exports);
|
|
15639
15660
|
defaultOptions = {};
|
|
15640
|
-
uncacheable = /* @__PURE__ */ new Set(["TrackIndented", "Samedent", "IndentedFurther", "PushIndent", "PopIndent", "Nested", "InsertIndent", "Arguments", "ArgumentsWithTrailingCallExpressions", "ApplicationStart", "CallExpression", "CallExpressionRest", "LeftHandSideExpression", "ActualAssignment", "UpdateExpression", "UnaryExpression", "BinaryOpExpression", "BinaryOpRHS", "ConditionalExpression", "ShortCircuitExpression", "InlineObjectLiteral", "ImplicitInlineObjectPropertyDelimiter", "FatArrowBody", "ThinArrowFunction", "ArrowFunctionTail", "ArrowFunction", "ImplicitNestedBlock", "BracedBlock", "BracedOrEmptyBlock", "NestedBlockExpression", "NestedBlockExpression", "NestedBlockStatements", "SingleLineStatements", "ExpressionStatement", "Statement", "IndentedJSXChildExpression", "NestedJSXChildExpression", "ObjectLiteral", "NestedObject", "NestedImplicitObjectLiteral", "BracedObjectLiteralContent", "NestedPropertyDefinitions", "NestedImplicitPropertyDefinition", "NestedImplicitPropertyDefinitions", "NestedBlockStatement", "NestedElement", "NestedElementList", "NestedBindingElement", "NestedBindingElements", "NestedInterfaceProperty", "MemberExpression", "PrimaryExpression", "IndentedApplicationAllowed", "ExpressionWithIndentedApplicationSuppressed", "SuppressIndentedApplication", "AssignmentExpressionTail", "AssignmentExpression", "ExtendedExpression", "Expression", "MemberExpressionRest", "ElseClause", "CoffeeCommentEnabled", "SingleLineComment", "Debugger", "JSXImplicitFragment", "JSXTag", "JSXElement", "TypedJSXElement", "JSXFragment", "TypedJSXFragment", "JSXChild", "JSXChildren", "JSXNestedChildren", "JSXMixedChildren"]);
|
|
15661
|
+
uncacheable = /* @__PURE__ */ new Set(["TrackIndented", "Samedent", "IndentedFurther", "PushIndent", "PopIndent", "Nested", "InsertIndent", "Arguments", "ArgumentsWithTrailingCallExpressions", "ApplicationStart", "CallExpression", "CallExpressionRest", "LeftHandSideExpression", "ActualAssignment", "UpdateExpression", "UnaryExpression", "BinaryOpExpression", "BinaryOpRHS", "ConditionalExpression", "ShortCircuitExpression", "InlineObjectLiteral", "ImplicitInlineObjectPropertyDelimiter", "FatArrowBody", "ThinArrowFunction", "ArrowFunctionTail", "ArrowFunction", "ImplicitNestedBlock", "BracedBlock", "BracedOrEmptyBlock", "NestedBlockExpression", "NestedBlockExpression", "NestedBlockStatements", "SingleLineStatements", "ExpressionStatement", "Statement", "IndentedJSXChildExpression", "NestedJSXChildExpression", "ObjectLiteral", "NestedObject", "NestedImplicitObjectLiteral", "BracedObjectLiteralContent", "NestedPropertyDefinitions", "NestedImplicitPropertyDefinition", "NestedImplicitPropertyDefinitions", "NestedBlockStatement", "NestedElement", "NestedElementList", "NestedBindingElement", "NestedBindingElements", "NestedInterfaceProperty", "SnugNamedProperty", "MemberExpression", "PrimaryExpression", "IndentedApplicationAllowed", "ExpressionWithIndentedApplicationSuppressed", "SuppressIndentedApplication", "AssignmentExpressionTail", "AssignmentExpression", "ExtendedExpression", "Expression", "MemberExpressionRest", "ElseClause", "CoffeeCommentEnabled", "SingleLineComment", "Debugger", "JSXImplicitFragment", "JSXTag", "JSXElement", "TypedJSXElement", "JSXFragment", "TypedJSXFragment", "JSXChild", "JSXChildren", "JSXNestedChildren", "JSXMixedChildren"]);
|
|
15641
15662
|
var compile = function(src, options = defaultOptions) {
|
|
15642
15663
|
var ast, code, events, filename, sm, srcMapJSON;
|
|
15643
15664
|
filename = options.filename || "unknown";
|