mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 03:09:32 +02:00
MG: scanner now understands $IF defined(identifier)
git-svn-id: trunk@1802 -
This commit is contained in:
parent
cdbfb43a99
commit
eda6857479
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user