Skip to main content

Module lua

Module lua 

Source
Expand description

The Lua rule catalogue. Spec §2.

The same constructs the other catalogues cover, mapped onto Lua’s tree. Reading this against rule/go.rs is the point, because the two answer four of the same questions differently:

  • A module becomes a nested table where Go’s becomes a name prefix. A Go package is a directory and cannot nest inside one file; a Lua table nests, so ::common::util::Location stays M.common.util.Location and the IDL scope survives the mapping.
  • A struct becomes a descriptor and a constructor, not a type. Lua declares nothing, so there is no node for the shape itself — what the rule creates is the table that describes it and the function that builds one.
  • An enumeration becomes two maps and an ordered list, where Go gets a defined integer type and one constant per enumerator. Lua has no constant and no defined type; a name-to-value map, its inverse and the declaration order are the three facts an enumerator carries, and each is a table entry.
  • A typedef has a rule here and declares nothing. Lua has no alias to write, so what the rule creates is an entry in the descriptor table naming the target — which is the only place a typedef is recoverable from the generated file at all.

Constants§

ALIAS_TO_ENTRY
The name of the rule that maps a typedef to a descriptor entry naming its target.
BITMASK_TO_TABLE
The name of the rule that maps a bitmask to a value table.
BITSET_TO_TABLE
The name of the rule that maps a bitset to a descriptor table.
BIT_TO_ENTRY
The name of the rule that maps a bit to a value entry.
CASE_TO_ENTRY
The name of the rule that maps a union case to a branch entry.
CONST_TO_FIELD
The name of the rule that maps a constant to a module field.
ENUMERATOR_TO_ENTRY
The name of the rule that maps an enumerator to a value entry.
ENUM_TO_TABLE
The name of the rule that maps an enumeration to a value table.
EXCEPTION_TO_TABLE
The name of the rule that maps an exception to a descriptor table.
INTERFACE_TO_TABLE
The name of the rule that maps an interface to a table of operation descriptors.
MEMBER_TO_ENTRY
The name of the rule that maps a member to a descriptor entry.
MODULE_TO_TABLE
The name of the rule that maps a module to a nested table.
NATIVE_TO_TABLE
The name of the rule that maps a native declaration to an opaque descriptor.
STRUCT_TO_TABLE
The name of the rule that maps a struct to a descriptor table.
UNION_TO_TABLE
The name of the rule that maps a union to a descriptor table.
VALUETYPE_TO_TABLE
The name of the rule that maps a valuetype to a descriptor table.

Functions§

catalogue
Every Lua rule.