This PR adds support for the new feature.
This file:
unit InlineVariables;
interface
implementation
procedure ShowSomeVars;
var
ClassicVarI, ClassicVarJ: Integer;
begin
var NotInitializedI, NotInitializedJ: Integer;
var InitialiazedTypedI: Integer := 22;
var InferredI := 22;
const TypedConst: Integer = 50;
const InferredConst = 20;
for var TypedI: Integer := 1 to 10 do
begin
end;
for var TypedItem: TItemType in Collection do
begin
end;
for var InferredI := 1 to 10 do
begin
end;
for var InferredItem in Collection do
begin
end;
end;
end.
The upcoming Delphi 10.3 release will allow inline variables and constants. See http://blog.marcocantu.com/blog/2018-october-inline-variables-delphi.html
This PR adds support for the new feature. This file:
Looks like this in AST: