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