@herb-tools/rewriter 0.10.1 → 0.10.2
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.cjs +53 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +53 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/loader.cjs +53 -5
- package/dist/loader.cjs.map +1 -1
- package/dist/loader.esm.js +53 -5
- package/dist/loader.esm.js.map +1 -1
- package/package.json +4 -4
package/dist/loader.esm.js
CHANGED
|
@@ -18495,7 +18495,7 @@ function deserialize(source, array) {
|
|
|
18495
18495
|
}
|
|
18496
18496
|
|
|
18497
18497
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
18498
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.
|
|
18498
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.2/templates/javascript/packages/core/src/action-view-helpers.ts.erb
|
|
18499
18499
|
var HelperType;
|
|
18500
18500
|
(function (HelperType) {
|
|
18501
18501
|
HelperType["ActionCableMetaTag"] = "action_cable_meta_tag";
|
|
@@ -21019,7 +21019,7 @@ class Token {
|
|
|
21019
21019
|
}
|
|
21020
21020
|
|
|
21021
21021
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
21022
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.
|
|
21022
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.2/templates/javascript/packages/core/src/errors.ts.erb
|
|
21023
21023
|
class HerbError {
|
|
21024
21024
|
type;
|
|
21025
21025
|
message;
|
|
@@ -22571,6 +22571,45 @@ class DotNotationCasingError extends HerbError {
|
|
|
22571
22571
|
return output;
|
|
22572
22572
|
}
|
|
22573
22573
|
}
|
|
22574
|
+
class TimeoutError extends HerbError {
|
|
22575
|
+
timeout_ms;
|
|
22576
|
+
static from(data) {
|
|
22577
|
+
return new TimeoutError({
|
|
22578
|
+
type: data.type,
|
|
22579
|
+
message: data.message,
|
|
22580
|
+
location: Location.from(data.location),
|
|
22581
|
+
timeout_ms: data.timeout_ms,
|
|
22582
|
+
});
|
|
22583
|
+
}
|
|
22584
|
+
constructor(props) {
|
|
22585
|
+
super(props.type, props.message, props.location);
|
|
22586
|
+
this.timeout_ms = props.timeout_ms;
|
|
22587
|
+
}
|
|
22588
|
+
toJSON() {
|
|
22589
|
+
return {
|
|
22590
|
+
...super.toJSON(),
|
|
22591
|
+
type: "TIMEOUT_ERROR",
|
|
22592
|
+
timeout_ms: this.timeout_ms,
|
|
22593
|
+
};
|
|
22594
|
+
}
|
|
22595
|
+
toMonacoDiagnostic() {
|
|
22596
|
+
return {
|
|
22597
|
+
line: this.location.start.line,
|
|
22598
|
+
column: this.location.start.column,
|
|
22599
|
+
endLine: this.location.end.line,
|
|
22600
|
+
endColumn: this.location.end.column,
|
|
22601
|
+
message: this.message,
|
|
22602
|
+
severity: 'error'
|
|
22603
|
+
};
|
|
22604
|
+
}
|
|
22605
|
+
treeInspect() {
|
|
22606
|
+
let output = "";
|
|
22607
|
+
output += `@ TimeoutError ${this.location.treeInspectWithLabel()}\n`;
|
|
22608
|
+
output += `├── message: "${this.message}"\n`;
|
|
22609
|
+
output += `└── timeout_ms: ${JSON.stringify(this.timeout_ms)}\n`;
|
|
22610
|
+
return output;
|
|
22611
|
+
}
|
|
22612
|
+
}
|
|
22574
22613
|
function fromSerializedError(error) {
|
|
22575
22614
|
switch (error.type) {
|
|
22576
22615
|
case "UNEXPECTED_ERROR": return UnexpectedError.from(error);
|
|
@@ -22610,6 +22649,7 @@ function fromSerializedError(error) {
|
|
|
22610
22649
|
case "STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR": return StrictLocalsDuplicateDeclarationError.from(error);
|
|
22611
22650
|
case "VOID_ELEMENT_CONTENT_ERROR": return VoidElementContentError.from(error);
|
|
22612
22651
|
case "DOT_NOTATION_CASING_ERROR": return DotNotationCasingError.from(error);
|
|
22652
|
+
case "TIMEOUT_ERROR": return TimeoutError.from(error);
|
|
22613
22653
|
default:
|
|
22614
22654
|
throw new Error(`Unknown node type: ${error.type}`);
|
|
22615
22655
|
}
|
|
@@ -22762,7 +22802,7 @@ function deserializePrismNode(bytes, source) {
|
|
|
22762
22802
|
}
|
|
22763
22803
|
|
|
22764
22804
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
22765
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.
|
|
22805
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.2/templates/javascript/packages/core/src/nodes.ts.erb
|
|
22766
22806
|
class Node {
|
|
22767
22807
|
type;
|
|
22768
22808
|
location;
|
|
@@ -26142,6 +26182,8 @@ const DEFAULT_PARSER_OPTIONS = {
|
|
|
26142
26182
|
prism_program: false,
|
|
26143
26183
|
dot_notation_tags: false,
|
|
26144
26184
|
html: true,
|
|
26185
|
+
timeout: 1000,
|
|
26186
|
+
max_errors: 25,
|
|
26145
26187
|
};
|
|
26146
26188
|
/**
|
|
26147
26189
|
* Represents the parser options used during parsing.
|
|
@@ -26171,6 +26213,10 @@ class ParserOptions {
|
|
|
26171
26213
|
dot_notation_tags;
|
|
26172
26214
|
/** Whether HTML tag parsing is enabled during parsing. When false, HTML-like content is treated as literal text. */
|
|
26173
26215
|
html;
|
|
26216
|
+
/** Parse timeout in milliseconds. 0 disables the timeout. */
|
|
26217
|
+
timeout;
|
|
26218
|
+
/** Maximum number of errors to report. null means unlimited. */
|
|
26219
|
+
max_errors;
|
|
26174
26220
|
static from(options) {
|
|
26175
26221
|
return new ParserOptions(options);
|
|
26176
26222
|
}
|
|
@@ -26187,6 +26233,8 @@ class ParserOptions {
|
|
|
26187
26233
|
this.prism_program = options.prism_program ?? DEFAULT_PARSER_OPTIONS.prism_program;
|
|
26188
26234
|
this.dot_notation_tags = options.dot_notation_tags ?? DEFAULT_PARSER_OPTIONS.dot_notation_tags;
|
|
26189
26235
|
this.html = options.html ?? DEFAULT_PARSER_OPTIONS.html;
|
|
26236
|
+
this.timeout = options.timeout ?? DEFAULT_PARSER_OPTIONS.timeout;
|
|
26237
|
+
this.max_errors = options.max_errors ?? DEFAULT_PARSER_OPTIONS.max_errors;
|
|
26190
26238
|
}
|
|
26191
26239
|
}
|
|
26192
26240
|
|
|
@@ -26263,7 +26311,7 @@ class ParseResult extends Result {
|
|
|
26263
26311
|
}
|
|
26264
26312
|
|
|
26265
26313
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
26266
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.
|
|
26314
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.2/templates/javascript/packages/core/src/node-type-guards.ts.erb
|
|
26267
26315
|
/**
|
|
26268
26316
|
* Type guard functions for AST nodes.
|
|
26269
26317
|
* These functions provide type checking by combining both instanceof
|
|
@@ -27059,7 +27107,7 @@ function createERBOutputNode(expression, tagOpening = "<%=", tagClosing = "%>")
|
|
|
27059
27107
|
}
|
|
27060
27108
|
|
|
27061
27109
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
27062
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.
|
|
27110
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.2/templates/javascript/packages/core/src/visitor.ts.erb
|
|
27063
27111
|
class Visitor {
|
|
27064
27112
|
visit(node) {
|
|
27065
27113
|
if (!node)
|