@herb-tools/core 0.8.7 → 0.8.9
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 +25 -5
- package/dist/herb-core.browser.js.map +1 -1
- package/dist/herb-core.cjs +25 -5
- package/dist/herb-core.cjs.map +1 -1
- package/dist/herb-core.esm.js +25 -5
- package/dist/herb-core.esm.js.map +1 -1
- package/dist/herb-core.umd.js +25 -5
- package/dist/herb-core.umd.js.map +1 -1
- package/dist/types/nodes.d.ts +12 -0
- package/package.json +1 -1
- package/src/errors.ts +1 -1
- package/src/node-type-guards.ts +1 -1
- package/src/nodes.ts +29 -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.9/templates/javascript/packages/core/src/errors.ts.erb
|
|
165
165
|
class HerbError {
|
|
166
166
|
type;
|
|
167
167
|
message;
|
|
@@ -733,7 +733,7 @@
|
|
|
733
733
|
}
|
|
734
734
|
|
|
735
735
|
// 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.
|
|
736
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.9/templates/javascript/packages/core/src/nodes.ts.erb
|
|
737
737
|
class Node {
|
|
738
738
|
type;
|
|
739
739
|
location;
|
|
@@ -1807,6 +1807,7 @@
|
|
|
1807
1807
|
tag_opening;
|
|
1808
1808
|
content;
|
|
1809
1809
|
tag_closing;
|
|
1810
|
+
then_keyword;
|
|
1810
1811
|
statements;
|
|
1811
1812
|
subsequent;
|
|
1812
1813
|
end_node;
|
|
@@ -1821,6 +1822,7 @@
|
|
|
1821
1822
|
tag_opening: data.tag_opening ? Token.from(data.tag_opening) : null,
|
|
1822
1823
|
content: data.content ? Token.from(data.content) : null,
|
|
1823
1824
|
tag_closing: data.tag_closing ? Token.from(data.tag_closing) : null,
|
|
1825
|
+
then_keyword: data.then_keyword ? Location.from(data.then_keyword) : null,
|
|
1824
1826
|
statements: (data.statements || []).map(node => fromSerializedNode(node)),
|
|
1825
1827
|
subsequent: data.subsequent ? fromSerializedNode((data.subsequent)) : null,
|
|
1826
1828
|
end_node: data.end_node ? fromSerializedNode((data.end_node)) : null,
|
|
@@ -1831,6 +1833,7 @@
|
|
|
1831
1833
|
this.tag_opening = props.tag_opening;
|
|
1832
1834
|
this.content = props.content;
|
|
1833
1835
|
this.tag_closing = props.tag_closing;
|
|
1836
|
+
this.then_keyword = props.then_keyword;
|
|
1834
1837
|
this.statements = props.statements;
|
|
1835
1838
|
this.subsequent = props.subsequent;
|
|
1836
1839
|
this.end_node = props.end_node;
|
|
@@ -1863,6 +1866,7 @@
|
|
|
1863
1866
|
tag_opening: this.tag_opening ? this.tag_opening.toJSON() : null,
|
|
1864
1867
|
content: this.content ? this.content.toJSON() : null,
|
|
1865
1868
|
tag_closing: this.tag_closing ? this.tag_closing.toJSON() : null,
|
|
1869
|
+
then_keyword: this.then_keyword ? this.then_keyword.toJSON() : null,
|
|
1866
1870
|
statements: this.statements.map(node => node.toJSON()),
|
|
1867
1871
|
subsequent: this.subsequent ? this.subsequent.toJSON() : null,
|
|
1868
1872
|
end_node: this.end_node ? this.end_node.toJSON() : null,
|
|
@@ -1875,6 +1879,7 @@
|
|
|
1875
1879
|
output += `├── tag_opening: ${this.tag_opening ? this.tag_opening.treeInspect() : "∅"}\n`;
|
|
1876
1880
|
output += `├── content: ${this.content ? this.content.treeInspect() : "∅"}\n`;
|
|
1877
1881
|
output += `├── tag_closing: ${this.tag_closing ? this.tag_closing.treeInspect() : "∅"}\n`;
|
|
1882
|
+
output += `├── then_keyword: ${this.then_keyword ? "(location: " + this.then_keyword.treeInspect() + ")" : "∅"}\n`;
|
|
1878
1883
|
output += `├── statements: ${this.inspectArray(this.statements, "│ ")}`;
|
|
1879
1884
|
output += `├── subsequent: ${this.inspectNode(this.subsequent, "│ ")}`;
|
|
1880
1885
|
output += `└── end_node: ${this.inspectNode(this.end_node, " ")}`;
|
|
@@ -1956,6 +1961,7 @@
|
|
|
1956
1961
|
tag_opening;
|
|
1957
1962
|
content;
|
|
1958
1963
|
tag_closing;
|
|
1964
|
+
then_keyword;
|
|
1959
1965
|
statements;
|
|
1960
1966
|
static get type() {
|
|
1961
1967
|
return "AST_ERB_WHEN_NODE";
|
|
@@ -1968,6 +1974,7 @@
|
|
|
1968
1974
|
tag_opening: data.tag_opening ? Token.from(data.tag_opening) : null,
|
|
1969
1975
|
content: data.content ? Token.from(data.content) : null,
|
|
1970
1976
|
tag_closing: data.tag_closing ? Token.from(data.tag_closing) : null,
|
|
1977
|
+
then_keyword: data.then_keyword ? Location.from(data.then_keyword) : null,
|
|
1971
1978
|
statements: (data.statements || []).map(node => fromSerializedNode(node)),
|
|
1972
1979
|
});
|
|
1973
1980
|
}
|
|
@@ -1976,6 +1983,7 @@
|
|
|
1976
1983
|
this.tag_opening = props.tag_opening;
|
|
1977
1984
|
this.content = props.content;
|
|
1978
1985
|
this.tag_closing = props.tag_closing;
|
|
1986
|
+
this.then_keyword = props.then_keyword;
|
|
1979
1987
|
this.statements = props.statements;
|
|
1980
1988
|
}
|
|
1981
1989
|
accept(visitor) {
|
|
@@ -2002,6 +2010,7 @@
|
|
|
2002
2010
|
tag_opening: this.tag_opening ? this.tag_opening.toJSON() : null,
|
|
2003
2011
|
content: this.content ? this.content.toJSON() : null,
|
|
2004
2012
|
tag_closing: this.tag_closing ? this.tag_closing.toJSON() : null,
|
|
2013
|
+
then_keyword: this.then_keyword ? this.then_keyword.toJSON() : null,
|
|
2005
2014
|
statements: this.statements.map(node => node.toJSON()),
|
|
2006
2015
|
};
|
|
2007
2016
|
}
|
|
@@ -2012,6 +2021,7 @@
|
|
|
2012
2021
|
output += `├── tag_opening: ${this.tag_opening ? this.tag_opening.treeInspect() : "∅"}\n`;
|
|
2013
2022
|
output += `├── content: ${this.content ? this.content.treeInspect() : "∅"}\n`;
|
|
2014
2023
|
output += `├── tag_closing: ${this.tag_closing ? this.tag_closing.treeInspect() : "∅"}\n`;
|
|
2024
|
+
output += `├── then_keyword: ${this.then_keyword ? "(location: " + this.then_keyword.treeInspect() + ")" : "∅"}\n`;
|
|
2015
2025
|
output += `└── statements: ${this.inspectArray(this.statements, " ")}`;
|
|
2016
2026
|
return output;
|
|
2017
2027
|
}
|
|
@@ -2630,6 +2640,7 @@
|
|
|
2630
2640
|
tag_opening;
|
|
2631
2641
|
content;
|
|
2632
2642
|
tag_closing;
|
|
2643
|
+
then_keyword;
|
|
2633
2644
|
statements;
|
|
2634
2645
|
else_clause;
|
|
2635
2646
|
end_node;
|
|
@@ -2644,6 +2655,7 @@
|
|
|
2644
2655
|
tag_opening: data.tag_opening ? Token.from(data.tag_opening) : null,
|
|
2645
2656
|
content: data.content ? Token.from(data.content) : null,
|
|
2646
2657
|
tag_closing: data.tag_closing ? Token.from(data.tag_closing) : null,
|
|
2658
|
+
then_keyword: data.then_keyword ? Location.from(data.then_keyword) : null,
|
|
2647
2659
|
statements: (data.statements || []).map(node => fromSerializedNode(node)),
|
|
2648
2660
|
else_clause: data.else_clause ? fromSerializedNode((data.else_clause)) : null,
|
|
2649
2661
|
end_node: data.end_node ? fromSerializedNode((data.end_node)) : null,
|
|
@@ -2654,6 +2666,7 @@
|
|
|
2654
2666
|
this.tag_opening = props.tag_opening;
|
|
2655
2667
|
this.content = props.content;
|
|
2656
2668
|
this.tag_closing = props.tag_closing;
|
|
2669
|
+
this.then_keyword = props.then_keyword;
|
|
2657
2670
|
this.statements = props.statements;
|
|
2658
2671
|
this.else_clause = props.else_clause;
|
|
2659
2672
|
this.end_node = props.end_node;
|
|
@@ -2686,6 +2699,7 @@
|
|
|
2686
2699
|
tag_opening: this.tag_opening ? this.tag_opening.toJSON() : null,
|
|
2687
2700
|
content: this.content ? this.content.toJSON() : null,
|
|
2688
2701
|
tag_closing: this.tag_closing ? this.tag_closing.toJSON() : null,
|
|
2702
|
+
then_keyword: this.then_keyword ? this.then_keyword.toJSON() : null,
|
|
2689
2703
|
statements: this.statements.map(node => node.toJSON()),
|
|
2690
2704
|
else_clause: this.else_clause ? this.else_clause.toJSON() : null,
|
|
2691
2705
|
end_node: this.end_node ? this.end_node.toJSON() : null,
|
|
@@ -2698,6 +2712,7 @@
|
|
|
2698
2712
|
output += `├── tag_opening: ${this.tag_opening ? this.tag_opening.treeInspect() : "∅"}\n`;
|
|
2699
2713
|
output += `├── content: ${this.content ? this.content.treeInspect() : "∅"}\n`;
|
|
2700
2714
|
output += `├── tag_closing: ${this.tag_closing ? this.tag_closing.treeInspect() : "∅"}\n`;
|
|
2715
|
+
output += `├── then_keyword: ${this.then_keyword ? "(location: " + this.then_keyword.treeInspect() + ")" : "∅"}\n`;
|
|
2701
2716
|
output += `├── statements: ${this.inspectArray(this.statements, "│ ")}`;
|
|
2702
2717
|
output += `├── else_clause: ${this.inspectNode(this.else_clause, "│ ")}`;
|
|
2703
2718
|
output += `└── end_node: ${this.inspectNode(this.end_node, " ")}`;
|
|
@@ -2764,6 +2779,7 @@
|
|
|
2764
2779
|
tag_opening;
|
|
2765
2780
|
content;
|
|
2766
2781
|
tag_closing;
|
|
2782
|
+
then_keyword;
|
|
2767
2783
|
statements;
|
|
2768
2784
|
static get type() {
|
|
2769
2785
|
return "AST_ERB_IN_NODE";
|
|
@@ -2776,6 +2792,7 @@
|
|
|
2776
2792
|
tag_opening: data.tag_opening ? Token.from(data.tag_opening) : null,
|
|
2777
2793
|
content: data.content ? Token.from(data.content) : null,
|
|
2778
2794
|
tag_closing: data.tag_closing ? Token.from(data.tag_closing) : null,
|
|
2795
|
+
then_keyword: data.then_keyword ? Location.from(data.then_keyword) : null,
|
|
2779
2796
|
statements: (data.statements || []).map(node => fromSerializedNode(node)),
|
|
2780
2797
|
});
|
|
2781
2798
|
}
|
|
@@ -2784,6 +2801,7 @@
|
|
|
2784
2801
|
this.tag_opening = props.tag_opening;
|
|
2785
2802
|
this.content = props.content;
|
|
2786
2803
|
this.tag_closing = props.tag_closing;
|
|
2804
|
+
this.then_keyword = props.then_keyword;
|
|
2787
2805
|
this.statements = props.statements;
|
|
2788
2806
|
}
|
|
2789
2807
|
accept(visitor) {
|
|
@@ -2810,6 +2828,7 @@
|
|
|
2810
2828
|
tag_opening: this.tag_opening ? this.tag_opening.toJSON() : null,
|
|
2811
2829
|
content: this.content ? this.content.toJSON() : null,
|
|
2812
2830
|
tag_closing: this.tag_closing ? this.tag_closing.toJSON() : null,
|
|
2831
|
+
then_keyword: this.then_keyword ? this.then_keyword.toJSON() : null,
|
|
2813
2832
|
statements: this.statements.map(node => node.toJSON()),
|
|
2814
2833
|
};
|
|
2815
2834
|
}
|
|
@@ -2820,6 +2839,7 @@
|
|
|
2820
2839
|
output += `├── tag_opening: ${this.tag_opening ? this.tag_opening.treeInspect() : "∅"}\n`;
|
|
2821
2840
|
output += `├── content: ${this.content ? this.content.treeInspect() : "∅"}\n`;
|
|
2822
2841
|
output += `├── tag_closing: ${this.tag_closing ? this.tag_closing.treeInspect() : "∅"}\n`;
|
|
2842
|
+
output += `├── then_keyword: ${this.then_keyword ? "(location: " + this.then_keyword.treeInspect() + ")" : "∅"}\n`;
|
|
2823
2843
|
output += `└── statements: ${this.inspectArray(this.statements, " ")}`;
|
|
2824
2844
|
return output;
|
|
2825
2845
|
}
|
|
@@ -2986,7 +3006,7 @@
|
|
|
2986
3006
|
}
|
|
2987
3007
|
|
|
2988
3008
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2989
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
3009
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.9/templates/javascript/packages/core/src/node-type-guards.ts.erb
|
|
2990
3010
|
/**
|
|
2991
3011
|
* Type guard functions for AST nodes.
|
|
2992
3012
|
* These functions provide type checking by combining both instanceof
|
|
@@ -4066,7 +4086,7 @@
|
|
|
4066
4086
|
}
|
|
4067
4087
|
|
|
4068
4088
|
var name = "@herb-tools/core";
|
|
4069
|
-
var version = "0.8.
|
|
4089
|
+
var version = "0.8.9";
|
|
4070
4090
|
var packageJSON = {
|
|
4071
4091
|
name: name,
|
|
4072
4092
|
version: version};
|
|
@@ -4289,7 +4309,7 @@
|
|
|
4289
4309
|
}
|
|
4290
4310
|
|
|
4291
4311
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
4292
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
4312
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.9/templates/javascript/packages/core/src/visitor.ts.erb
|
|
4293
4313
|
class Visitor {
|
|
4294
4314
|
visit(node) {
|
|
4295
4315
|
if (!node)
|