Hi, I have the following code
{$mode delphi}{$H+}
type
TToken = record
Typ: TTokenTyp;
...
end;
TTokens = array of TToken;
...
// variable Tokens is initalized to nil.
procedure TLexer.ScanTokens;
var
Token: TToken;
begin
repeat
Token := ScanToken;
Tokens += [Token];
until Token.Typ = ttEOF;
end;
Though I visually like this, I'm not sure if this is performance wise the best solution.
What happens behind the scenes of the array?
MacOs Catalina / FPC 3.3.1 / Laz 2.1.0