forked from jdehaan2014/GearLanguage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathucallable.pas
40 lines (29 loc) · 795 Bytes
/
ucallable.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
unit uCallable;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Generics.Collections, uInterpreter, uAST, uToken;
type
TCallArg = class
Value: Variant;
Ident: TIdent;
Token: TToken;
constructor Create(AValue: Variant; AIdent: TIdent; AToken: TToken);
end;
TArgList = specialize TObjectList<TCallArg>;
ICallable = interface
['{4E512927-63FA-6E3B-0312-B27878C144EB}']
function Call(Token: TToken; Interpreter: TInterpreter; ArgList: TArgList): Variant;
function toString: String;
end;
IValuable = interface(ICallable)
['{047FA5CB-C090-11B2-5FDB-5E3EA6245717}']
end;
implementation
constructor TCallArg.Create(AValue: Variant; AIdent: TIdent; AToken: TToken);
begin
Value := AValue;
Ident := AIdent;
Token := AToken;
end;
end.