X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fshared%2Fxparser.pas;h=7263b7db60037eef69dba6c49ffa9b6cac5a3108;hb=6d6df4e3427cd01e03e172984c9d0d391ff38032;hp=d0f0d3af202bef33b10715f495e13db098ce7dd3;hpb=223356cbae3197afc861efa6241c4ae91bd92885;p=d2df-sdl.git diff --git a/src/shared/xparser.pas b/src/shared/xparser.pas index d0f0d3a..7263b7d 100644 --- a/src/shared/xparser.pas +++ b/src/shared/xparser.pas @@ -177,6 +177,11 @@ uses SysUtils, utils; +// ////////////////////////////////////////////////////////////////////////// // +function StrEqu (const a, b: AnsiString): Boolean; inline; begin result := (a = b); end; + + +// ////////////////////////////////////////////////////////////////////////// // var wc2shitmap: array[0..65535] of AnsiChar; wc2shitmapInited: Boolean = false; @@ -528,7 +533,7 @@ end; procedure TTextParser.expectId (const aid: AnsiString); begin - if (mTokType <> TTId) or (CompareText(mTokStr, aid) <> 0) then raise Exception.Create('identifier '''+aid+''' expected'); + if (mTokType <> TTId) or (not StrEqu(mTokStr, aid)) then raise Exception.Create('identifier '''+aid+''' expected'); skipToken(); end; @@ -536,7 +541,7 @@ end; function TTextParser.eatId (const aid: AnsiString): Boolean; begin result := false; - if (mTokType <> TTId) or (CompareText(mTokStr, aid) <> 0) then exit; + if (mTokType <> TTId) or (not StrEqu(mTokStr, aid)) then exit; result := true; skipToken(); end;