@herb-tools/rewriter 0.8.4 → 0.8.6
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 +5 -5
package/dist/index.cjs
CHANGED
|
@@ -290,7 +290,7 @@ class Token {
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
293
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
293
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.6/templates/javascript/packages/core/src/errors.ts.erb
|
|
294
294
|
class HerbError {
|
|
295
295
|
type;
|
|
296
296
|
message;
|
|
@@ -793,6 +793,40 @@ class MissingERBEndTagError extends HerbError {
|
|
|
793
793
|
return output;
|
|
794
794
|
}
|
|
795
795
|
}
|
|
796
|
+
class ERBMultipleBlocksInTagError extends HerbError {
|
|
797
|
+
static from(data) {
|
|
798
|
+
return new ERBMultipleBlocksInTagError({
|
|
799
|
+
type: data.type,
|
|
800
|
+
message: data.message,
|
|
801
|
+
location: Location.from(data.location),
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
constructor(props) {
|
|
805
|
+
super(props.type, props.message, props.location);
|
|
806
|
+
}
|
|
807
|
+
toJSON() {
|
|
808
|
+
return {
|
|
809
|
+
...super.toJSON(),
|
|
810
|
+
type: "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR",
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
toMonacoDiagnostic() {
|
|
814
|
+
return {
|
|
815
|
+
line: this.location.start.line,
|
|
816
|
+
column: this.location.start.column,
|
|
817
|
+
endLine: this.location.end.line,
|
|
818
|
+
endColumn: this.location.end.column,
|
|
819
|
+
message: this.message,
|
|
820
|
+
severity: 'error'
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
treeInspect() {
|
|
824
|
+
let output = "";
|
|
825
|
+
output += `@ ERBMultipleBlocksInTagError ${this.location.treeInspectWithLabel()}\n`;
|
|
826
|
+
output += `└── message: "${this.message}"\n`;
|
|
827
|
+
return output;
|
|
828
|
+
}
|
|
829
|
+
}
|
|
796
830
|
function fromSerializedError(error) {
|
|
797
831
|
switch (error.type) {
|
|
798
832
|
case "UNEXPECTED_ERROR": return UnexpectedError.from(error);
|
|
@@ -806,6 +840,7 @@ function fromSerializedError(error) {
|
|
|
806
840
|
case "RUBY_PARSE_ERROR": return RubyParseError.from(error);
|
|
807
841
|
case "ERB_CONTROL_FLOW_SCOPE_ERROR": return ERBControlFlowScopeError.from(error);
|
|
808
842
|
case "MISSINGERB_END_TAG_ERROR": return MissingERBEndTagError.from(error);
|
|
843
|
+
case "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR": return ERBMultipleBlocksInTagError.from(error);
|
|
809
844
|
default:
|
|
810
845
|
throw new Error(`Unknown node type: ${error.type}`);
|
|
811
846
|
}
|
|
@@ -820,7 +855,7 @@ function convertToUTF8(string) {
|
|
|
820
855
|
}
|
|
821
856
|
|
|
822
857
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
823
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
858
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.6/templates/javascript/packages/core/src/nodes.ts.erb
|
|
824
859
|
class Node {
|
|
825
860
|
type;
|
|
826
861
|
location;
|
|
@@ -3098,7 +3133,7 @@ function getNodesAfterPosition(nodes, position, inclusive = true) {
|
|
|
3098
3133
|
}
|
|
3099
3134
|
|
|
3100
3135
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
3101
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
3136
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.6/templates/javascript/packages/core/src/visitor.ts.erb
|
|
3102
3137
|
class Visitor {
|
|
3103
3138
|
visit(node) {
|
|
3104
3139
|
if (!node)
|