@herb-tools/core 0.8.3 → 0.8.5
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/CHANGELOG.md +0 -19
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.5/templates/javascript/packages/core/src/errors.ts.erb
|
|
159
159
|
class HerbError {
|
|
160
160
|
type;
|
|
161
161
|
message;
|
|
@@ -658,6 +658,40 @@ class MissingERBEndTagError extends HerbError {
|
|
|
658
658
|
return output;
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
|
+
class ERBMultipleBlocksInTagError extends HerbError {
|
|
662
|
+
static from(data) {
|
|
663
|
+
return new ERBMultipleBlocksInTagError({
|
|
664
|
+
type: data.type,
|
|
665
|
+
message: data.message,
|
|
666
|
+
location: Location.from(data.location),
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
constructor(props) {
|
|
670
|
+
super(props.type, props.message, props.location);
|
|
671
|
+
}
|
|
672
|
+
toJSON() {
|
|
673
|
+
return {
|
|
674
|
+
...super.toJSON(),
|
|
675
|
+
type: "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR",
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
toMonacoDiagnostic() {
|
|
679
|
+
return {
|
|
680
|
+
line: this.location.start.line,
|
|
681
|
+
column: this.location.start.column,
|
|
682
|
+
endLine: this.location.end.line,
|
|
683
|
+
endColumn: this.location.end.column,
|
|
684
|
+
message: this.message,
|
|
685
|
+
severity: 'error'
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
treeInspect() {
|
|
689
|
+
let output = "";
|
|
690
|
+
output += `@ ERBMultipleBlocksInTagError ${this.location.treeInspectWithLabel()}\n`;
|
|
691
|
+
output += `└── message: "${this.message}"\n`;
|
|
692
|
+
return output;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
661
695
|
function fromSerializedError(error) {
|
|
662
696
|
switch (error.type) {
|
|
663
697
|
case "UNEXPECTED_ERROR": return UnexpectedError.from(error);
|
|
@@ -671,6 +705,7 @@ function fromSerializedError(error) {
|
|
|
671
705
|
case "RUBY_PARSE_ERROR": return RubyParseError.from(error);
|
|
672
706
|
case "ERB_CONTROL_FLOW_SCOPE_ERROR": return ERBControlFlowScopeError.from(error);
|
|
673
707
|
case "MISSINGERB_END_TAG_ERROR": return MissingERBEndTagError.from(error);
|
|
708
|
+
case "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR": return ERBMultipleBlocksInTagError.from(error);
|
|
674
709
|
default:
|
|
675
710
|
throw new Error(`Unknown node type: ${error.type}`);
|
|
676
711
|
}
|
|
@@ -692,7 +727,7 @@ function convertToUTF8(string) {
|
|
|
692
727
|
}
|
|
693
728
|
|
|
694
729
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
695
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
730
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.5/templates/javascript/packages/core/src/nodes.ts.erb
|
|
696
731
|
class Node {
|
|
697
732
|
type;
|
|
698
733
|
location;
|
|
@@ -2945,7 +2980,7 @@ class ParseResult extends Result {
|
|
|
2945
2980
|
}
|
|
2946
2981
|
|
|
2947
2982
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2948
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2983
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.5/templates/javascript/packages/core/src/node-type-guards.ts.erb
|
|
2949
2984
|
/**
|
|
2950
2985
|
* Type guard functions for AST nodes.
|
|
2951
2986
|
* These functions provide type checking by combining both instanceof
|
|
@@ -4025,7 +4060,7 @@ function didyoumeanRanked(input, list, threshold) {
|
|
|
4025
4060
|
}
|
|
4026
4061
|
|
|
4027
4062
|
var name = "@herb-tools/core";
|
|
4028
|
-
var version = "0.8.
|
|
4063
|
+
var version = "0.8.5";
|
|
4029
4064
|
var packageJSON = {
|
|
4030
4065
|
name: name,
|
|
4031
4066
|
version: version};
|
|
@@ -4248,7 +4283,7 @@ class HerbBackend {
|
|
|
4248
4283
|
}
|
|
4249
4284
|
|
|
4250
4285
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
4251
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
4286
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.5/templates/javascript/packages/core/src/visitor.ts.erb
|
|
4252
4287
|
class Visitor {
|
|
4253
4288
|
visit(node) {
|
|
4254
4289
|
if (!node)
|
|
@@ -4410,5 +4445,5 @@ class Visitor {
|
|
|
4410
4445
|
}
|
|
4411
4446
|
}
|
|
4412
4447
|
|
|
4413
|
-
export { AST_TYPE_GUARDS, CDATANode, DEFAULT_PARSER_OPTIONS, DocumentNode, ERBBeginNode, ERBBlockNode, ERBCaseMatchNode, ERBCaseNode, ERBContentNode, ERBControlFlowScopeError, ERBElseNode, ERBEndNode, ERBEnsureNode, ERBForNode, ERBIfNode, ERBInNode, 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 };
|
|
4448
|
+
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 };
|
|
4414
4449
|
//# sourceMappingURL=herb-core.esm.js.map
|