Comment in AST script
This commit is contained in:
@@ -178,8 +178,26 @@ end;
|
||||
|
||||
function TLexer.GetNextToken: TToken;
|
||||
begin
|
||||
while (FCurrentPos <= Length(FSource)) and FSource[FCurrentPos].IsWhiteSpace do
|
||||
Advance;
|
||||
// Skip whitespace and comments
|
||||
while FCurrentPos <= Length(FSource) do
|
||||
begin
|
||||
if FSource[FCurrentPos].IsWhiteSpace then
|
||||
begin
|
||||
Advance;
|
||||
continue;
|
||||
end;
|
||||
|
||||
if FSource[FCurrentPos] = ';' then
|
||||
begin
|
||||
// Comment found, skip to the end of the line
|
||||
while (FCurrentPos <= Length(FSource)) and (not CharInSet(FSource[FCurrentPos], [#10, #13])) do
|
||||
Advance;
|
||||
continue;
|
||||
end;
|
||||
|
||||
// No whitespace or comment, so break out and process the token
|
||||
break;
|
||||
end;
|
||||
|
||||
if FCurrentPos > Length(FSource) then
|
||||
begin
|
||||
@@ -445,7 +463,6 @@ begin
|
||||
end;
|
||||
|
||||
{ TPrettyPrintVisitor }
|
||||
// ... (Implementation of TPrettyPrintVisitor is unchanged and correct) ...
|
||||
constructor TPrettyPrintVisitor.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
|
||||
Reference in New Issue
Block a user