Node immutability improved
This commit is contained in:
+15
-13
@@ -454,9 +454,10 @@ begin
|
||||
begin
|
||||
for var expr in rootNode.AsBlockExpression.Expressions do
|
||||
begin
|
||||
if expr is TVariableDeclarationNode then
|
||||
// Use interface 'is' check
|
||||
if (expr.Kind = akVariableDeclaration) then
|
||||
begin
|
||||
var decl := expr as TVariableDeclarationNode;
|
||||
var decl := expr.AsVariableDeclaration;
|
||||
definitions.Add(decl.Identifier.Name, decl.Initializer);
|
||||
end
|
||||
// Handle macro definitions inside the block
|
||||
@@ -468,9 +469,10 @@ begin
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else if rootNode is TVariableDeclarationNode then // Handle single definition
|
||||
// Use interface 'is' check
|
||||
else if rootNode.Kind = akVariableDeclaration then // Handle single definition
|
||||
begin
|
||||
var decl := rootNode as TVariableDeclarationNode;
|
||||
var decl := rootNode.AsVariableDeclaration;
|
||||
definitions.Add(decl.Identifier.Name, decl.Initializer);
|
||||
end
|
||||
// Handle a single macro definition
|
||||
@@ -828,7 +830,7 @@ begin
|
||||
TAst.VarDecl(
|
||||
TAst.Identifier('closeColumn'),
|
||||
TAst.FunctionCall(TAst.Keyword('Close'), [TAst.Identifier('ohlcvSeries')])
|
||||
// TAst.MemberAccess(TAst.Identifier('ohlcvSeries'), TAst.Identifier('Close'))
|
||||
// TAst.MemberAccess(TAst.Identifier('ohlcvSeries'), TAst.Identifier('Close'))
|
||||
),
|
||||
TAst.Indexer(TAst.Identifier('closeColumn'), TAst.Constant(1))
|
||||
]
|
||||
@@ -1348,14 +1350,14 @@ begin
|
||||
|
||||
FWorkspace.Build(FCurrUnboundAst, TPointF.Create(X, Y));
|
||||
//
|
||||
// if FCurrAst <> nil then
|
||||
// begin
|
||||
// FWorkspace.Build(FCurrAst, TPointF.Create(X, Y));
|
||||
// end
|
||||
// else if FCurrUnboundAst <> nil then
|
||||
// begin
|
||||
// FWorkspace.Build(FCurrUnboundAst, TPointF.Create(X, Y));
|
||||
// end;
|
||||
// if FCurrAst <> nil then
|
||||
// begin
|
||||
// FWorkspace.Build(FCurrAst, TPointF.Create(X, Y));
|
||||
// end
|
||||
// else if FCurrUnboundAst <> nil then
|
||||
// begin
|
||||
// FWorkspace.Build(FCurrUnboundAst, TPointF.Create(X, Y));
|
||||
// end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user