@herb-tools/rewriter 0.10.0 → 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/index.esm.js
CHANGED
|
@@ -48,7 +48,7 @@ class ASTRewriter {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
51
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.
|
|
51
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.2/templates/javascript/packages/core/src/action-view-helpers.ts.erb
|
|
52
52
|
var HelperType;
|
|
53
53
|
(function (HelperType) {
|
|
54
54
|
HelperType["ActionCableMetaTag"] = "action_cable_meta_tag";
|
|
@@ -2572,7 +2572,7 @@ class Token {
|
|
|
2572
2572
|
}
|
|
2573
2573
|
|
|
2574
2574
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2575
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.
|
|
2575
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.2/templates/javascript/packages/core/src/errors.ts.erb
|
|
2576
2576
|
class HerbError {
|
|
2577
2577
|
type;
|
|
2578
2578
|
message;
|
|
@@ -4124,6 +4124,45 @@ class DotNotationCasingError extends HerbError {
|
|
|
4124
4124
|
return output;
|
|
4125
4125
|
}
|
|
4126
4126
|
}
|
|
4127
|
+
class TimeoutError extends HerbError {
|
|
4128
|
+
timeout_ms;
|
|
4129
|
+
static from(data) {
|
|
4130
|
+
return new TimeoutError({
|
|
4131
|
+
type: data.type,
|
|
4132
|
+
message: data.message,
|
|
4133
|
+
location: Location.from(data.location),
|
|
4134
|
+
timeout_ms: data.timeout_ms,
|
|
4135
|
+
});
|
|
4136
|
+
}
|
|
4137
|
+
constructor(props) {
|
|
4138
|
+
super(props.type, props.message, props.location);
|
|
4139
|
+
this.timeout_ms = props.timeout_ms;
|
|
4140
|
+
}
|
|
4141
|
+
toJSON() {
|
|
4142
|
+
return {
|
|
4143
|
+
...super.toJSON(),
|
|
4144
|
+
type: "TIMEOUT_ERROR",
|
|
4145
|
+
timeout_ms: this.timeout_ms,
|
|
4146
|
+
};
|
|
4147
|
+
}
|
|
4148
|
+
toMonacoDiagnostic() {
|
|
4149
|
+
return {
|
|
4150
|
+
line: this.location.start.line,
|
|
4151
|
+
column: this.location.start.column,
|
|
4152
|
+
endLine: this.location.end.line,
|
|
4153
|
+
endColumn: this.location.end.column,
|
|
4154
|
+
message: this.message,
|
|
4155
|
+
severity: 'error'
|
|
4156
|
+
};
|
|
4157
|
+
}
|
|
4158
|
+
treeInspect() {
|
|
4159
|
+
let output = "";
|
|
4160
|
+
output += `@ TimeoutError ${this.location.treeInspectWithLabel()}\n`;
|
|
4161
|
+
output += `├── message: "${this.message}"\n`;
|
|
4162
|
+
output += `└── timeout_ms: ${JSON.stringify(this.timeout_ms)}\n`;
|
|
4163
|
+
return output;
|
|
4164
|
+
}
|
|
4165
|
+
}
|
|
4127
4166
|
function fromSerializedError(error) {
|
|
4128
4167
|
switch (error.type) {
|
|
4129
4168
|
case "UNEXPECTED_ERROR": return UnexpectedError.from(error);
|
|
@@ -4163,6 +4202,7 @@ function fromSerializedError(error) {
|
|
|
4163
4202
|
case "STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR": return StrictLocalsDuplicateDeclarationError.from(error);
|
|
4164
4203
|
case "VOID_ELEMENT_CONTENT_ERROR": return VoidElementContentError.from(error);
|
|
4165
4204
|
case "DOT_NOTATION_CASING_ERROR": return DotNotationCasingError.from(error);
|
|
4205
|
+
case "TIMEOUT_ERROR": return TimeoutError.from(error);
|
|
4166
4206
|
default:
|
|
4167
4207
|
throw new Error(`Unknown node type: ${error.type}`);
|
|
4168
4208
|
}
|
|
@@ -4315,7 +4355,7 @@ function deserializePrismNode(bytes, source) {
|
|
|
4315
4355
|
}
|
|
4316
4356
|
|
|
4317
4357
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
4318
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.
|
|
4358
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.2/templates/javascript/packages/core/src/nodes.ts.erb
|
|
4319
4359
|
class Node {
|
|
4320
4360
|
type;
|
|
4321
4361
|
location;
|
|
@@ -7695,6 +7735,8 @@ const DEFAULT_PARSER_OPTIONS = {
|
|
|
7695
7735
|
prism_program: false,
|
|
7696
7736
|
dot_notation_tags: false,
|
|
7697
7737
|
html: true,
|
|
7738
|
+
timeout: 1000,
|
|
7739
|
+
max_errors: 25,
|
|
7698
7740
|
};
|
|
7699
7741
|
/**
|
|
7700
7742
|
* Represents the parser options used during parsing.
|
|
@@ -7724,6 +7766,10 @@ class ParserOptions {
|
|
|
7724
7766
|
dot_notation_tags;
|
|
7725
7767
|
/** Whether HTML tag parsing is enabled during parsing. When false, HTML-like content is treated as literal text. */
|
|
7726
7768
|
html;
|
|
7769
|
+
/** Parse timeout in milliseconds. 0 disables the timeout. */
|
|
7770
|
+
timeout;
|
|
7771
|
+
/** Maximum number of errors to report. null means unlimited. */
|
|
7772
|
+
max_errors;
|
|
7727
7773
|
static from(options) {
|
|
7728
7774
|
return new ParserOptions(options);
|
|
7729
7775
|
}
|
|
@@ -7740,6 +7786,8 @@ class ParserOptions {
|
|
|
7740
7786
|
this.prism_program = options.prism_program ?? DEFAULT_PARSER_OPTIONS.prism_program;
|
|
7741
7787
|
this.dot_notation_tags = options.dot_notation_tags ?? DEFAULT_PARSER_OPTIONS.dot_notation_tags;
|
|
7742
7788
|
this.html = options.html ?? DEFAULT_PARSER_OPTIONS.html;
|
|
7789
|
+
this.timeout = options.timeout ?? DEFAULT_PARSER_OPTIONS.timeout;
|
|
7790
|
+
this.max_errors = options.max_errors ?? DEFAULT_PARSER_OPTIONS.max_errors;
|
|
7743
7791
|
}
|
|
7744
7792
|
}
|
|
7745
7793
|
|
|
@@ -7816,7 +7864,7 @@ class ParseResult extends Result {
|
|
|
7816
7864
|
}
|
|
7817
7865
|
|
|
7818
7866
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
7819
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.
|
|
7867
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.2/templates/javascript/packages/core/src/node-type-guards.ts.erb
|
|
7820
7868
|
/**
|
|
7821
7869
|
* Type guard functions for AST nodes.
|
|
7822
7870
|
* These functions provide type checking by combining both instanceof
|
|
@@ -8507,7 +8555,7 @@ function createERBOutputNode(expression, tagOpening = "<%=", tagClosing = "%>")
|
|
|
8507
8555
|
}
|
|
8508
8556
|
|
|
8509
8557
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
8510
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.
|
|
8558
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.10.2/templates/javascript/packages/core/src/visitor.ts.erb
|
|
8511
8559
|
class Visitor {
|
|
8512
8560
|
visit(node) {
|
|
8513
8561
|
if (!node)
|