@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/index.esm.js
CHANGED
|
@@ -288,7 +288,7 @@ class Token {
|
|
|
288
288
|
}
|
|
289
289
|
|
|
290
290
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
291
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
291
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/errors.ts.erb
|
|
292
292
|
class HerbError {
|
|
293
293
|
type;
|
|
294
294
|
message;
|
|
@@ -825,6 +825,40 @@ class ERBMultipleBlocksInTagError extends HerbError {
|
|
|
825
825
|
return output;
|
|
826
826
|
}
|
|
827
827
|
}
|
|
828
|
+
class ERBCaseWithConditionsError extends HerbError {
|
|
829
|
+
static from(data) {
|
|
830
|
+
return new ERBCaseWithConditionsError({
|
|
831
|
+
type: data.type,
|
|
832
|
+
message: data.message,
|
|
833
|
+
location: Location.from(data.location),
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
constructor(props) {
|
|
837
|
+
super(props.type, props.message, props.location);
|
|
838
|
+
}
|
|
839
|
+
toJSON() {
|
|
840
|
+
return {
|
|
841
|
+
...super.toJSON(),
|
|
842
|
+
type: "ERB_CASE_WITH_CONDITIONS_ERROR",
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
toMonacoDiagnostic() {
|
|
846
|
+
return {
|
|
847
|
+
line: this.location.start.line,
|
|
848
|
+
column: this.location.start.column,
|
|
849
|
+
endLine: this.location.end.line,
|
|
850
|
+
endColumn: this.location.end.column,
|
|
851
|
+
message: this.message,
|
|
852
|
+
severity: 'error'
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
treeInspect() {
|
|
856
|
+
let output = "";
|
|
857
|
+
output += `@ ERBCaseWithConditionsError ${this.location.treeInspectWithLabel()}\n`;
|
|
858
|
+
output += `└── message: "${this.message}"\n`;
|
|
859
|
+
return output;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
828
862
|
function fromSerializedError(error) {
|
|
829
863
|
switch (error.type) {
|
|
830
864
|
case "UNEXPECTED_ERROR": return UnexpectedError.from(error);
|
|
@@ -839,6 +873,7 @@ function fromSerializedError(error) {
|
|
|
839
873
|
case "ERB_CONTROL_FLOW_SCOPE_ERROR": return ERBControlFlowScopeError.from(error);
|
|
840
874
|
case "MISSINGERB_END_TAG_ERROR": return MissingERBEndTagError.from(error);
|
|
841
875
|
case "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR": return ERBMultipleBlocksInTagError.from(error);
|
|
876
|
+
case "ERB_CASE_WITH_CONDITIONS_ERROR": return ERBCaseWithConditionsError.from(error);
|
|
842
877
|
default:
|
|
843
878
|
throw new Error(`Unknown node type: ${error.type}`);
|
|
844
879
|
}
|
|
@@ -853,7 +888,7 @@ function convertToUTF8(string) {
|
|
|
853
888
|
}
|
|
854
889
|
|
|
855
890
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
856
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
891
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/nodes.ts.erb
|
|
857
892
|
class Node {
|
|
858
893
|
type;
|
|
859
894
|
location;
|
|
@@ -3151,7 +3186,7 @@ function getNodesAfterPosition(nodes, position, inclusive = true) {
|
|
|
3151
3186
|
}
|
|
3152
3187
|
|
|
3153
3188
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
3154
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
3189
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/visitor.ts.erb
|
|
3155
3190
|
class Visitor {
|
|
3156
3191
|
visit(node) {
|
|
3157
3192
|
if (!node)
|