A cheat sheet of all compiler directives
Directive | Description |
---|---|
#add_context |
Add declaration to Context verbatim. Your main program, and any modules that you use, can add things to the Context. context howto. |
#align |
|
#assert |
Compiler-time assert |
#asm |
specifies that the next statements in a block are inline assembly Inline Assembly Wiki |
#bake |
Currying |
#bake_arguments |
Currying. Currying Values |
#c_call |
A call to a c library? |
#deprecated |
Example: #deprecated "Use enum_values_as_s64 instead." Deprecated Example
|
#insert |
Insert compile-time-generated code, or code that has been represented as data in some other way. insert howto, insert wiki |
#insert_internal |
|
#caller_location |
Use as default value of parameter to set it to source code location |
#caller_code |
|
#char |
Character literal |
#code |
Code block |
#compiler |
Proc is internal to compiler |
#complete |
Ensure an if-case satement checks all values of the enum |
#dump |
Dumps out the bytecode and basic blocks used to construct the function. This is useful for viewing the disassembly of the bytecode. |
#expand |
Macro |
#file |
path+filename of running executable. |
#filepath |
Path of the running executable. |
#foreign |
Proc is a foreign function. |
#foreign_library |
Specify file for foreign functions. |
#foreign_system_library |
Specify system file for foreign functions. |
#if |
Compile-time if. |
#import |
Import a module. |
#intrinsic |
Proc is an intrinsic. |
#load |
Load source code, as if it were placed right here (very commonly used). |
#modify |
Filter polymorphic parameter type. modify howto. |
#module_parameters |
specifies the variable as a module parameter |
#must |
Require a return value to be assigned to a variable. |
#no_abc |
No array-bounds-check |
#no_alias |
|
#no_padding |
No padding in struct. |
#place |
Set location in struct of following members. See unions |
#placeholder |
Placeholder identifier to be filled out at compile time. |
#program_export |
|
#run |
Run this code right now (compile time). #run wiki |
#run_and_insert |
Deprecated |
#runtime_support |
Proc comes from runtime support. |
#scope_export |
Set the scope for future declarations to be accessible by code that imports this module. |
#scope_file |
Set the scope for foture declarations to just this file. |
#scope_module |
Set the scope for foture declarations to just this module. |
#specified |
Declare intention of maintaining enum values compatibility over time. |
#string |
String literal with delimiter. See Mutli-line String |
#symmetric |
Proc is symmetric. Symmetric Keyword example |
#through |
Case has fall-through. |
#this |
Returns the procedure, struct type, or data scope that contains it, as a compile-time constant. this howto. |
#type |
Type literal, e.g. for function types. |
#type_info_none |
Struct does not keep runtime type info. |
#type_info_procedures_are_void_pointers |
Initial list sourced from jai-cookbook/directives.jai at master · onelivesleft/jai-cookbook · GitHub