-
Notifications
You must be signed in to change notification settings - Fork 387
The Complete Syntax of LuaJIT
Sergey Kaplun edited this page Sep 7, 2023
·
1 revision
WARNING: Tarantool's developers disclaimer: This wiki page is a slightly modified copy of the missing LuaJIT wiki page taken from web archive. It may contain outdated content, use it with caution.
Here is the complete syntax of LuaJIT in extended BNF. (It does not describe operator precedences.) It is based on Section 8 of the Lua 5.1 Reference Manual, including literal extensions for the FFI and selectively incorporated features from Lua 5.2.
chunk ::= {stat [`;´]} [laststat [`;´]] block ::= chunk stat ::= varlist `=´ explist | functioncall | lua52_label | `do´ block `end´ | `while´ exp `do´ block `end´ | `repeat´ block `until´ exp | `if´ exp `then´ block {`elseif´ exp `then´ block} [`else´ block] `end´ | `for´ Name `=´ exp `,´ exp [`,´ exp] `do´ block `end´ | `for´ namelist `in´ explist `do´ block `end´ | `function´ funcname funcbody | `local´ `function´ Name funcbody | `local´ namelist [`=´ explist] laststat ::= `return´ [explist] | `break´ | lua52_goto lua52_goto ::= `goto´ Name lua52_label ::= `::´ Name `::´ funcname ::= Name {`.´ Name} [`:´ Name] varlist ::= var {`,´ var} var ::= Name | prefixexp `[´ exp `]´ | prefixexp `.´ Name namelist ::= Name {`,´ Name} explist ::= {exp `,´} exp exp ::= `nil´ | `false´ | `true´ | numeric | String | `...´ | function | prefixexp | tableconstructor | exp binop exp | unop exp numeric ::= FFI_Int64 | FFI_Uint64 | FFI_Imaginary | Number prefixexp ::= var | functioncall | `(´ exp `)´ functioncall ::= prefixexp args | prefixexp `:´ Name args args ::= `(´ [explist] `)´ | tableconstructor | String function ::= `function´ funcbody funcbody ::= `(´ [parlist] `)´ block `end´ parlist ::= namelist [`,´ `...´] | `...´ tableconstructor ::= `{´ [fieldlist] `}´ fieldlist ::= field {fieldsep field} [fieldsep] field ::= `[´ exp `]´ `=´ exp | Name `=´ exp | exp fieldsep ::= `,´ | `;´ binop ::= `+´ | `-´ | `*´ | `/´ | `^´ | `%´ | `..´ | `<´ | `<=´ | `>´ | `>=´ | `==´ | `~=´ | `and´ | `or´ unop ::= `-´ | `not´ | `#´
- C coding guidelines ↗
- Lua coding guidelines ↗
- Python coding guidelines ↗
- Maintainer's guide
- Debugging
Architecture
- Server architecture
- R tree index quick start and usage
- LuaJIT
- Vinyl
- Vinyl Architecture
- Vinyl Disk Layout
- Vinyl math
- Vinyl Cookbook
- Bullet1
- SQL
- Appserver modules
- Testing
- Performance
- Privileges and Access control
How To ...?
- ... configure build system
- ... add new fuzzers
- ... build RPM or Deb package using packpack
- ... calculate memory size
- ... debug core dump of stripped tarantool
- ... debug core from different OS
- ... debug fuzzer
- ... generate new bootstrap snapshot
- ... use Address Sanitizer
- ... collect a coredump
- ... generate luacov report for builtin module
- ... verify modified lua files via luacheck
- ... verify Lua files in third_party?
- ... rerun failed jobs
- ... update a third party repository
- Fix wrong decimal indexing after upgrade to 2.10.1
- Caveats when upgrading a cluster on Tarantool 1.6
- Fix illegal field type in a space format when upgrading to 2.10.4
Useful links