MG: scanner now understands $IF defined(identifier)

git-svn-id: trunk@1802 -
This commit is contained in:
lazarus 2002-07-31 09:18:50 +00:00
parent cdbfb43a99
commit eda6857479

View File

@ -251,11 +251,29 @@ begin
else if (Result='') then ErrorPos:=CurPos
else Result:='0';
exit;
end else if (CompAtom('DEFINED')) then begin
// read DEFINED(identifier)
if (Result<>'') or (not ReadNextAtom) or (CompAtom('(')=false)
or (not ReadNextAtom) then begin
ErrorPos:=CurPos;
exit;
end;
Result:=Variables[copy(Expr,AtomStart,AtomEnd-AtomStart)];
if Result<>'' then
Result:='1'
else
Result:='0';
if (not ReadNextAtom) then begin
ErrorPos:=CurPos;
exit;
end;
end else begin
// Identifier
if (Result<>'') then begin
ErrorPos:=CurPos; exit;
end else Result:=Variables[copy(Expr,AtomStart,AtomEnd-AtomStart)];
ErrorPos:=CurPos;
exit;
end else
Result:=Variables[copy(Expr,AtomStart,AtomEnd-AtomStart)];
end;
end else if IsNumberBeginChar[c] then begin
// number