@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.cjs
CHANGED
|
@@ -157,7 +157,7 @@ class Token {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
160
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
160
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/errors.ts.erb
|
|
161
161
|
class HerbError {
|
|
162
162
|
type;
|
|
163
163
|
message;
|
|
@@ -694,6 +694,40 @@ class ERBMultipleBlocksInTagError extends HerbError {
|
|
|
694
694
|
return output;
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
+
class ERBCaseWithConditionsError extends HerbError {
|
|
698
|
+
static from(data) {
|
|
699
|
+
return new ERBCaseWithConditionsError({
|
|
700
|
+
type: data.type,
|
|
701
|
+
message: data.message,
|
|
702
|
+
location: Location.from(data.location),
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
constructor(props) {
|
|
706
|
+
super(props.type, props.message, props.location);
|
|
707
|
+
}
|
|
708
|
+
toJSON() {
|
|
709
|
+
return {
|
|
710
|
+
...super.toJSON(),
|
|
711
|
+
type: "ERB_CASE_WITH_CONDITIONS_ERROR",
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
toMonacoDiagnostic() {
|
|
715
|
+
return {
|
|
716
|
+
line: this.location.start.line,
|
|
717
|
+
column: this.location.start.column,
|
|
718
|
+
endLine: this.location.end.line,
|
|
719
|
+
endColumn: this.location.end.column,
|
|
720
|
+
message: this.message,
|
|
721
|
+
severity: 'error'
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
treeInspect() {
|
|
725
|
+
let output = "";
|
|
726
|
+
output += `@ ERBCaseWithConditionsError ${this.location.treeInspectWithLabel()}\n`;
|
|
727
|
+
output += `└── message: "${this.message}"\n`;
|
|
728
|
+
return output;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
697
731
|
function fromSerializedError(error) {
|
|
698
732
|
switch (error.type) {
|
|
699
733
|
case "UNEXPECTED_ERROR": return UnexpectedError.from(error);
|
|
@@ -708,6 +742,7 @@ function fromSerializedError(error) {
|
|
|
708
742
|
case "ERB_CONTROL_FLOW_SCOPE_ERROR": return ERBControlFlowScopeError.from(error);
|
|
709
743
|
case "MISSINGERB_END_TAG_ERROR": return MissingERBEndTagError.from(error);
|
|
710
744
|
case "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR": return ERBMultipleBlocksInTagError.from(error);
|
|
745
|
+
case "ERB_CASE_WITH_CONDITIONS_ERROR": return ERBCaseWithConditionsError.from(error);
|
|
711
746
|
default:
|
|
712
747
|
throw new Error(`Unknown node type: ${error.type}`);
|
|
713
748
|
}
|
|
@@ -729,7 +764,7 @@ function convertToUTF8(string) {
|
|
|
729
764
|
}
|
|
730
765
|
|
|
731
766
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
732
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
767
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/nodes.ts.erb
|
|
733
768
|
class Node {
|
|
734
769
|
type;
|
|
735
770
|
location;
|
|
@@ -3002,7 +3037,7 @@ class ParseResult extends Result {
|
|
|
3002
3037
|
}
|
|
3003
3038
|
|
|
3004
3039
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
3005
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
3040
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/node-type-guards.ts.erb
|
|
3006
3041
|
/**
|
|
3007
3042
|
* Type guard functions for AST nodes.
|
|
3008
3043
|
* These functions provide type checking by combining both instanceof
|
|
@@ -4082,7 +4117,7 @@ function didyoumeanRanked(input, list, threshold) {
|
|
|
4082
4117
|
}
|
|
4083
4118
|
|
|
4084
4119
|
var name = "@herb-tools/core";
|
|
4085
|
-
var version = "0.8.
|
|
4120
|
+
var version = "0.8.10";
|
|
4086
4121
|
var packageJSON = {
|
|
4087
4122
|
name: name,
|
|
4088
4123
|
version: version};
|
|
@@ -4305,7 +4340,7 @@ class HerbBackend {
|
|
|
4305
4340
|
}
|
|
4306
4341
|
|
|
4307
4342
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
4308
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
4343
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/visitor.ts.erb
|
|
4309
4344
|
class Visitor {
|
|
4310
4345
|
visit(node) {
|
|
4311
4346
|
if (!node)
|
|
@@ -4475,6 +4510,7 @@ exports.ERBBeginNode = ERBBeginNode;
|
|
|
4475
4510
|
exports.ERBBlockNode = ERBBlockNode;
|
|
4476
4511
|
exports.ERBCaseMatchNode = ERBCaseMatchNode;
|
|
4477
4512
|
exports.ERBCaseNode = ERBCaseNode;
|
|
4513
|
+
exports.ERBCaseWithConditionsError = ERBCaseWithConditionsError;
|
|
4478
4514
|
exports.ERBContentNode = ERBContentNode;
|
|
4479
4515
|
exports.ERBControlFlowScopeError = ERBControlFlowScopeError;
|
|
4480
4516
|
exports.ERBElseNode = ERBElseNode;
|