Ast series indexer
This commit is contained in:
@@ -33,6 +33,7 @@ type
|
||||
function VisitBlockExpression(const Node: IBlockExpressionNode): TAstValue;
|
||||
function VisitVariableDeclaration(const Node: IVariableDeclarationNode): TAstValue;
|
||||
function VisitAssignment(const Node: IAssignmentNode): TAstValue;
|
||||
function VisitIndexer(const Node: IIndexerNode): TAstValue;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@@ -64,12 +65,12 @@ end;
|
||||
|
||||
procedure TPrettyPrintVisitor.Indent;
|
||||
begin
|
||||
inc(FIndentLevel, 2);
|
||||
inc(FIndentLevel, 4);
|
||||
end;
|
||||
|
||||
procedure TPrettyPrintVisitor.Unindent;
|
||||
begin
|
||||
dec(FIndentLevel, 2);
|
||||
dec(FIndentLevel, 4);
|
||||
end;
|
||||
|
||||
procedure TPrettyPrintVisitor.AppendLine(const S: string);
|
||||
@@ -225,4 +226,20 @@ begin
|
||||
Result := TAstValue.Void;
|
||||
end;
|
||||
|
||||
function TPrettyPrintVisitor.VisitIndexer(const Node: IIndexerNode): TAstValue;
|
||||
begin
|
||||
AppendLine('Indexer');
|
||||
Indent;
|
||||
AppendLine('Base:');
|
||||
Indent;
|
||||
Node.Base.Accept(Self);
|
||||
Unindent;
|
||||
AppendLine('Index:');
|
||||
Indent;
|
||||
Node.Index.Accept(Self);
|
||||
Unindent;
|
||||
Unindent;
|
||||
Result := TAstValue.Void;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user