From 833a971877521a3a906207fb37e84ccbc9f27f23 Mon Sep 17 00:00:00 2001 From: Sven/Sarah Barth Date: Sun, 6 Feb 2022 21:42:20 +0100 Subject: [PATCH] + add utility function to check whether an objectdef is an invokable one --- compiler/defutil.pas | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compiler/defutil.pas b/compiler/defutil.pas index b6280fd5e3..889b8969ef 100644 --- a/compiler/defutil.pas +++ b/compiler/defutil.pas @@ -385,6 +385,9 @@ interface { returns true if def is a function reference } function is_funcref(def:tdef):boolean; + { returns true if def is an invokable interface } + function is_invokable(def:tdef):boolean; + { returns true if def is a C "block" } function is_block(def: tdef): boolean; @@ -1903,6 +1906,12 @@ implementation end; + function is_invokable(def:tdef):boolean; + begin + result:=(def.typ=objectdef) and (oo_is_invokable in tobjectdef(def).objectoptions); + end; + + function is_block(def: tdef): boolean; begin result:=(def.typ=procvardef) and (po_is_block in tprocvardef(def).procoptions)