@herb-tools/core 0.8.8 → 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/herb-core.browser.js +41 -6
- package/dist/herb-core.browser.js.map +1 -1
- package/dist/herb-core.cjs +41 -5
- package/dist/herb-core.cjs.map +1 -1
- package/dist/herb-core.esm.js +41 -6
- package/dist/herb-core.esm.js.map +1 -1
- package/dist/herb-core.umd.js +41 -5
- package/dist/herb-core.umd.js.map +1 -1
- package/dist/types/errors.d.ts +18 -1
- package/package.json +1 -1
- package/src/errors.ts +58 -1
- package/src/node-type-guards.ts +1 -1
- package/src/nodes.ts +1 -1
- package/src/visitor.ts +1 -1
package/dist/herb-core.umd.js
CHANGED
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
164
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
164
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/errors.ts.erb
|
|
165
165
|
class HerbError {
|
|
166
166
|
type;
|
|
167
167
|
message;
|
|
@@ -698,6 +698,40 @@
|
|
|
698
698
|
return output;
|
|
699
699
|
}
|
|
700
700
|
}
|
|
701
|
+
class ERBCaseWithConditionsError extends HerbError {
|
|
702
|
+
static from(data) {
|
|
703
|
+
return new ERBCaseWithConditionsError({
|
|
704
|
+
type: data.type,
|
|
705
|
+
message: data.message,
|
|
706
|
+
location: Location.from(data.location),
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
constructor(props) {
|
|
710
|
+
super(props.type, props.message, props.location);
|
|
711
|
+
}
|
|
712
|
+
toJSON() {
|
|
713
|
+
return {
|
|
714
|
+
...super.toJSON(),
|
|
715
|
+
type: "ERB_CASE_WITH_CONDITIONS_ERROR",
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
toMonacoDiagnostic() {
|
|
719
|
+
return {
|
|
720
|
+
line: this.location.start.line,
|
|
721
|
+
column: this.location.start.column,
|
|
722
|
+
endLine: this.location.end.line,
|
|
723
|
+
endColumn: this.location.end.column,
|
|
724
|
+
message: this.message,
|
|
725
|
+
severity: 'error'
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
treeInspect() {
|
|
729
|
+
let output = "";
|
|
730
|
+
output += `@ ERBCaseWithConditionsError ${this.location.treeInspectWithLabel()}\n`;
|
|
731
|
+
output += `└── message: "${this.message}"\n`;
|
|
732
|
+
return output;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
701
735
|
function fromSerializedError(error) {
|
|
702
736
|
switch (error.type) {
|
|
703
737
|
case "UNEXPECTED_ERROR": return UnexpectedError.from(error);
|
|
@@ -712,6 +746,7 @@
|
|
|
712
746
|
case "ERB_CONTROL_FLOW_SCOPE_ERROR": return ERBControlFlowScopeError.from(error);
|
|
713
747
|
case "MISSINGERB_END_TAG_ERROR": return MissingERBEndTagError.from(error);
|
|
714
748
|
case "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR": return ERBMultipleBlocksInTagError.from(error);
|
|
749
|
+
case "ERB_CASE_WITH_CONDITIONS_ERROR": return ERBCaseWithConditionsError.from(error);
|
|
715
750
|
default:
|
|
716
751
|
throw new Error(`Unknown node type: ${error.type}`);
|
|
717
752
|
}
|
|
@@ -733,7 +768,7 @@
|
|
|
733
768
|
}
|
|
734
769
|
|
|
735
770
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
736
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
771
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/nodes.ts.erb
|
|
737
772
|
class Node {
|
|
738
773
|
type;
|
|
739
774
|
location;
|
|
@@ -3006,7 +3041,7 @@
|
|
|
3006
3041
|
}
|
|
3007
3042
|
|
|
3008
3043
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
3009
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
3044
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/node-type-guards.ts.erb
|
|
3010
3045
|
/**
|
|
3011
3046
|
* Type guard functions for AST nodes.
|
|
3012
3047
|
* These functions provide type checking by combining both instanceof
|
|
@@ -4086,7 +4121,7 @@
|
|
|
4086
4121
|
}
|
|
4087
4122
|
|
|
4088
4123
|
var name = "@herb-tools/core";
|
|
4089
|
-
var version = "0.8.
|
|
4124
|
+
var version = "0.8.10";
|
|
4090
4125
|
var packageJSON = {
|
|
4091
4126
|
name: name,
|
|
4092
4127
|
version: version};
|
|
@@ -4309,7 +4344,7 @@
|
|
|
4309
4344
|
}
|
|
4310
4345
|
|
|
4311
4346
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
4312
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
4347
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/visitor.ts.erb
|
|
4313
4348
|
class Visitor {
|
|
4314
4349
|
visit(node) {
|
|
4315
4350
|
if (!node)
|
|
@@ -4479,6 +4514,7 @@
|
|
|
4479
4514
|
exports.ERBBlockNode = ERBBlockNode;
|
|
4480
4515
|
exports.ERBCaseMatchNode = ERBCaseMatchNode;
|
|
4481
4516
|
exports.ERBCaseNode = ERBCaseNode;
|
|
4517
|
+
exports.ERBCaseWithConditionsError = ERBCaseWithConditionsError;
|
|
4482
4518
|
exports.ERBContentNode = ERBContentNode;
|
|
4483
4519
|
exports.ERBControlFlowScopeError = ERBControlFlowScopeError;
|
|
4484
4520
|
exports.ERBElseNode = ERBElseNode;
|