Documentation
¶
Overview ¶
Package api defines the parser and code generator public interface.
The parser is a single-pass recursive descent compiler that converts Lua source into Proto (compiled function prototypes). The public API is minimal: Parse() is the sole entry point.
FuncState, ExpDesc, and BlockCnt are compiler-internal types. They are defined here for documentation but will be used only within the parse and codegen implementation.
Reference: .analysis/06-compiler-pipeline.md §3-§4
Code generator for Lua — translates expression descriptors into bytecode.
This is the Go translation of C Lua's lcode.c (1972 lines). It handles instruction emission, constant pool management, register allocation, jump list management, expression discharge, and operator codegen.
Reference: lua-master/lcode.c, .analysis/06-compiler-pipeline.md §4
Parser for Lua — single-pass recursive descent compiler.
This is the Go translation of C Lua's lparser.c (2202 lines). It parses Lua source into bytecode by calling codegen functions.
Reference: lua-master/lparser.c, .analysis/06-compiler-pipeline.md §3
Index ¶
Constants ¶
const ( VDKREG byte = 0 // regular local RDKCONST byte = 1 // local constant RDKVAVAR byte = 2 // vararg parameter (was incorrectly 3) RDKTOCLOSE byte = 3 // to-be-closed (was incorrectly 2) RDKCTC byte = 4 // local compile-time constant (was missing) GDKREG byte = 5 // regular global (was incorrectly 4) GDKCONST byte = 6 // global constant (was incorrectly 5) )
Variable kinds (C6 FIX: matches C lparser.h:102-108 exactly)
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.