mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 17:19:23 +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 if (Result='') then ErrorPos:=CurPos
|
||||||
else Result:='0';
|
else Result:='0';
|
||||||
exit;
|
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
|
end else begin
|
||||||
// Identifier
|
// Identifier
|
||||||
if (Result<>'') then begin
|
if (Result<>'') then begin
|
||||||
ErrorPos:=CurPos; exit;
|
ErrorPos:=CurPos;
|
||||||
end else Result:=Variables[copy(Expr,AtomStart,AtomEnd-AtomStart)];
|
exit;
|
||||||
|
end else
|
||||||
|
Result:=Variables[copy(Expr,AtomStart,AtomEnd-AtomStart)];
|
||||||
end;
|
end;
|
||||||
end else if IsNumberBeginChar[c] then begin
|
end else if IsNumberBeginChar[c] then begin
|
||||||
// number
|
// number
|
||||||
|
Loading…
Reference in New Issue
Block a user