public function aot_type_of(L, thandle, key, pos) result(luatype)
Get the Lua object in table thandle under the given key or pos on the
top of the stack and return the Lua type of the gotten entry.
This might be used to get a Lua entry to the top of the stack without
knowing its type beforehand, and then deciding what to load, based on
the type.
Lua types are encoded as integer values and available in the
flu_binding module.
FLU_TNONE : not existing
FLU_TNIL : not available
FLU_TBOOLEAN : logical value
FLU_TNUMBER : a number
FLU_TSTRING : a string
FLU_TTABLE : a table
FLU_TFUNCTION: a function
If none of key, pos or thandle are provided, the type of the current
top of the stack will be returned. Just passing pos without a thandle
is invalid and always returns FLU_TNONE.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Source Code
function aot_type_of(L,thandle,key,pos)result(luatype)type(flu_State)::L!! Handle to the Lua script.!> Handle of the table to get the value frominteger,intent(in),optional::thandle!> Key of the value to find the type for.character(len=*),intent(in),optional::key!> Position of the value to find the type for.integer,intent(in),optional::pos!> Type of the Lua object found in L, thandle, key and posinteger::luatypeluatype=FLU_TNONEif(present(thandle))then call aot_table_push(L=L,&&thandle=thandle,&&key=key,&&pos=pos,&&toptype=luatype)else if(present(key))thenluatype=flu_getglobal(L,key)else if(.not.present(pos))thenluatype=flu_type(L,-1)end if end if end function aot_type_of