diff --git a/src/shared/exoma.pas b/src/shared/exoma.pas
index 8616b7ba21d138914aaf2f109b91c7669799f7ef..1931dbbee9c973bbbf4840714fbe4fdcda91f8fe 100644 (file)
--- a/src/shared/exoma.pas
+++ b/src/shared/exoma.pas
interface
uses
interface
uses
- typinfo, SysUtils, Variants, hashtable, xparser;
+ typinfo, SysUtils, Variants, mempool, hashtable, xparser;
// ////////////////////////////////////////////////////////////////////////// //
// ////////////////////////////////////////////////////////////////////////// //
// ////////////////////////////////////////////////////////////////////////// //
type
// ////////////////////////////////////////////////////////////////////////// //
type
- TPropHash = class
+ TPropHash = class(TPoolObject)
private
mClass: TClass;
mNames: THashStrInt;
private
mClass: TClass;
mNames: THashStrInt;
// ////////////////////////////////////////////////////////////////////////// //
type
// ////////////////////////////////////////////////////////////////////////// //
type
- TExprConstList = class
+ TExprConstList = class(TPoolObject)
public
function valid (const cname: AnsiString): Boolean; virtual; abstract;
function get (const cname: AnsiString; out v: Variant): Boolean; virtual; abstract;
public
function valid (const cname: AnsiString): Boolean; virtual; abstract;
function get (const cname: AnsiString; out v: Variant): Boolean; virtual; abstract;
// ////////////////////////////////////////////////////////////////////////// //
type
// ////////////////////////////////////////////////////////////////////////// //
type
- TExprScope = class
+ TExprScope = class(TPoolObject)
public
class procedure error (const amsg: AnsiString);
class procedure errorfmt (const afmt: AnsiString; const args: array of const);
public
class procedure error (const amsg: AnsiString);
class procedure errorfmt (const afmt: AnsiString; const args: array of const);
procedure setField (obj: TObject; const afldname: AnsiString; var aval: Variant); virtual;
end;
procedure setField (obj: TObject; const afldname: AnsiString; var aval: Variant); virtual;
end;
- TExprBase = class
+ TExprBase = class(TPoolObject)
public
class function coerce2bool (var v0: Variant): Boolean;
class function toInt (var v: Variant): LongInt;
public
class function coerce2bool (var v0: Variant): Boolean;
class function toInt (var v: Variant): LongInt;
try
while true do
begin
try
while true do
begin
- while pr.eatTT(pr.TTSemi) do begin end;
+ while pr.eatDelim(';') do begin end;
if (pr.tokType = pr.TTEOF) then break;
e := parse(clist, pr, true);
if (e = nil) then break;
if (pr.tokType = pr.TTEOF) then break;
e := parse(clist, pr, true);
if (e = nil) then break;
if (pr.tokType = pr.TTEOF) then break;
//writeln('tt=', pr.tokType, ' <', pr.tokStr, '>');
//writeln(r.toString());
if (pr.tokType = pr.TTEOF) then break;
//writeln('tt=', pr.tokType, ' <', pr.tokStr, '>');
//writeln(r.toString());
- pr.expectTT(pr.TTSemi);
+ pr.expectDelim(';');
end;
result := r;
r := nil;
end;
result := r;
r := nil;
@@ -1130,7 +1130,7 @@ class function TExprBase.parse (clist: TExprConstList; pr: TTextParser; allowAss
e := doLogOr();
if neg then e := TUnExprNeg.Create(e);
if allowAssign and pr.eatDelim('=') then e := TBinAssign.Create(e, expr());
e := doLogOr();
if neg then e := TUnExprNeg.Create(e);
if allowAssign and pr.eatDelim('=') then e := TBinAssign.Create(e, expr());
- if not pr.eatTT(pr.TTComma) then
+ if not pr.eatDelim(',') then
begin
if (result = nil) then result := e else list.append(e);
break;
begin
if (result = nil) then result := e else list.append(e);
break;
@@ -1162,7 +1162,7 @@ class function TExprBase.parse (clist: TExprConstList; pr: TTextParser; allowAss
c.mCond := result;
try
c.mTrue := expr();
c.mCond := result;
try
c.mTrue := expr();
- pr.expectTT(pr.TTColon);
+ pr.expectDelim(':');
c.mFalse := expr();
result := c;
except
c.mFalse := expr();
result := c;
except
@@ -1172,16 +1172,16 @@ class function TExprBase.parse (clist: TExprConstList; pr: TTextParser; allowAss
end;
var
end;
var
- oas: Boolean;
+ oas: TTextParser.TOptions;
begin
if (pr = nil) or (pr.tokType = pr.TTEOF) then begin result := nil; exit; end;
begin
if (pr = nil) or (pr.tokType = pr.TTEOF) then begin result := nil; exit; end;
- oas := pr.allowSignedNumbers;
+ oas := pr.options;
try
try
- pr.allowSignedNumbers := false;
+ pr.options := pr.options-[pr.TOption.SignedNumbers];
try
result := expr();
finally
try
result := expr();
finally
- pr.allowSignedNumbers := oas;
+ pr.options := oas;
end;
except
on e: TExomaException do
end;
except
on e: TExomaException do