|
@@ -435,6 +435,7 @@ type
|
|
revkSetOfInt, // set of enum, int, char, widechar, e.g. [1,2..3]
|
|
revkSetOfInt, // set of enum, int, char, widechar, e.g. [1,2..3]
|
|
revkExternal // TResEvalExternal: an external const
|
|
revkExternal // TResEvalExternal: an external const
|
|
);
|
|
);
|
|
|
|
+ TREVKinds = set of TREVKind;
|
|
const
|
|
const
|
|
revkAllStrings = [{$ifdef FPC_HAS_CPSTRING}revkString,{$endif}revkUnicodeString];
|
|
revkAllStrings = [{$ifdef FPC_HAS_CPSTRING}revkString,{$endif}revkUnicodeString];
|
|
type
|
|
type
|
|
@@ -447,6 +448,7 @@ type
|
|
function Clone: TResEvalValue; virtual;
|
|
function Clone: TResEvalValue; virtual;
|
|
function AsDebugString: string; virtual;
|
|
function AsDebugString: string; virtual;
|
|
function AsString: string; virtual;
|
|
function AsString: string; virtual;
|
|
|
|
+ function TypeAsString: string; virtual;
|
|
end;
|
|
end;
|
|
TResEvalValueClass = class of TResEvalValue;
|
|
TResEvalValueClass = class of TResEvalValue;
|
|
|
|
|
|
@@ -459,6 +461,7 @@ type
|
|
constructor CreateValue(const aValue: boolean);
|
|
constructor CreateValue(const aValue: boolean);
|
|
function Clone: TResEvalValue; override;
|
|
function Clone: TResEvalValue; override;
|
|
function AsString: string; override;
|
|
function AsString: string; override;
|
|
|
|
+ function TypeAsString: string; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
TResEvalTypedInt = (
|
|
TResEvalTypedInt = (
|
|
@@ -520,6 +523,7 @@ type
|
|
function Clone: TResEvalValue; override;
|
|
function Clone: TResEvalValue; override;
|
|
function AsString: string; override;
|
|
function AsString: string; override;
|
|
function AsDebugString: string; override;
|
|
function AsDebugString: string; override;
|
|
|
|
+ function TypeAsString: string; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
{ TResEvalUInt }
|
|
{ TResEvalUInt }
|
|
@@ -531,6 +535,7 @@ type
|
|
constructor CreateValue(const aValue: TMaxPrecUInt);
|
|
constructor CreateValue(const aValue: TMaxPrecUInt);
|
|
function Clone: TResEvalValue; override;
|
|
function Clone: TResEvalValue; override;
|
|
function AsString: string; override;
|
|
function AsString: string; override;
|
|
|
|
+ function TypeAsString: string; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
{ TResEvalFloat }
|
|
{ TResEvalFloat }
|
|
@@ -543,6 +548,7 @@ type
|
|
function Clone: TResEvalValue; override;
|
|
function Clone: TResEvalValue; override;
|
|
function AsString: string; override;
|
|
function AsString: string; override;
|
|
function IsInt(out Int: TMaxPrecInt): boolean;
|
|
function IsInt(out Int: TMaxPrecInt): boolean;
|
|
|
|
+ function TypeAsString: string; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
{ TResEvalCurrency }
|
|
{ TResEvalCurrency }
|
|
@@ -556,6 +562,7 @@ type
|
|
function AsString: string; override;
|
|
function AsString: string; override;
|
|
function IsInt(out Int: TMaxPrecInt): boolean;
|
|
function IsInt(out Int: TMaxPrecInt): boolean;
|
|
function AsInt: TMaxPrecInt; // value * 10.000
|
|
function AsInt: TMaxPrecInt; // value * 10.000
|
|
|
|
+ function TypeAsString: string; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
{$ifdef FPC_HAS_CPSTRING}
|
|
{$ifdef FPC_HAS_CPSTRING}
|
|
@@ -569,6 +576,7 @@ type
|
|
constructor CreateValue(const aValue: RawByteString);
|
|
constructor CreateValue(const aValue: RawByteString);
|
|
function Clone: TResEvalValue; override;
|
|
function Clone: TResEvalValue; override;
|
|
function AsString: string; override;
|
|
function AsString: string; override;
|
|
|
|
+ function TypeAsString: string; override;
|
|
end;
|
|
end;
|
|
{$endif}
|
|
{$endif}
|
|
|
|
|
|
@@ -581,6 +589,7 @@ type
|
|
constructor CreateValue(const aValue: UnicodeString);
|
|
constructor CreateValue(const aValue: UnicodeString);
|
|
function Clone: TResEvalValue; override;
|
|
function Clone: TResEvalValue; override;
|
|
function AsString: string; override;
|
|
function AsString: string; override;
|
|
|
|
+ function TypeAsString: string; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
{ TResEvalEnum - Kind=revkEnum, Value.Int }
|
|
{ TResEvalEnum - Kind=revkEnum, Value.Int }
|
|
@@ -596,6 +605,7 @@ type
|
|
function Clone: TResEvalValue; override;
|
|
function Clone: TResEvalValue; override;
|
|
function AsDebugString: string; override;
|
|
function AsDebugString: string; override;
|
|
function AsString: string; override;
|
|
function AsString: string; override;
|
|
|
|
+ function TypeAsString: string; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
TRESetElKind = (
|
|
TRESetElKind = (
|
|
@@ -620,6 +630,7 @@ type
|
|
function AsString: string; override;
|
|
function AsString: string; override;
|
|
function AsDebugString: string; override;
|
|
function AsDebugString: string; override;
|
|
function ElementAsString(El: TMaxPrecInt): string; virtual;
|
|
function ElementAsString(El: TMaxPrecInt): string; virtual;
|
|
|
|
+ function TypeAsString: string; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
{ TResEvalRangeUInt }
|
|
{ TResEvalRangeUInt }
|
|
@@ -631,6 +642,7 @@ type
|
|
constructor CreateValue(const aRangeStart, aRangeEnd: TMaxPrecUInt);
|
|
constructor CreateValue(const aRangeStart, aRangeEnd: TMaxPrecUInt);
|
|
function Clone: TResEvalValue; override;
|
|
function Clone: TResEvalValue; override;
|
|
function AsString: string; override;
|
|
function AsString: string; override;
|
|
|
|
+ function TypeAsString: string; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
{ TResEvalSet - Kind=revkSetOfInt }
|
|
{ TResEvalSet - Kind=revkSetOfInt }
|
|
@@ -652,6 +664,7 @@ type
|
|
const aRangeStart, aRangeEnd: TMaxPrecInt); override;
|
|
const aRangeStart, aRangeEnd: TMaxPrecInt); override;
|
|
function Clone: TResEvalValue; override;
|
|
function Clone: TResEvalValue; override;
|
|
function AsString: string; override;
|
|
function AsString: string; override;
|
|
|
|
+ function TypeAsString: string; override;
|
|
function Add(aRangeStart, aRangeEnd: TMaxPrecInt): boolean; // false if duplicate ignored
|
|
function Add(aRangeStart, aRangeEnd: TMaxPrecInt): boolean; // false if duplicate ignored
|
|
function IndexOfRange(Index: TMaxPrecInt; FindInsertPos: boolean = false): integer;
|
|
function IndexOfRange(Index: TMaxPrecInt; FindInsertPos: boolean = false): integer;
|
|
function Intersects(aRangeStart, aRangeEnd: TMaxPrecInt): integer; // returns index of first intersecting range
|
|
function Intersects(aRangeStart, aRangeEnd: TMaxPrecInt): integer; // returns index of first intersecting range
|
|
@@ -665,6 +678,7 @@ type
|
|
constructor Create; override;
|
|
constructor Create; override;
|
|
function Clone: TResEvalValue; override;
|
|
function Clone: TResEvalValue; override;
|
|
function AsString: string; override;
|
|
function AsString: string; override;
|
|
|
|
+ function TypeAsString: string; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
TResEvalFlag = (
|
|
TResEvalFlag = (
|
|
@@ -1188,6 +1202,11 @@ begin
|
|
Result:=inherited AsString;
|
|
Result:=inherited AsString;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TResEvalExternal.TypeAsString: string;
|
|
|
|
+begin
|
|
|
|
+ Result:='external value';
|
|
|
|
+end;
|
|
|
|
+
|
|
{ TResEvalCurrency }
|
|
{ TResEvalCurrency }
|
|
|
|
|
|
constructor TResEvalCurrency.Create;
|
|
constructor TResEvalCurrency.Create;
|
|
@@ -1231,6 +1250,11 @@ begin
|
|
{$endif};
|
|
{$endif};
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TResEvalCurrency.TypeAsString: string;
|
|
|
|
+begin
|
|
|
|
+ Result:='currency';
|
|
|
|
+end;
|
|
|
|
+
|
|
{ TResEvalBool }
|
|
{ TResEvalBool }
|
|
|
|
|
|
constructor TResEvalBool.Create;
|
|
constructor TResEvalBool.Create;
|
|
@@ -1259,6 +1283,11 @@ begin
|
|
Result:='false';
|
|
Result:='false';
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TResEvalBool.TypeAsString: string;
|
|
|
|
+begin
|
|
|
|
+ Result:='boolean';
|
|
|
|
+end;
|
|
|
|
+
|
|
{ TResEvalRangeUInt }
|
|
{ TResEvalRangeUInt }
|
|
|
|
|
|
constructor TResEvalRangeUInt.Create;
|
|
constructor TResEvalRangeUInt.Create;
|
|
@@ -1287,6 +1316,11 @@ begin
|
|
Result:=IntToStr(RangeStart)+'..'+IntToStr(RangeEnd);
|
|
Result:=IntToStr(RangeStart)+'..'+IntToStr(RangeEnd);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TResEvalRangeUInt.TypeAsString: string;
|
|
|
|
+begin
|
|
|
|
+ Result:='unsigned integer range';
|
|
|
|
+end;
|
|
|
|
+
|
|
{ TResExprEvaluator }
|
|
{ TResExprEvaluator }
|
|
|
|
|
|
procedure TResExprEvaluator.LogMsg(const id: TMaxPrecInt; MsgType: TMessageType;
|
|
procedure TResExprEvaluator.LogMsg(const id: TMaxPrecInt; MsgType: TMessageType;
|
|
@@ -5615,6 +5649,15 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TResEvalValue.TypeAsString: string;
|
|
|
|
+begin
|
|
|
|
+ case Kind of
|
|
|
|
+ revkNil: Result:='nil';
|
|
|
|
+ else
|
|
|
|
+ Result:='';
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
{ TResEvalUInt }
|
|
{ TResEvalUInt }
|
|
|
|
|
|
constructor TResEvalUInt.Create;
|
|
constructor TResEvalUInt.Create;
|
|
@@ -5640,6 +5683,11 @@ begin
|
|
Result:=IntToStr(UInt);
|
|
Result:=IntToStr(UInt);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TResEvalUInt.TypeAsString: string;
|
|
|
|
+begin
|
|
|
|
+ Result:='unsigned int';
|
|
|
|
+end;
|
|
|
|
+
|
|
{ TResEvalInt }
|
|
{ TResEvalInt }
|
|
|
|
|
|
constructor TResEvalInt.Create;
|
|
constructor TResEvalInt.Create;
|
|
@@ -5697,6 +5745,24 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TResEvalInt.TypeAsString: string;
|
|
|
|
+begin
|
|
|
|
+ case Typed of
|
|
|
|
+ reitByte: Result:='byte';
|
|
|
|
+ reitShortInt: Result:='shortint';
|
|
|
|
+ reitWord: Result:='word';
|
|
|
|
+ reitSmallInt: Result:='smallint';
|
|
|
|
+ reitUIntSingle: Result:='unsinged int single';
|
|
|
|
+ reitIntSingle: Result:='int single';
|
|
|
|
+ reitLongWord: Result:='longword';
|
|
|
|
+ reitLongInt: Result:='longint';
|
|
|
|
+ reitUIntDouble: Result:='unsigned int double';
|
|
|
|
+ reitIntDouble: Result:='int double';
|
|
|
|
+ else
|
|
|
|
+ Result:='int';
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
{ TResEvalFloat }
|
|
{ TResEvalFloat }
|
|
|
|
|
|
constructor TResEvalFloat.Create;
|
|
constructor TResEvalFloat.Create;
|
|
@@ -5732,6 +5798,11 @@ begin
|
|
Result:=true;
|
|
Result:=true;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TResEvalFloat.TypeAsString: string;
|
|
|
|
+begin
|
|
|
|
+ Result:='float';
|
|
|
|
+end;
|
|
|
|
+
|
|
{$ifdef FPC_HAS_CPSTRING}
|
|
{$ifdef FPC_HAS_CPSTRING}
|
|
{ TResEvalString }
|
|
{ TResEvalString }
|
|
|
|
|
|
@@ -5759,6 +5830,15 @@ function TResEvalString.AsString: string;
|
|
begin
|
|
begin
|
|
Result:=RawStrToCaption(S,60);
|
|
Result:=RawStrToCaption(S,60);
|
|
end;
|
|
end;
|
|
|
|
+
|
|
|
|
+function TResEvalString.TypeAsString: string;
|
|
|
|
+begin
|
|
|
|
+ if OnlyASCII then
|
|
|
|
+ Result:='string'
|
|
|
|
+ else
|
|
|
|
+ Result:='ansistring';
|
|
|
|
+end;
|
|
|
|
+
|
|
{$endif}
|
|
{$endif}
|
|
|
|
|
|
{ TResEvalUTF16 }
|
|
{ TResEvalUTF16 }
|
|
@@ -5786,6 +5866,11 @@ begin
|
|
Result:=String(UnicodeStrToCaption(S,60));
|
|
Result:=String(UnicodeStrToCaption(S,60));
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TResEvalUTF16.TypeAsString: string;
|
|
|
|
+begin
|
|
|
|
+ Result:='unicodestring';
|
|
|
|
+end;
|
|
|
|
+
|
|
{ TResEvalEnum }
|
|
{ TResEvalEnum }
|
|
|
|
|
|
constructor TResEvalEnum.Create;
|
|
constructor TResEvalEnum.Create;
|
|
@@ -5849,6 +5934,13 @@ begin
|
|
Result:=ElType.Name+'('+IntToStr(Index)+')';
|
|
Result:=ElType.Name+'('+IntToStr(Index)+')';
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TResEvalEnum.TypeAsString: string;
|
|
|
|
+begin
|
|
|
|
+ Result:=ElType.Name;
|
|
|
|
+ if Result='' then
|
|
|
|
+ Result:='enum';
|
|
|
|
+end;
|
|
|
|
+
|
|
{ TResEvalRangeInt }
|
|
{ TResEvalRangeInt }
|
|
|
|
|
|
constructor TResEvalRangeInt.Create;
|
|
constructor TResEvalRangeInt.Create;
|
|
@@ -5920,6 +6012,18 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TResEvalRangeInt.TypeAsString: string;
|
|
|
|
+begin
|
|
|
|
+ case ElKind of
|
|
|
|
+ revskEnum: Result:='enum range';
|
|
|
|
+ revskInt: Result:='integer range';
|
|
|
|
+ revskChar: Result:='char range';
|
|
|
|
+ revskBool: Result:='boolean range';
|
|
|
|
+ else
|
|
|
|
+ Result:='integer range';
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
{ TResEvalSet }
|
|
{ TResEvalSet }
|
|
|
|
|
|
constructor TResEvalSet.Create;
|
|
constructor TResEvalSet.Create;
|
|
@@ -5980,6 +6084,11 @@ begin
|
|
Result:=Result+']';
|
|
Result:=Result+']';
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TResEvalSet.TypeAsString: string;
|
|
|
|
+begin
|
|
|
|
+ Result:='set';
|
|
|
|
+end;
|
|
|
|
+
|
|
function TResEvalSet.Add(aRangeStart, aRangeEnd: TMaxPrecInt): boolean;
|
|
function TResEvalSet.Add(aRangeStart, aRangeEnd: TMaxPrecInt): boolean;
|
|
|
|
|
|
{$IF FPC_FULLVERSION<30101}
|
|
{$IF FPC_FULLVERSION<30101}
|