@@ -33,6 +33,74 @@ export abstract class ExternalNode extends Node {
33
33
}
34
34
}
35
35
36
+ export class AugmentedNode extends ExternalNode {
37
+ constructor ( protected node : Node ) {
38
+ super ( ) ;
39
+ }
40
+
41
+ get parent ( ) {
42
+ if ( this . node . parent ) {
43
+ return new AugmentedNode ( this . node . parent ) ;
44
+ }
45
+ }
46
+
47
+ get nodeDefinition ( ) {
48
+ return this . node . nodeDefinition ;
49
+ }
50
+
51
+ setChild ( name : string , child : Node ) {
52
+ this . node . setChild ( name , child ) ;
53
+ }
54
+
55
+ addChild ( name : string , child : Node ) {
56
+ this . node . addChild ( name , child ) ;
57
+ }
58
+
59
+ setAttribute ( name : string | symbol , value : any ) {
60
+ this . node . setAttribute ( name , value ) ;
61
+ }
62
+
63
+ getAttribute ( name : string | symbol ) : any {
64
+ return this . node . getAttribute ( name ) ;
65
+ }
66
+
67
+ get ( ) : ExternalNode | undefined {
68
+ return undefined ;
69
+ }
70
+
71
+ getAttributes ( ) : { [ p : string ] : any } {
72
+ return { } ;
73
+ }
74
+
75
+ getId ( ) : string {
76
+ return "TODO" ;
77
+ }
78
+
79
+ getIssues ( ) : Issue [ ] | undefined {
80
+ return undefined ;
81
+ }
82
+
83
+ getPosition ( ) : Position | undefined {
84
+ return this . node . position ;
85
+ }
86
+
87
+ getRole ( ) : string | undefined {
88
+ return undefined ;
89
+ }
90
+
91
+ isDeclaration ( ) : boolean {
92
+ return false ;
93
+ }
94
+
95
+ isExpression ( ) : boolean {
96
+ return false ;
97
+ }
98
+
99
+ isStatement ( ) : boolean {
100
+ return false ;
101
+ }
102
+ }
103
+
36
104
export abstract class TraceNode extends Node {
37
105
38
106
abstract parent ?: TraceNode ;
0 commit comments