Skip to content

Compiler directives

Paolo Angeli edited this page Nov 1, 2019 · 22 revisions

Compiler

Directive Meaning
#assert() Static compiler assertion eg. used to target a specific OS
#bake_constants Applied on polymorphic procedures to create a specific version that accepts a specific type (1)
#bake_arguments Applied on polymorphic procedures to create a specific version with a specific argument (1)
#c_callback ...
#char The first element following string has to be treated as a single character
#compiler ...
#complete ...
#expand ...
#deprecated Used to mark a piece of code that has to be refactored, generates a compiler warning with the specified message
#foreign Declare something coming from an external C obj or DLL compatible library
#foreign_system_library Declare an OS-specific import from an external lib or DLL
#IF Entry point for conditional build
#import Import a Library file
#insert ...
#intrinsic Use the intrinsic version of the procedure based on CPU specific instruction.
#load Load another Jai file
#must Used to mark function's return values that must be assigned to a variable, so their return value cannot be ignored.
#no_abc{} No array bounds checking
#poke_name ...
#procedure_of_call Used to get a pointer to a specific version of an overloaded procedure (3)
#program_export Marks a procedure as exportable from a file to the global scope
#run Run a procedure at compile time
#scope_file The declarations in the following block are restricted to the current file
#through Used in switch-like statements to group case and skip to the following
#type Helps the compiler to understand that the following statements are meant to designate types. It's used in polymorphic procedures arguments, polymorphic structs and procedure pointers (2)

References

  1. Youtube video 2018/06/06
  2. Youtube video 2018/06/06
  3. Youtube video 2018/06/06

Annotations

User-defined annotations that can be attached to type definitions.

Directive Meaning
@NoSerialize The field won't be saved in the level file
@Vn Where n is a number. Related to the Entity version.
@Vn-m Where n and m are numbers. Related to the Entity version.
@Pid Unique identifier of the entity
@DoNotDisplay By default the loaded entity won't be displayed
@PrintLike ...

Navigate

Types, constants and variables

  • Variables and assignments
  • Language data types
  • Simple user-defined data types
  • Expressions and operators
  • Type-casting
  • Pointers

Flow control

Procedures and functions

  • Declarations
  • Arguments / Parameters
  • Return values
  • Overloading / Polymorhism
  • Advanced features
  • Lambdas

Aggregated data types

  • Arrays
  • Strings
  • Composition of Structs

Advanced features

Clone this wiki locally