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