@herb-tools/core 0.8.6 → 0.8.8
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/types/nodes.d.ts
CHANGED
|
@@ -469,6 +469,7 @@ export interface SerializedERBIfNode extends SerializedNode {
|
|
|
469
469
|
tag_opening: SerializedToken | null;
|
|
470
470
|
content: SerializedToken | null;
|
|
471
471
|
tag_closing: SerializedToken | null;
|
|
472
|
+
then_keyword: SerializedLocation | null;
|
|
472
473
|
statements: SerializedNode[];
|
|
473
474
|
subsequent: SerializedNode | null;
|
|
474
475
|
end_node: SerializedERBEndNode | null;
|
|
@@ -477,6 +478,7 @@ export interface ERBIfNodeProps extends BaseNodeProps {
|
|
|
477
478
|
tag_opening: Token | null;
|
|
478
479
|
content: Token | null;
|
|
479
480
|
tag_closing: Token | null;
|
|
481
|
+
then_keyword: Location | null;
|
|
480
482
|
statements: Node[];
|
|
481
483
|
subsequent: Node | null;
|
|
482
484
|
end_node: ERBEndNode | null;
|
|
@@ -485,6 +487,7 @@ export declare class ERBIfNode extends Node {
|
|
|
485
487
|
readonly tag_opening: Token | null;
|
|
486
488
|
readonly content: Token | null;
|
|
487
489
|
readonly tag_closing: Token | null;
|
|
490
|
+
readonly then_keyword: Location | null;
|
|
488
491
|
readonly statements: Node[];
|
|
489
492
|
readonly subsequent: Node | null;
|
|
490
493
|
readonly end_node: ERBEndNode | null;
|
|
@@ -534,18 +537,21 @@ export interface SerializedERBWhenNode extends SerializedNode {
|
|
|
534
537
|
tag_opening: SerializedToken | null;
|
|
535
538
|
content: SerializedToken | null;
|
|
536
539
|
tag_closing: SerializedToken | null;
|
|
540
|
+
then_keyword: SerializedLocation | null;
|
|
537
541
|
statements: SerializedNode[];
|
|
538
542
|
}
|
|
539
543
|
export interface ERBWhenNodeProps extends BaseNodeProps {
|
|
540
544
|
tag_opening: Token | null;
|
|
541
545
|
content: Token | null;
|
|
542
546
|
tag_closing: Token | null;
|
|
547
|
+
then_keyword: Location | null;
|
|
543
548
|
statements: Node[];
|
|
544
549
|
}
|
|
545
550
|
export declare class ERBWhenNode extends Node {
|
|
546
551
|
readonly tag_opening: Token | null;
|
|
547
552
|
readonly content: Token | null;
|
|
548
553
|
readonly tag_closing: Token | null;
|
|
554
|
+
readonly then_keyword: Location | null;
|
|
549
555
|
readonly statements: Node[];
|
|
550
556
|
static get type(): NodeType;
|
|
551
557
|
static from(data: SerializedERBWhenNode): ERBWhenNode;
|
|
@@ -828,6 +834,7 @@ export interface SerializedERBUnlessNode extends SerializedNode {
|
|
|
828
834
|
tag_opening: SerializedToken | null;
|
|
829
835
|
content: SerializedToken | null;
|
|
830
836
|
tag_closing: SerializedToken | null;
|
|
837
|
+
then_keyword: SerializedLocation | null;
|
|
831
838
|
statements: SerializedNode[];
|
|
832
839
|
else_clause: SerializedERBElseNode | null;
|
|
833
840
|
end_node: SerializedERBEndNode | null;
|
|
@@ -836,6 +843,7 @@ export interface ERBUnlessNodeProps extends BaseNodeProps {
|
|
|
836
843
|
tag_opening: Token | null;
|
|
837
844
|
content: Token | null;
|
|
838
845
|
tag_closing: Token | null;
|
|
846
|
+
then_keyword: Location | null;
|
|
839
847
|
statements: Node[];
|
|
840
848
|
else_clause: ERBElseNode | null;
|
|
841
849
|
end_node: ERBEndNode | null;
|
|
@@ -844,6 +852,7 @@ export declare class ERBUnlessNode extends Node {
|
|
|
844
852
|
readonly tag_opening: Token | null;
|
|
845
853
|
readonly content: Token | null;
|
|
846
854
|
readonly tag_closing: Token | null;
|
|
855
|
+
readonly then_keyword: Location | null;
|
|
847
856
|
readonly statements: Node[];
|
|
848
857
|
readonly else_clause: ERBElseNode | null;
|
|
849
858
|
readonly end_node: ERBEndNode | null;
|
|
@@ -887,18 +896,21 @@ export interface SerializedERBInNode extends SerializedNode {
|
|
|
887
896
|
tag_opening: SerializedToken | null;
|
|
888
897
|
content: SerializedToken | null;
|
|
889
898
|
tag_closing: SerializedToken | null;
|
|
899
|
+
then_keyword: SerializedLocation | null;
|
|
890
900
|
statements: SerializedNode[];
|
|
891
901
|
}
|
|
892
902
|
export interface ERBInNodeProps extends BaseNodeProps {
|
|
893
903
|
tag_opening: Token | null;
|
|
894
904
|
content: Token | null;
|
|
895
905
|
tag_closing: Token | null;
|
|
906
|
+
then_keyword: Location | null;
|
|
896
907
|
statements: Node[];
|
|
897
908
|
}
|
|
898
909
|
export declare class ERBInNode extends Node {
|
|
899
910
|
readonly tag_opening: Token | null;
|
|
900
911
|
readonly content: Token | null;
|
|
901
912
|
readonly tag_closing: Token | null;
|
|
913
|
+
readonly then_keyword: Location | null;
|
|
902
914
|
readonly statements: Node[];
|
|
903
915
|
static get type(): NodeType;
|
|
904
916
|
static from(data: SerializedERBInNode): ERBInNode;
|
package/package.json
CHANGED
package/src/errors.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.8/templates/javascript/packages/core/src/errors.ts.erb
|
|
3
3
|
|
|
4
4
|
import { Location, SerializedLocation } from "./location.js"
|
|
5
5
|
import { Token, SerializedToken } from "./token.js"
|
package/src/node-type-guards.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.8/templates/javascript/packages/core/src/node-type-guards.ts.erb
|
|
3
3
|
|
|
4
4
|
import type { Node, NodeType, ERBNode } from "./nodes.js"
|
|
5
5
|
|
package/src/nodes.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.8/templates/javascript/packages/core/src/nodes.ts.erb
|
|
3
3
|
|
|
4
4
|
import { Location } from "./location.js"
|
|
5
5
|
import { Token, SerializedToken } from "./token.js"
|
|
@@ -1569,6 +1569,7 @@ export interface SerializedERBIfNode extends SerializedNode {
|
|
|
1569
1569
|
tag_opening: SerializedToken | null;
|
|
1570
1570
|
content: SerializedToken | null;
|
|
1571
1571
|
tag_closing: SerializedToken | null;
|
|
1572
|
+
then_keyword: SerializedLocation | null;
|
|
1572
1573
|
statements: SerializedNode[];
|
|
1573
1574
|
subsequent: SerializedNode | null;
|
|
1574
1575
|
end_node: SerializedERBEndNode | null;
|
|
@@ -1578,6 +1579,7 @@ export interface ERBIfNodeProps extends BaseNodeProps {
|
|
|
1578
1579
|
tag_opening: Token | null;
|
|
1579
1580
|
content: Token | null;
|
|
1580
1581
|
tag_closing: Token | null;
|
|
1582
|
+
then_keyword: Location | null;
|
|
1581
1583
|
statements: Node[];
|
|
1582
1584
|
subsequent: Node | null;
|
|
1583
1585
|
end_node: ERBEndNode | null;
|
|
@@ -1587,6 +1589,7 @@ export class ERBIfNode extends Node {
|
|
|
1587
1589
|
readonly tag_opening: Token | null;
|
|
1588
1590
|
readonly content: Token | null;
|
|
1589
1591
|
readonly tag_closing: Token | null;
|
|
1592
|
+
readonly then_keyword: Location | null;
|
|
1590
1593
|
readonly statements: Node[];
|
|
1591
1594
|
readonly subsequent: Node | null;
|
|
1592
1595
|
readonly end_node: ERBEndNode | null;
|
|
@@ -1603,6 +1606,7 @@ export class ERBIfNode extends Node {
|
|
|
1603
1606
|
tag_opening: data.tag_opening ? Token.from(data.tag_opening) : null,
|
|
1604
1607
|
content: data.content ? Token.from(data.content) : null,
|
|
1605
1608
|
tag_closing: data.tag_closing ? Token.from(data.tag_closing) : null,
|
|
1609
|
+
then_keyword: data.then_keyword ? Location.from(data.then_keyword) : null,
|
|
1606
1610
|
statements: (data.statements || []).map(node => fromSerializedNode(node)),
|
|
1607
1611
|
subsequent: data.subsequent ? fromSerializedNode((data.subsequent)) : null,
|
|
1608
1612
|
end_node: data.end_node ? fromSerializedNode((data.end_node)) : null,
|
|
@@ -1614,6 +1618,7 @@ export class ERBIfNode extends Node {
|
|
|
1614
1618
|
this.tag_opening = props.tag_opening;
|
|
1615
1619
|
this.content = props.content;
|
|
1616
1620
|
this.tag_closing = props.tag_closing;
|
|
1621
|
+
this.then_keyword = props.then_keyword;
|
|
1617
1622
|
this.statements = props.statements;
|
|
1618
1623
|
this.subsequent = props.subsequent;
|
|
1619
1624
|
this.end_node = props.end_node;
|
|
@@ -1651,6 +1656,7 @@ export class ERBIfNode extends Node {
|
|
|
1651
1656
|
tag_opening: this.tag_opening ? this.tag_opening.toJSON() : null,
|
|
1652
1657
|
content: this.content ? this.content.toJSON() : null,
|
|
1653
1658
|
tag_closing: this.tag_closing ? this.tag_closing.toJSON() : null,
|
|
1659
|
+
then_keyword: this.then_keyword ? this.then_keyword.toJSON() : null,
|
|
1654
1660
|
statements: this.statements.map(node => node.toJSON()),
|
|
1655
1661
|
subsequent: this.subsequent ? this.subsequent.toJSON() : null,
|
|
1656
1662
|
end_node: this.end_node ? this.end_node.toJSON() : null,
|
|
@@ -1665,6 +1671,7 @@ export class ERBIfNode extends Node {
|
|
|
1665
1671
|
output += `├── tag_opening: ${this.tag_opening ? this.tag_opening.treeInspect() : "∅"}\n`;
|
|
1666
1672
|
output += `├── content: ${this.content ? this.content.treeInspect() : "∅"}\n`;
|
|
1667
1673
|
output += `├── tag_closing: ${this.tag_closing ? this.tag_closing.treeInspect() : "∅"}\n`;
|
|
1674
|
+
output += `├── then_keyword: ${this.then_keyword ? "(location: " + this.then_keyword.treeInspect() + ")" : "∅"}\n`;
|
|
1668
1675
|
output += `├── statements: ${this.inspectArray(this.statements, "│ ")}`;
|
|
1669
1676
|
output += `├── subsequent: ${this.inspectNode(this.subsequent, "│ ")}`;
|
|
1670
1677
|
output += `└── end_node: ${this.inspectNode(this.end_node, " ")}`;
|
|
@@ -1778,6 +1785,7 @@ export interface SerializedERBWhenNode extends SerializedNode {
|
|
|
1778
1785
|
tag_opening: SerializedToken | null;
|
|
1779
1786
|
content: SerializedToken | null;
|
|
1780
1787
|
tag_closing: SerializedToken | null;
|
|
1788
|
+
then_keyword: SerializedLocation | null;
|
|
1781
1789
|
statements: SerializedNode[];
|
|
1782
1790
|
}
|
|
1783
1791
|
|
|
@@ -1785,6 +1793,7 @@ export interface ERBWhenNodeProps extends BaseNodeProps {
|
|
|
1785
1793
|
tag_opening: Token | null;
|
|
1786
1794
|
content: Token | null;
|
|
1787
1795
|
tag_closing: Token | null;
|
|
1796
|
+
then_keyword: Location | null;
|
|
1788
1797
|
statements: Node[];
|
|
1789
1798
|
}
|
|
1790
1799
|
|
|
@@ -1792,6 +1801,7 @@ export class ERBWhenNode extends Node {
|
|
|
1792
1801
|
readonly tag_opening: Token | null;
|
|
1793
1802
|
readonly content: Token | null;
|
|
1794
1803
|
readonly tag_closing: Token | null;
|
|
1804
|
+
readonly then_keyword: Location | null;
|
|
1795
1805
|
readonly statements: Node[];
|
|
1796
1806
|
|
|
1797
1807
|
static get type(): NodeType {
|
|
@@ -1806,6 +1816,7 @@ export class ERBWhenNode extends Node {
|
|
|
1806
1816
|
tag_opening: data.tag_opening ? Token.from(data.tag_opening) : null,
|
|
1807
1817
|
content: data.content ? Token.from(data.content) : null,
|
|
1808
1818
|
tag_closing: data.tag_closing ? Token.from(data.tag_closing) : null,
|
|
1819
|
+
then_keyword: data.then_keyword ? Location.from(data.then_keyword) : null,
|
|
1809
1820
|
statements: (data.statements || []).map(node => fromSerializedNode(node)),
|
|
1810
1821
|
})
|
|
1811
1822
|
}
|
|
@@ -1815,6 +1826,7 @@ export class ERBWhenNode extends Node {
|
|
|
1815
1826
|
this.tag_opening = props.tag_opening;
|
|
1816
1827
|
this.content = props.content;
|
|
1817
1828
|
this.tag_closing = props.tag_closing;
|
|
1829
|
+
this.then_keyword = props.then_keyword;
|
|
1818
1830
|
this.statements = props.statements;
|
|
1819
1831
|
}
|
|
1820
1832
|
|
|
@@ -1846,6 +1858,7 @@ export class ERBWhenNode extends Node {
|
|
|
1846
1858
|
tag_opening: this.tag_opening ? this.tag_opening.toJSON() : null,
|
|
1847
1859
|
content: this.content ? this.content.toJSON() : null,
|
|
1848
1860
|
tag_closing: this.tag_closing ? this.tag_closing.toJSON() : null,
|
|
1861
|
+
then_keyword: this.then_keyword ? this.then_keyword.toJSON() : null,
|
|
1849
1862
|
statements: this.statements.map(node => node.toJSON()),
|
|
1850
1863
|
};
|
|
1851
1864
|
}
|
|
@@ -1858,6 +1871,7 @@ export class ERBWhenNode extends Node {
|
|
|
1858
1871
|
output += `├── tag_opening: ${this.tag_opening ? this.tag_opening.treeInspect() : "∅"}\n`;
|
|
1859
1872
|
output += `├── content: ${this.content ? this.content.treeInspect() : "∅"}\n`;
|
|
1860
1873
|
output += `├── tag_closing: ${this.tag_closing ? this.tag_closing.treeInspect() : "∅"}\n`;
|
|
1874
|
+
output += `├── then_keyword: ${this.then_keyword ? "(location: " + this.then_keyword.treeInspect() + ")" : "∅"}\n`;
|
|
1861
1875
|
output += `└── statements: ${this.inspectArray(this.statements, " ")}`;
|
|
1862
1876
|
|
|
1863
1877
|
return output
|
|
@@ -2723,6 +2737,7 @@ export interface SerializedERBUnlessNode extends SerializedNode {
|
|
|
2723
2737
|
tag_opening: SerializedToken | null;
|
|
2724
2738
|
content: SerializedToken | null;
|
|
2725
2739
|
tag_closing: SerializedToken | null;
|
|
2740
|
+
then_keyword: SerializedLocation | null;
|
|
2726
2741
|
statements: SerializedNode[];
|
|
2727
2742
|
else_clause: SerializedERBElseNode | null;
|
|
2728
2743
|
end_node: SerializedERBEndNode | null;
|
|
@@ -2732,6 +2747,7 @@ export interface ERBUnlessNodeProps extends BaseNodeProps {
|
|
|
2732
2747
|
tag_opening: Token | null;
|
|
2733
2748
|
content: Token | null;
|
|
2734
2749
|
tag_closing: Token | null;
|
|
2750
|
+
then_keyword: Location | null;
|
|
2735
2751
|
statements: Node[];
|
|
2736
2752
|
else_clause: ERBElseNode | null;
|
|
2737
2753
|
end_node: ERBEndNode | null;
|
|
@@ -2741,6 +2757,7 @@ export class ERBUnlessNode extends Node {
|
|
|
2741
2757
|
readonly tag_opening: Token | null;
|
|
2742
2758
|
readonly content: Token | null;
|
|
2743
2759
|
readonly tag_closing: Token | null;
|
|
2760
|
+
readonly then_keyword: Location | null;
|
|
2744
2761
|
readonly statements: Node[];
|
|
2745
2762
|
readonly else_clause: ERBElseNode | null;
|
|
2746
2763
|
readonly end_node: ERBEndNode | null;
|
|
@@ -2757,6 +2774,7 @@ export class ERBUnlessNode extends Node {
|
|
|
2757
2774
|
tag_opening: data.tag_opening ? Token.from(data.tag_opening) : null,
|
|
2758
2775
|
content: data.content ? Token.from(data.content) : null,
|
|
2759
2776
|
tag_closing: data.tag_closing ? Token.from(data.tag_closing) : null,
|
|
2777
|
+
then_keyword: data.then_keyword ? Location.from(data.then_keyword) : null,
|
|
2760
2778
|
statements: (data.statements || []).map(node => fromSerializedNode(node)),
|
|
2761
2779
|
else_clause: data.else_clause ? fromSerializedNode((data.else_clause)) : null,
|
|
2762
2780
|
end_node: data.end_node ? fromSerializedNode((data.end_node)) : null,
|
|
@@ -2768,6 +2786,7 @@ export class ERBUnlessNode extends Node {
|
|
|
2768
2786
|
this.tag_opening = props.tag_opening;
|
|
2769
2787
|
this.content = props.content;
|
|
2770
2788
|
this.tag_closing = props.tag_closing;
|
|
2789
|
+
this.then_keyword = props.then_keyword;
|
|
2771
2790
|
this.statements = props.statements;
|
|
2772
2791
|
this.else_clause = props.else_clause;
|
|
2773
2792
|
this.end_node = props.end_node;
|
|
@@ -2805,6 +2824,7 @@ export class ERBUnlessNode extends Node {
|
|
|
2805
2824
|
tag_opening: this.tag_opening ? this.tag_opening.toJSON() : null,
|
|
2806
2825
|
content: this.content ? this.content.toJSON() : null,
|
|
2807
2826
|
tag_closing: this.tag_closing ? this.tag_closing.toJSON() : null,
|
|
2827
|
+
then_keyword: this.then_keyword ? this.then_keyword.toJSON() : null,
|
|
2808
2828
|
statements: this.statements.map(node => node.toJSON()),
|
|
2809
2829
|
else_clause: this.else_clause ? this.else_clause.toJSON() : null,
|
|
2810
2830
|
end_node: this.end_node ? this.end_node.toJSON() : null,
|
|
@@ -2819,6 +2839,7 @@ export class ERBUnlessNode extends Node {
|
|
|
2819
2839
|
output += `├── tag_opening: ${this.tag_opening ? this.tag_opening.treeInspect() : "∅"}\n`;
|
|
2820
2840
|
output += `├── content: ${this.content ? this.content.treeInspect() : "∅"}\n`;
|
|
2821
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`;
|
|
2822
2843
|
output += `├── statements: ${this.inspectArray(this.statements, "│ ")}`;
|
|
2823
2844
|
output += `├── else_clause: ${this.inspectNode(this.else_clause, "│ ")}`;
|
|
2824
2845
|
output += `└── end_node: ${this.inspectNode(this.end_node, " ")}`;
|
|
@@ -2914,6 +2935,7 @@ export interface SerializedERBInNode extends SerializedNode {
|
|
|
2914
2935
|
tag_opening: SerializedToken | null;
|
|
2915
2936
|
content: SerializedToken | null;
|
|
2916
2937
|
tag_closing: SerializedToken | null;
|
|
2938
|
+
then_keyword: SerializedLocation | null;
|
|
2917
2939
|
statements: SerializedNode[];
|
|
2918
2940
|
}
|
|
2919
2941
|
|
|
@@ -2921,6 +2943,7 @@ export interface ERBInNodeProps extends BaseNodeProps {
|
|
|
2921
2943
|
tag_opening: Token | null;
|
|
2922
2944
|
content: Token | null;
|
|
2923
2945
|
tag_closing: Token | null;
|
|
2946
|
+
then_keyword: Location | null;
|
|
2924
2947
|
statements: Node[];
|
|
2925
2948
|
}
|
|
2926
2949
|
|
|
@@ -2928,6 +2951,7 @@ export class ERBInNode extends Node {
|
|
|
2928
2951
|
readonly tag_opening: Token | null;
|
|
2929
2952
|
readonly content: Token | null;
|
|
2930
2953
|
readonly tag_closing: Token | null;
|
|
2954
|
+
readonly then_keyword: Location | null;
|
|
2931
2955
|
readonly statements: Node[];
|
|
2932
2956
|
|
|
2933
2957
|
static get type(): NodeType {
|
|
@@ -2942,6 +2966,7 @@ export class ERBInNode extends Node {
|
|
|
2942
2966
|
tag_opening: data.tag_opening ? Token.from(data.tag_opening) : null,
|
|
2943
2967
|
content: data.content ? Token.from(data.content) : null,
|
|
2944
2968
|
tag_closing: data.tag_closing ? Token.from(data.tag_closing) : null,
|
|
2969
|
+
then_keyword: data.then_keyword ? Location.from(data.then_keyword) : null,
|
|
2945
2970
|
statements: (data.statements || []).map(node => fromSerializedNode(node)),
|
|
2946
2971
|
})
|
|
2947
2972
|
}
|
|
@@ -2951,6 +2976,7 @@ export class ERBInNode extends Node {
|
|
|
2951
2976
|
this.tag_opening = props.tag_opening;
|
|
2952
2977
|
this.content = props.content;
|
|
2953
2978
|
this.tag_closing = props.tag_closing;
|
|
2979
|
+
this.then_keyword = props.then_keyword;
|
|
2954
2980
|
this.statements = props.statements;
|
|
2955
2981
|
}
|
|
2956
2982
|
|
|
@@ -2982,6 +3008,7 @@ export class ERBInNode extends Node {
|
|
|
2982
3008
|
tag_opening: this.tag_opening ? this.tag_opening.toJSON() : null,
|
|
2983
3009
|
content: this.content ? this.content.toJSON() : null,
|
|
2984
3010
|
tag_closing: this.tag_closing ? this.tag_closing.toJSON() : null,
|
|
3011
|
+
then_keyword: this.then_keyword ? this.then_keyword.toJSON() : null,
|
|
2985
3012
|
statements: this.statements.map(node => node.toJSON()),
|
|
2986
3013
|
};
|
|
2987
3014
|
}
|
|
@@ -2994,6 +3021,7 @@ export class ERBInNode extends Node {
|
|
|
2994
3021
|
output += `├── tag_opening: ${this.tag_opening ? this.tag_opening.treeInspect() : "∅"}\n`;
|
|
2995
3022
|
output += `├── content: ${this.content ? this.content.treeInspect() : "∅"}\n`;
|
|
2996
3023
|
output += `├── tag_closing: ${this.tag_closing ? this.tag_closing.treeInspect() : "∅"}\n`;
|
|
3024
|
+
output += `├── then_keyword: ${this.then_keyword ? "(location: " + this.then_keyword.treeInspect() + ")" : "∅"}\n`;
|
|
2997
3025
|
output += `└── statements: ${this.inspectArray(this.statements, " ")}`;
|
|
2998
3026
|
|
|
2999
3027
|
return output
|
package/src/visitor.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.8/templates/javascript/packages/core/src/visitor.ts.erb
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
Node,
|