Return the position at the top of the stack as a table handle.
If it actually exists and is a table, this handle can be used for further operations on that table. Otherwise a 0 will be returned.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L |
Handle for the Lua script. |
A handle for the table on the top of the stack to access it.
function aot_table_top(L) result(thandle)
type(flu_state) :: L !! Handle for the Lua script.
!> A handle for the table on the top of the stack to access it.
integer :: thandle
if (.not. flu_isTable(L, -1)) then
thandle = 0
call flu_pop(L)
else
thandle = flu_gettop(L)
end if
end function aot_table_top