Lua Notes

nelua pragmas
Login

nelua pragmas

## local list = {}; for k, _ in pairs(typedefs.pragmas) do table.insert(list, k) end table.sort(list) for _, v in ipairs(list) do print(v) end

abort = one_of{'exit', 'trap', 'abort'}:is_optional()

Changes abort semantics.

noassertloc

"Disable showing the source location in runtime asserts (created to minify the output binary)."

nobuiltincharclass

"When set, the standard library will use lib C APIs to check character classes, (like `islower`, `isdigit`, etc) and the system's current locale will affect some functions string methods in standard library."

nocfeaturessetup

"Disables initial setup of API features in the C code generator (created to minify the C codegen). It's recommend to not change this, because more functions from POSIX, OS and lib C extensions will be available for use in the standard library, improving its quality."

nocfloatsuffix

"Disable use of float suffixes in the C code generator (created for GLSL codegen)."

nochecks

When set, the following checks will be disabled:

nocinlines

"Disable use of inline functions in the C code generation (created for GLSL codegen)."

nocstatic

"Disable use of `static` functions and variable in the C code generator (created for GLSL codegen)."

nocstaticassert

"Disables use of static asserts in the C code generation (created to minify the C codegen). It's recommended to not change this, because whenever there is a disagreement of primitive types sizes you will get a compile error instead of possibly broken code. Such situation can happen when using exotic compilers, architectures or compiler flags."

noctypedefs

"Disable use typedefs in the C code generation (created for GLSL codegen)."

nocwarnpragmas

"Disable configuration warning in the C code generation (created to minify the C codegen)."

nodce

Disables dead code elimination

noentrypoint

"Disables the main entry point generation. When set, the function nelua_main that initializes global variables and run code from top scope will still be defined, however it won't be called. You will need import it with <cimport> and call it manually from another entry point. You may not want to use this pragma, maybe you want to mark another function as the main entry point instead by using the annotation <entrypoint> on it.

nogc

"Disables the garbage collector. When this is enabled you will need to manage and deallocate memory manually."

nogcentry

"Disable entry point generation for the GC."

noinit

"Disable initialization of variables to zeros by default (create for GLSL codegen). Please care changing this, as it will change the semantics of many code."

nolibm

"Disable automatically linkage of libm even when math functions are used (for freestading builds)."

unitname = string

"Changes the prefix of generated C functions for the current source unit (current source file). When unset the source relative path will be used as prefix. When set to an empty string, then no prefix will be used, however this may increase the chances of name clashing in the C generated code. This pragma is useful to control function names when generating C libraries."

volatile

"Mark all variables declarations as volatile."

warnnarrow

"Warn about implicit emitted narrowing conversions in the C code generation."

writestderr = one_of{'none', 'hooked', 'stdout', 'stderr'}:is_optional()

"Changes how messages are written to stderr when a runtime error occur (panic, assert, check, etc)."