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