@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.
@@ -299,7 +299,7 @@ class Token {
299
299
  }
300
300
 
301
301
  // NOTE: This file is generated by the templates/template.rb script and should not
302
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/errors.ts.erb
302
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.5/templates/javascript/packages/core/src/errors.ts.erb
303
303
  class HerbError {
304
304
  type;
305
305
  message;
@@ -802,6 +802,40 @@ class MissingERBEndTagError extends HerbError {
802
802
  return output;
803
803
  }
804
804
  }
805
+ class ERBMultipleBlocksInTagError extends HerbError {
806
+ static from(data) {
807
+ return new ERBMultipleBlocksInTagError({
808
+ type: data.type,
809
+ message: data.message,
810
+ location: Location.from(data.location),
811
+ });
812
+ }
813
+ constructor(props) {
814
+ super(props.type, props.message, props.location);
815
+ }
816
+ toJSON() {
817
+ return {
818
+ ...super.toJSON(),
819
+ type: "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR",
820
+ };
821
+ }
822
+ toMonacoDiagnostic() {
823
+ return {
824
+ line: this.location.start.line,
825
+ column: this.location.start.column,
826
+ endLine: this.location.end.line,
827
+ endColumn: this.location.end.column,
828
+ message: this.message,
829
+ severity: 'error'
830
+ };
831
+ }
832
+ treeInspect() {
833
+ let output = "";
834
+ output += `@ ERBMultipleBlocksInTagError ${this.location.treeInspectWithLabel()}\n`;
835
+ output += `└── message: "${this.message}"\n`;
836
+ return output;
837
+ }
838
+ }
805
839
  function fromSerializedError(error) {
806
840
  switch (error.type) {
807
841
  case "UNEXPECTED_ERROR": return UnexpectedError.from(error);
@@ -815,6 +849,7 @@ function fromSerializedError(error) {
815
849
  case "RUBY_PARSE_ERROR": return RubyParseError.from(error);
816
850
  case "ERB_CONTROL_FLOW_SCOPE_ERROR": return ERBControlFlowScopeError.from(error);
817
851
  case "MISSINGERB_END_TAG_ERROR": return MissingERBEndTagError.from(error);
852
+ case "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR": return ERBMultipleBlocksInTagError.from(error);
818
853
  default:
819
854
  throw new Error(`Unknown node type: ${error.type}`);
820
855
  }
@@ -829,7 +864,7 @@ function convertToUTF8(string) {
829
864
  }
830
865
 
831
866
  // NOTE: This file is generated by the templates/template.rb script and should not
832
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/nodes.ts.erb
867
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.5/templates/javascript/packages/core/src/nodes.ts.erb
833
868
  class Node {
834
869
  type;
835
870
  location;
@@ -3063,7 +3098,7 @@ class ParseResult extends Result {
3063
3098
  }
3064
3099
 
3065
3100
  // NOTE: This file is generated by the templates/template.rb script and should not
3066
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/node-type-guards.ts.erb
3101
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.5/templates/javascript/packages/core/src/node-type-guards.ts.erb
3067
3102
  /**
3068
3103
  * Type guard functions for AST nodes.
3069
3104
  * These functions provide type checking by combining both instanceof
@@ -3456,7 +3491,7 @@ function getNodesAfterPosition(nodes, position, inclusive = true) {
3456
3491
  }
3457
3492
 
3458
3493
  // NOTE: This file is generated by the templates/template.rb script and should not
3459
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/visitor.ts.erb
3494
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.5/templates/javascript/packages/core/src/visitor.ts.erb
3460
3495
  class Visitor {
3461
3496
  visit(node) {
3462
3497
  if (!node)