@herb-tools/core 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/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.esm.js
CHANGED
|
@@ -155,7 +155,7 @@ class Token {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
158
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
158
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/errors.ts.erb
|
|
159
159
|
class HerbError {
|
|
160
160
|
type;
|
|
161
161
|
message;
|
|
@@ -692,6 +692,40 @@ class ERBMultipleBlocksInTagError extends HerbError {
|
|
|
692
692
|
return output;
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
|
+
class ERBCaseWithConditionsError extends HerbError {
|
|
696
|
+
static from(data) {
|
|
697
|
+
return new ERBCaseWithConditionsError({
|
|
698
|
+
type: data.type,
|
|
699
|
+
message: data.message,
|
|
700
|
+
location: Location.from(data.location),
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
constructor(props) {
|
|
704
|
+
super(props.type, props.message, props.location);
|
|
705
|
+
}
|
|
706
|
+
toJSON() {
|
|
707
|
+
return {
|
|
708
|
+
...super.toJSON(),
|
|
709
|
+
type: "ERB_CASE_WITH_CONDITIONS_ERROR",
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
toMonacoDiagnostic() {
|
|
713
|
+
return {
|
|
714
|
+
line: this.location.start.line,
|
|
715
|
+
column: this.location.start.column,
|
|
716
|
+
endLine: this.location.end.line,
|
|
717
|
+
endColumn: this.location.end.column,
|
|
718
|
+
message: this.message,
|
|
719
|
+
severity: 'error'
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
treeInspect() {
|
|
723
|
+
let output = "";
|
|
724
|
+
output += `@ ERBCaseWithConditionsError ${this.location.treeInspectWithLabel()}\n`;
|
|
725
|
+
output += `└── message: "${this.message}"\n`;
|
|
726
|
+
return output;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
695
729
|
function fromSerializedError(error) {
|
|
696
730
|
switch (error.type) {
|
|
697
731
|
case "UNEXPECTED_ERROR": return UnexpectedError.from(error);
|
|
@@ -706,6 +740,7 @@ function fromSerializedError(error) {
|
|
|
706
740
|
case "ERB_CONTROL_FLOW_SCOPE_ERROR": return ERBControlFlowScopeError.from(error);
|
|
707
741
|
case "MISSINGERB_END_TAG_ERROR": return MissingERBEndTagError.from(error);
|
|
708
742
|
case "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR": return ERBMultipleBlocksInTagError.from(error);
|
|
743
|
+
case "ERB_CASE_WITH_CONDITIONS_ERROR": return ERBCaseWithConditionsError.from(error);
|
|
709
744
|
default:
|
|
710
745
|
throw new Error(`Unknown node type: ${error.type}`);
|
|
711
746
|
}
|
|
@@ -727,7 +762,7 @@ function convertToUTF8(string) {
|
|
|
727
762
|
}
|
|
728
763
|
|
|
729
764
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
730
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
765
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/nodes.ts.erb
|
|
731
766
|
class Node {
|
|
732
767
|
type;
|
|
733
768
|
location;
|
|
@@ -3000,7 +3035,7 @@ class ParseResult extends Result {
|
|
|
3000
3035
|
}
|
|
3001
3036
|
|
|
3002
3037
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
3003
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
3038
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/node-type-guards.ts.erb
|
|
3004
3039
|
/**
|
|
3005
3040
|
* Type guard functions for AST nodes.
|
|
3006
3041
|
* These functions provide type checking by combining both instanceof
|
|
@@ -4080,7 +4115,7 @@ function didyoumeanRanked(input, list, threshold) {
|
|
|
4080
4115
|
}
|
|
4081
4116
|
|
|
4082
4117
|
var name = "@herb-tools/core";
|
|
4083
|
-
var version = "0.8.
|
|
4118
|
+
var version = "0.8.10";
|
|
4084
4119
|
var packageJSON = {
|
|
4085
4120
|
name: name,
|
|
4086
4121
|
version: version};
|
|
@@ -4303,7 +4338,7 @@ class HerbBackend {
|
|
|
4303
4338
|
}
|
|
4304
4339
|
|
|
4305
4340
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
4306
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
4341
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/visitor.ts.erb
|
|
4307
4342
|
class Visitor {
|
|
4308
4343
|
visit(node) {
|
|
4309
4344
|
if (!node)
|
|
@@ -4465,5 +4500,5 @@ class Visitor {
|
|
|
4465
4500
|
}
|
|
4466
4501
|
}
|
|
4467
4502
|
|
|
4468
|
-
export { AST_TYPE_GUARDS, CDATANode, DEFAULT_PARSER_OPTIONS, DocumentNode, ERBBeginNode, ERBBlockNode, ERBCaseMatchNode, ERBCaseNode, ERBContentNode, ERBControlFlowScopeError, ERBElseNode, ERBEndNode, ERBEnsureNode, ERBForNode, ERBIfNode, ERBInNode, ERBMultipleBlocksInTagError, ERBNodeClasses, ERBRescueNode, ERBUnlessNode, ERBUntilNode, ERBWhenNode, ERBWhileNode, ERBYieldNode, HTMLAttributeNameNode, HTMLAttributeNode, HTMLAttributeValueNode, HTMLCloseTagNode, HTMLCommentNode, HTMLDoctypeNode, HTMLElementNode, HTMLOpenTagNode, HTMLTextNode, HerbBackend, HerbError, HerbWarning, LexResult, LiteralNode, Location, MissingClosingTagError, MissingERBEndTagError, MissingOpeningTagError, NODE_TYPE_GUARDS, Node, ParseResult, Position, QuotesMismatchError, Range, Result, RubyParseError, TagNamesMismatchError, Token, TokenList, UnclosedElementError, UnexpectedError, UnexpectedTokenError, Visitor, VoidElementClosingTagError, WhitespaceNode, XMLDeclarationNode, _TYPECHECK, areAllOfType, convertToUTF8, didyoumean, didyoumeanRanked, ensureLibHerbBackend, ensureString, filterCDATANodes, filterDocumentNodes, filterERBBeginNodes, filterERBBlockNodes, filterERBCaseMatchNodes, filterERBCaseNodes, filterERBContentNodes, filterERBElseNodes, filterERBEndNodes, filterERBEnsureNodes, filterERBForNodes, filterERBIfNodes, filterERBInNodes, filterERBRescueNodes, filterERBUnlessNodes, filterERBUntilNodes, filterERBWhenNodes, filterERBWhileNodes, filterERBYieldNodes, filterHTMLAttributeNameNodes, filterHTMLAttributeNodes, filterHTMLAttributeValueNodes, filterHTMLCloseTagNodes, filterHTMLCommentNodes, filterHTMLDoctypeNodes, filterHTMLElementNodes, filterHTMLOpenTagNodes, filterHTMLTextNodes, filterLiteralNodes, filterNodes, filterWhitespaceNodes, filterXMLDeclarationNodes, fromSerializedError, fromSerializedNode, getCombinedAttributeName, getCombinedStringFromNodes, getNodesAfterLocation, getNodesAfterPosition, getNodesBeforeLocation, getNodesBeforePosition, getStaticAttributeName, getStaticContentFromNodes, getStaticStringFromNodes, getTagName, getValidatableStaticContent, hasChildren, hasDynamicAttributeName, hasERBContent, hasERBOutput, hasStaticAttributeName, hasStaticContent, isAnyOf, isCDATANode, isCommentNode, isDocumentNode, isERBBeginNode, isERBBlockNode, isERBCaseMatchNode, isERBCaseNode, isERBCommentNode, isERBContentNode, isERBControlFlowNode, isERBElseNode, isERBEndNode, isERBEnsureNode, isERBForNode, isERBIfNode, isERBInNode, isERBNode, isERBOutputNode, isERBRescueNode, isERBUnlessNode, isERBUntilNode, isERBWhenNode, isERBWhileNode, isERBYieldNode, isEffectivelyStatic, isHTMLAttributeNameNode, isHTMLAttributeNode, isHTMLAttributeValueNode, isHTMLCloseTagNode, isHTMLCommentNode, isHTMLDoctypeNode, isHTMLElementNode, isHTMLNode, isHTMLOpenTagNode, isHTMLTextNode, isLibHerbBackend, isLiteralNode, isNode, isNoneOf, isParseResult, isPositionAfter, isPositionEqual, isToken, isWhitespaceNode, isXMLDeclarationNode, levenshtein, splitNodesAroundLocation, splitNodesAroundPosition, toMonacoDiagnostic };
|
|
4503
|
+
export { AST_TYPE_GUARDS, CDATANode, DEFAULT_PARSER_OPTIONS, DocumentNode, ERBBeginNode, ERBBlockNode, ERBCaseMatchNode, ERBCaseNode, ERBCaseWithConditionsError, ERBContentNode, ERBControlFlowScopeError, ERBElseNode, ERBEndNode, ERBEnsureNode, ERBForNode, ERBIfNode, ERBInNode, ERBMultipleBlocksInTagError, ERBNodeClasses, ERBRescueNode, ERBUnlessNode, ERBUntilNode, ERBWhenNode, ERBWhileNode, ERBYieldNode, HTMLAttributeNameNode, HTMLAttributeNode, HTMLAttributeValueNode, HTMLCloseTagNode, HTMLCommentNode, HTMLDoctypeNode, HTMLElementNode, HTMLOpenTagNode, HTMLTextNode, HerbBackend, HerbError, HerbWarning, LexResult, LiteralNode, Location, MissingClosingTagError, MissingERBEndTagError, MissingOpeningTagError, NODE_TYPE_GUARDS, Node, ParseResult, Position, QuotesMismatchError, Range, Result, RubyParseError, TagNamesMismatchError, Token, TokenList, UnclosedElementError, UnexpectedError, UnexpectedTokenError, Visitor, VoidElementClosingTagError, WhitespaceNode, XMLDeclarationNode, _TYPECHECK, areAllOfType, convertToUTF8, didyoumean, didyoumeanRanked, ensureLibHerbBackend, ensureString, filterCDATANodes, filterDocumentNodes, filterERBBeginNodes, filterERBBlockNodes, filterERBCaseMatchNodes, filterERBCaseNodes, filterERBContentNodes, filterERBElseNodes, filterERBEndNodes, filterERBEnsureNodes, filterERBForNodes, filterERBIfNodes, filterERBInNodes, filterERBRescueNodes, filterERBUnlessNodes, filterERBUntilNodes, filterERBWhenNodes, filterERBWhileNodes, filterERBYieldNodes, filterHTMLAttributeNameNodes, filterHTMLAttributeNodes, filterHTMLAttributeValueNodes, filterHTMLCloseTagNodes, filterHTMLCommentNodes, filterHTMLDoctypeNodes, filterHTMLElementNodes, filterHTMLOpenTagNodes, filterHTMLTextNodes, filterLiteralNodes, filterNodes, filterWhitespaceNodes, filterXMLDeclarationNodes, fromSerializedError, fromSerializedNode, getCombinedAttributeName, getCombinedStringFromNodes, getNodesAfterLocation, getNodesAfterPosition, getNodesBeforeLocation, getNodesBeforePosition, getStaticAttributeName, getStaticContentFromNodes, getStaticStringFromNodes, getTagName, getValidatableStaticContent, hasChildren, hasDynamicAttributeName, hasERBContent, hasERBOutput, hasStaticAttributeName, hasStaticContent, isAnyOf, isCDATANode, isCommentNode, isDocumentNode, isERBBeginNode, isERBBlockNode, isERBCaseMatchNode, isERBCaseNode, isERBCommentNode, isERBContentNode, isERBControlFlowNode, isERBElseNode, isERBEndNode, isERBEnsureNode, isERBForNode, isERBIfNode, isERBInNode, isERBNode, isERBOutputNode, isERBRescueNode, isERBUnlessNode, isERBUntilNode, isERBWhenNode, isERBWhileNode, isERBYieldNode, isEffectivelyStatic, isHTMLAttributeNameNode, isHTMLAttributeNode, isHTMLAttributeValueNode, isHTMLCloseTagNode, isHTMLCommentNode, isHTMLDoctypeNode, isHTMLElementNode, isHTMLNode, isHTMLOpenTagNode, isHTMLTextNode, isLibHerbBackend, isLiteralNode, isNode, isNoneOf, isParseResult, isPositionAfter, isPositionEqual, isToken, isWhitespaceNode, isXMLDeclarationNode, levenshtein, splitNodesAroundLocation, splitNodesAroundPosition, toMonacoDiagnostic };
|
|
4469
4504
|
//# sourceMappingURL=herb-core.esm.js.map
|