@herb-tools/rewriter 0.8.3 → 0.8.5

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
@@ -320,7 +320,7 @@ class Token {
320
320
  }
321
321
 
322
322
  // NOTE: This file is generated by the templates/template.rb script and should not
323
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/errors.ts.erb
323
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.5/templates/javascript/packages/core/src/errors.ts.erb
324
324
  class HerbError {
325
325
  type;
326
326
  message;
@@ -823,6 +823,40 @@ class MissingERBEndTagError extends HerbError {
823
823
  return output;
824
824
  }
825
825
  }
826
+ class ERBMultipleBlocksInTagError extends HerbError {
827
+ static from(data) {
828
+ return new ERBMultipleBlocksInTagError({
829
+ type: data.type,
830
+ message: data.message,
831
+ location: Location.from(data.location),
832
+ });
833
+ }
834
+ constructor(props) {
835
+ super(props.type, props.message, props.location);
836
+ }
837
+ toJSON() {
838
+ return {
839
+ ...super.toJSON(),
840
+ type: "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR",
841
+ };
842
+ }
843
+ toMonacoDiagnostic() {
844
+ return {
845
+ line: this.location.start.line,
846
+ column: this.location.start.column,
847
+ endLine: this.location.end.line,
848
+ endColumn: this.location.end.column,
849
+ message: this.message,
850
+ severity: 'error'
851
+ };
852
+ }
853
+ treeInspect() {
854
+ let output = "";
855
+ output += `@ ERBMultipleBlocksInTagError ${this.location.treeInspectWithLabel()}\n`;
856
+ output += `└── message: "${this.message}"\n`;
857
+ return output;
858
+ }
859
+ }
826
860
  function fromSerializedError(error) {
827
861
  switch (error.type) {
828
862
  case "UNEXPECTED_ERROR": return UnexpectedError.from(error);
@@ -836,6 +870,7 @@ function fromSerializedError(error) {
836
870
  case "RUBY_PARSE_ERROR": return RubyParseError.from(error);
837
871
  case "ERB_CONTROL_FLOW_SCOPE_ERROR": return ERBControlFlowScopeError.from(error);
838
872
  case "MISSINGERB_END_TAG_ERROR": return MissingERBEndTagError.from(error);
873
+ case "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR": return ERBMultipleBlocksInTagError.from(error);
839
874
  default:
840
875
  throw new Error(`Unknown node type: ${error.type}`);
841
876
  }
@@ -850,7 +885,7 @@ function convertToUTF8(string) {
850
885
  }
851
886
 
852
887
  // NOTE: This file is generated by the templates/template.rb script and should not
853
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/nodes.ts.erb
888
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.5/templates/javascript/packages/core/src/nodes.ts.erb
854
889
  class Node {
855
890
  type;
856
891
  location;
@@ -3084,7 +3119,7 @@ class ParseResult extends Result {
3084
3119
  }
3085
3120
 
3086
3121
  // NOTE: This file is generated by the templates/template.rb script and should not
3087
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/node-type-guards.ts.erb
3122
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.5/templates/javascript/packages/core/src/node-type-guards.ts.erb
3088
3123
  /**
3089
3124
  * Type guard functions for AST nodes.
3090
3125
  * These functions provide type checking by combining both instanceof
@@ -3477,7 +3512,7 @@ function getNodesAfterPosition(nodes, position, inclusive = true) {
3477
3512
  }
3478
3513
 
3479
3514
  // NOTE: This file is generated by the templates/template.rb script and should not
3480
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/visitor.ts.erb
3515
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.5/templates/javascript/packages/core/src/visitor.ts.erb
3481
3516
  class Visitor {
3482
3517
  visit(node) {
3483
3518
  if (!node)