Skip to content

Commit 9c9b12e

Browse files
committed
Corrections to AST
1 parent c5c3caf commit 9c9b12e

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/Acornima/Ast/CatchClause.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Acornima.Ast;
55
[VisitableNode(ChildProperties = new[] { nameof(Param), nameof(Body) })]
66
public sealed partial class CatchClause : Node
77
{
8-
public CatchClause(Node? param, BlockStatement body)
8+
public CatchClause(Node? param, NestedBlockStatement body)
99
: base(NodeType.CatchClause)
1010
{
1111
Param = param;
@@ -16,9 +16,9 @@ public CatchClause(Node? param, BlockStatement body)
1616
/// <see cref="Identifier"/> | <see cref="ArrayPattern"/> | <see cref="ObjectPattern"/> | <see langword="null"/>
1717
/// </remarks>
1818
public Node? Param { [MethodImpl(MethodImplOptions.AggressiveInlining)] get; }
19-
public BlockStatement Body { [MethodImpl(MethodImplOptions.AggressiveInlining)] get; }
19+
public NestedBlockStatement Body { [MethodImpl(MethodImplOptions.AggressiveInlining)] get; }
2020

21-
private CatchClause Rewrite(Node? param, BlockStatement body)
21+
private CatchClause Rewrite(Node? param, NestedBlockStatement body)
2222
{
2323
return new CatchClause(param, body);
2424
}

src/Acornima/Ast/ClassBody.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public ClassBody(in NodeList<Node> body)
1414
}
1515

1616
/// <remarks>
17-
/// { <see cref="MethodDefinition"/> | <see cref="PropertyDefinition"/> | <see cref="StaticBlock"/> }
17+
/// { <see cref="PropertyDefinition"/> | <see cref="AccessorProperty"/> | <see cref="MethodDefinition"/> | <see cref="StaticBlock"/> }
1818
/// </remarks>
1919
public ref readonly NodeList<Node> Body { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => ref _body; }
2020

src/Acornima/Ast/TryStatement.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ namespace Acornima.Ast;
66
public sealed partial class TryStatement : Statement
77
{
88
public TryStatement(
9-
BlockStatement block,
9+
NestedBlockStatement block,
1010
CatchClause? handler,
11-
BlockStatement? finalizer)
11+
NestedBlockStatement? finalizer)
1212
: base(NodeType.TryStatement)
1313
{
1414
Block = block;
1515
Handler = handler;
1616
Finalizer = finalizer;
1717
}
1818

19-
public BlockStatement Block { [MethodImpl(MethodImplOptions.AggressiveInlining)] get; }
19+
public NestedBlockStatement Block { [MethodImpl(MethodImplOptions.AggressiveInlining)] get; }
2020
public CatchClause? Handler { [MethodImpl(MethodImplOptions.AggressiveInlining)] get; }
21-
public BlockStatement? Finalizer { [MethodImpl(MethodImplOptions.AggressiveInlining)] get; }
21+
public NestedBlockStatement? Finalizer { [MethodImpl(MethodImplOptions.AggressiveInlining)] get; }
2222

23-
private TryStatement Rewrite(BlockStatement block, CatchClause? handler, BlockStatement? finalizer)
23+
private TryStatement Rewrite(NestedBlockStatement block, CatchClause? handler, NestedBlockStatement? finalizer)
2424
{
2525
return new TryStatement(block, handler, finalizer);
2626
}

src/Acornima/Parser.Statement.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ private TryStatement ParseTryStatement(in Marker startMarker)
776776
handler = FinishNode(clauseStartMarker, new CatchClause(param, body));
777777
}
778778

779-
BlockStatement? finalizer;
779+
NestedBlockStatement? finalizer;
780780
if (Eat(TokenType.Finally))
781781
{
782782
blockStartMarker = StartNode();
@@ -899,7 +899,7 @@ private ExpressionStatement ParseExpressionStatement(in Marker startMarker, Expr
899899
// Parse a semicolon-enclosed block of statements, handling `"use
900900
// strict"` declarations when `allowStrict` is true (used for
901901
// function bodies).
902-
private BlockStatement ParseBlockStatement(in Marker startMarker, bool createNewLexicalScope = true)
902+
private NestedBlockStatement ParseBlockStatement(in Marker startMarker, bool createNewLexicalScope = true)
903903
{
904904
// NOTE: This method doesn't exist in acornjs, was added for consistency.
905905

0 commit comments

Comments
 (0)