@herb-tools/rewriter 0.8.9 → 0.8.10

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.
@@ -292,7 +292,7 @@ class Token {
292
292
  }
293
293
 
294
294
  // NOTE: This file is generated by the templates/template.rb script and should not
295
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.9/templates/javascript/packages/core/src/errors.ts.erb
295
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/errors.ts.erb
296
296
  class HerbError {
297
297
  type;
298
298
  message;
@@ -829,6 +829,40 @@ class ERBMultipleBlocksInTagError extends HerbError {
829
829
  return output;
830
830
  }
831
831
  }
832
+ class ERBCaseWithConditionsError extends HerbError {
833
+ static from(data) {
834
+ return new ERBCaseWithConditionsError({
835
+ type: data.type,
836
+ message: data.message,
837
+ location: Location.from(data.location),
838
+ });
839
+ }
840
+ constructor(props) {
841
+ super(props.type, props.message, props.location);
842
+ }
843
+ toJSON() {
844
+ return {
845
+ ...super.toJSON(),
846
+ type: "ERB_CASE_WITH_CONDITIONS_ERROR",
847
+ };
848
+ }
849
+ toMonacoDiagnostic() {
850
+ return {
851
+ line: this.location.start.line,
852
+ column: this.location.start.column,
853
+ endLine: this.location.end.line,
854
+ endColumn: this.location.end.column,
855
+ message: this.message,
856
+ severity: 'error'
857
+ };
858
+ }
859
+ treeInspect() {
860
+ let output = "";
861
+ output += `@ ERBCaseWithConditionsError ${this.location.treeInspectWithLabel()}\n`;
862
+ output += `└── message: "${this.message}"\n`;
863
+ return output;
864
+ }
865
+ }
832
866
  function fromSerializedError(error) {
833
867
  switch (error.type) {
834
868
  case "UNEXPECTED_ERROR": return UnexpectedError.from(error);
@@ -843,6 +877,7 @@ function fromSerializedError(error) {
843
877
  case "ERB_CONTROL_FLOW_SCOPE_ERROR": return ERBControlFlowScopeError.from(error);
844
878
  case "MISSINGERB_END_TAG_ERROR": return MissingERBEndTagError.from(error);
845
879
  case "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR": return ERBMultipleBlocksInTagError.from(error);
880
+ case "ERB_CASE_WITH_CONDITIONS_ERROR": return ERBCaseWithConditionsError.from(error);
846
881
  default:
847
882
  throw new Error(`Unknown node type: ${error.type}`);
848
883
  }
@@ -857,7 +892,7 @@ function convertToUTF8(string) {
857
892
  }
858
893
 
859
894
  // NOTE: This file is generated by the templates/template.rb script and should not
860
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.9/templates/javascript/packages/core/src/nodes.ts.erb
895
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/nodes.ts.erb
861
896
  class Node {
862
897
  type;
863
898
  location;
@@ -3111,7 +3146,7 @@ class ParseResult extends Result {
3111
3146
  }
3112
3147
 
3113
3148
  // NOTE: This file is generated by the templates/template.rb script and should not
3114
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.9/templates/javascript/packages/core/src/node-type-guards.ts.erb
3149
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/node-type-guards.ts.erb
3115
3150
  /**
3116
3151
  * Type guard functions for AST nodes.
3117
3152
  * These functions provide type checking by combining both instanceof
@@ -3504,7 +3539,7 @@ function getNodesAfterPosition(nodes, position, inclusive = true) {
3504
3539
  }
3505
3540
 
3506
3541
  // NOTE: This file is generated by the templates/template.rb script and should not
3507
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.9/templates/javascript/packages/core/src/visitor.ts.erb
3542
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/visitor.ts.erb
3508
3543
  class Visitor {
3509
3544
  visit(node) {
3510
3545
  if (!node)