Skip to content

Commit c01abb0

Browse files
committed
Rename IVarScope to IHoistingScope
1 parent 723bd57 commit c01abb0

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,30 +67,31 @@ var ast = parser.ParseScript("console.log('Hello world!')");
6767

6868
```
6969
Node [x]
70-
├─ArrayPattern : IDestructuringPattern [v,s]
71-
├─AssignmentPattern : IDestructuringPattern [v,s]
70+
├─AssignmentPattern : IDestructuringElement [v,s]
7271
├─CatchClause [v,s]
7372
├─ClassBody [v,s]
7473
├─ClassProperty : IClassElement, IProperty
7574
│ ├─AccessorProperty : IClassElement, IProperty [v,s]
7675
│ ├─MethodDefinition : IClassElement, IProperty [v,s]
7776
│ └─PropertyDefinition : IClassElement, IProperty [v,s]
7877
├─Decorator [v,s]
78+
├─DestructuringPattern : IDestructuringElement
79+
│ ├─ArrayPattern : IDestructuringElement [v,s]
80+
│ └─ObjectPattern : IDestructuringElement [v,s]
7981
├─ImportAttribute [v,s]
8082
├─ModuleSpecifier
8183
│ ├─ExportSpecifier [v,s]
8284
│ └─ImportDeclarationSpecifier
8385
│ ├─ImportDefaultSpecifier [v,s]
8486
│ ├─ImportNamespaceSpecifier [v,s]
8587
│ └─ImportSpecifier [v,s]
86-
├─ObjectPattern : IDestructuringPattern [v,s]
87-
├─Program : IVarScope [v]
88-
│ ├─Module : IVarScope [s]
89-
│ └─Script : IVarScope [s]
88+
├─Program : IHoistingScope [v]
89+
│ ├─Module : IHoistingScope [s]
90+
│ └─Script : IHoistingScope [s]
9091
├─Property : IProperty [v]
9192
│ ├─AssignmentProperty : IProperty [s]
9293
│ └─ObjectProperty : IProperty [s]
93-
├─RestElement : IDestructuringPattern [v,s]
94+
├─RestElement : IDestructuringElement [v,s]
9495
├─StatementOrExpression
9596
│ ├─Expression [x]
9697
│ │ ├─ArrayExpression [v,s]
@@ -105,7 +106,7 @@ Node [x]
105106
│ │ ├─ClassExpression : IClass [v,s]
106107
│ │ ├─ConditionalExpression [v,s]
107108
│ │ ├─FunctionExpression : IFunction [v,s]
108-
│ │ ├─Identifier : IDestructuringPattern [v,s]
109+
│ │ ├─Identifier : IDestructuringElement [v,s]
109110
│ │ ├─ImportExpression [v,s]
110111
│ │ ├─Literal [v]
111112
│ │ │ ├─BigIntLiteral [s]
@@ -114,7 +115,7 @@ Node [x]
114115
│ │ │ ├─NumericLiteral [s]
115116
│ │ │ ├─RegExpLiteral [s]
116117
│ │ │ └─StringLiteral [s]
117-
│ │ ├─MemberExpression : IChainElement, IDestructuringPattern [v,s]
118+
│ │ ├─MemberExpression : IChainElement, IDestructuringElement [v,s]
118119
│ │ ├─MetaProperty [v,s]
119120
│ │ ├─NewExpression [v,s]
120121
│ │ ├─ObjectExpression [v,s]
@@ -132,9 +133,9 @@ Node [x]
132133
│ │ └─YieldExpression [v,s]
133134
│ └─Statement [x]
134135
│ ├─BlockStatement [v]
135-
│ │ ├─FunctionBody : IVarScope [s]
136+
│ │ ├─FunctionBody : IHoistingScope [s]
136137
│ │ ├─NestedBlockStatement [s]
137-
│ │ └─StaticBlock : IClassElement, IVarScope [v,s]
138+
│ │ └─StaticBlock : IClassElement, IHoistingScope [v,s]
138139
│ ├─BreakStatement [v,s]
139140
│ ├─ContinueStatement [v,s]
140141
│ ├─DebuggerStatement [v,s]

src/Acornima/Ast/FunctionBody.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Acornima.Ast;
44

5-
public sealed class FunctionBody : BlockStatement, IVarScope
5+
public sealed class FunctionBody : BlockStatement, IHoistingScope
66
{
77
public FunctionBody(in NodeList<Statement> body, bool strict)
88
: base(NodeType.BlockStatement, body)

src/Acornima/Ast/IVarScope.cs renamed to src/Acornima/Ast/IHoistingScope.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace Acornima.Ast;
22

3-
public interface IVarScope : INode
3+
public interface IHoistingScope : INode
44
{
55
ref readonly NodeList<Statement> Body { get; }
66
bool Strict { get; }

src/Acornima/Ast/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Acornima.Ast;
44

55
[VisitableNode(ChildProperties = new[] { nameof(Body) }, SealOverrideMethods = true)]
6-
public abstract partial class Program : Node, IVarScope
6+
public abstract partial class Program : Node, IHoistingScope
77
{
88
private readonly NodeList<Statement> _body;
99

src/Acornima/Ast/StaticBlock.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
namespace Acornima.Ast;
22

33
[VisitableNode(ChildProperties = new[] { nameof(Body) })]
4-
public sealed partial class StaticBlock : BlockStatement, IClassElement, IVarScope
4+
public sealed partial class StaticBlock : BlockStatement, IClassElement, IHoistingScope
55
{
66
public StaticBlock(in NodeList<Statement> body)
77
: base(NodeType.StaticBlock, body) { }
88

99
bool IClassElement.Static => true;
1010

11-
bool IVarScope.Strict => true;
11+
bool IHoistingScope.Strict => true;
1212

1313
public new StaticBlock UpdateWith(in NodeList<Statement> body)
1414
{

0 commit comments

Comments
 (0)