public subroutine aot_table_open(L, parent, thandle, key, pos)
This subroutine tries to open a table, and returns a handle for it.
If parent is present, the table is tried to open within that table.
Return its position in the stack as a handle for this
table. If it does not exist or the table entry is not
a table itself, the handle will be set to 0.
The table can be looked up either by position or name.
If a key is present but no parent, a global table is opened.
If neither key nor parent is present, a new table is created.
Only passing pos, without a thandle is erroneous and always
results in a thandle = 0.
After the table is opened, the returned handle can be used to access its
components.
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
subroutine aot_table_open(L,parent,thandle,key,pos)type(flu_state)::L!! Handle for the Lua script.!> Handle of the table containing the requested table.integer,intent(in),optional::parent!> A handle for the table to access it, 0 if no table available.integer,intent(out)::thandle!> Name of the entry in the parent table to access.!!!! The key takes precedence over the position, if both are provided.!! In this case the positional address is only tried, if the access to the!! key failed.character(len=*),intent(in),optional::key!> Position of the entry in the parent table to access.integer,intent(in),optional::posinteger::luatypethandle=0if(present(parent))then call aot_table_push(L,parent,key,pos)thandle=aot_table_top(L)else if(present(key))thenluatype=flu_getglobal(L,key)thandle=aot_table_top(L)else if(.not.present(pos))then call flu_createtable(L,0,0)thandle=flu_gettop(L)end if end if end subroutine aot_table_open