X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fshared%2Fxparser.pas;h=0f2c2ece5b06731f2a18d6c4a46dcf15e445f7d3;hb=345e116f73d0e4b11593a94bee7d18b9e64572eb;hp=b985f1a30a781724b03a058c5b644621b9d0c851;hpb=fe568f37c781a2433440cd0033f557fd499d1e93;p=d2df-sdl.git diff --git a/src/shared/xparser.pas b/src/shared/xparser.pas index b985f1a..0f2c2ec 100644 --- a/src/shared/xparser.pas +++ b/src/shared/xparser.pas @@ -106,6 +106,8 @@ type function skipToken1 (): Boolean; {$ENDIF} + function isIdOrStr (): Boolean; inline; + function expectId (): AnsiString; procedure expectId (const aid: AnsiString; caseSens: Boolean=true); function eatId (const aid: AnsiString; caseSens: Boolean=true): Boolean; @@ -650,6 +652,12 @@ begin end; +function TTextParser.isIdOrStr (): Boolean; inline; +begin + result := (mTokType = TTId) or (mTokType = TTStr); +end; + + function TTextParser.expectId (): AnsiString; begin if (mTokType <> TTId) then raise Exception.Create('identifier expected');