|
@@ -715,7 +715,7 @@ Type
|
|
end;
|
|
end;
|
|
|
|
|
|
{ TFPExpressionParser }
|
|
{ TFPExpressionParser }
|
|
- TIdentifierEvent = Procedure (Sender : TObject; Const aIdentifier : String) of object;
|
|
|
|
|
|
+ TIdentifierEvent = Procedure (Sender : TObject; Const aIdentifier : String; var aIdent : TFPExprIdentifierDef) of object;
|
|
TFPExpressionParser = class(TComponent)
|
|
TFPExpressionParser = class(TComponent)
|
|
private
|
|
private
|
|
FBuiltIns: TBuiltInCategories;
|
|
FBuiltIns: TBuiltInCategories;
|
|
@@ -740,7 +740,7 @@ Type
|
|
procedure CheckNodes(var Left, Right: TFPExprNode);
|
|
procedure CheckNodes(var Left, Right: TFPExprNode);
|
|
procedure SetBuiltIns(const AValue: TBuiltInCategories);
|
|
procedure SetBuiltIns(const AValue: TBuiltInCategories);
|
|
procedure SetIdentifiers(const AValue: TFPExprIdentifierDefs);
|
|
procedure SetIdentifiers(const AValue: TFPExprIdentifierDefs);
|
|
- procedure AddIdentifierToStrings(Sender : TObject; Const aIdentifier : String);
|
|
|
|
|
|
+ procedure AddIdentifierToStrings(Sender : TObject; Const aIdentifier : String; var ID : TFPExprIdentifierDef);
|
|
Protected
|
|
Protected
|
|
procedure ParserError(Msg: String);
|
|
procedure ParserError(Msg: String);
|
|
procedure SetExpression(const AValue: String); virtual;
|
|
procedure SetExpression(const AValue: String); virtual;
|
|
@@ -1599,8 +1599,9 @@ begin
|
|
FIdentifiers.Assign(AValue)
|
|
FIdentifiers.Assign(AValue)
|
|
end;
|
|
end;
|
|
|
|
|
|
-procedure TFPExpressionParser.AddIdentifierToStrings(Sender: TObject; const aIdentifier: String);
|
|
|
|
|
|
+procedure TFPExpressionParser.AddIdentifierToStrings(Sender: TObject; const aIdentifier: String; var ID : TFPExprIdentifierDef);
|
|
begin
|
|
begin
|
|
|
|
+ ID:=Nil;
|
|
If Assigned(FExtractIdentifiers) then
|
|
If Assigned(FExtractIdentifiers) then
|
|
FExtractIdentifiers.Add(aIdentifier);
|
|
FExtractIdentifiers.Add(aIdentifier);
|
|
end;
|
|
end;
|
|
@@ -2060,12 +2061,15 @@ begin
|
|
begin
|
|
begin
|
|
if Assigned(FOnExtractIdentifier) then
|
|
if Assigned(FOnExtractIdentifier) then
|
|
begin
|
|
begin
|
|
- if not Assigned(FUnknownIdentifier) then
|
|
|
|
- FUnknownIdentifier:=TFPExprIdentifierDef.Create(Nil);
|
|
|
|
- ID:=FUnknownIdentifier;
|
|
|
|
// Call only once in case of stringlist.
|
|
// Call only once in case of stringlist.
|
|
If Not (Assigned(FExtractIdentifiers) and (FExtractIdentifiers.IndexOf(S)<>-1)) then
|
|
If Not (Assigned(FExtractIdentifiers) and (FExtractIdentifiers.IndexOf(S)<>-1)) then
|
|
- FOnExtractIdentifier(Self,S);
|
|
|
|
|
|
+ FOnExtractIdentifier(Self,S,ID);
|
|
|
|
+ if (ID=Nil) then
|
|
|
|
+ begin
|
|
|
|
+ if not Assigned(FUnknownIdentifier) then
|
|
|
|
+ FUnknownIdentifier:=TFPExprIdentifierDef.Create(Nil);
|
|
|
|
+ ID:=FUnknownIdentifier;
|
|
|
|
+ end;
|
|
end
|
|
end
|
|
else
|
|
else
|
|
ParserError(Format(SErrUnknownIdentifier,[S]))
|
|
ParserError(Format(SErrUnknownIdentifier,[S]))
|