File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -2346,6 +2346,20 @@ declaration, and between the `{` and `}` of the unit block.
2346
2346
However there should not be any top level if-then-else enclosing and repeating
2347
2347
these parentheses and braces.
2348
2348
2349
+ ## Preprocessor additional functions
2350
+
2351
+ In addition to the standard Lua functions, the following functions are
2352
+ available to the preprocessor:
2353
+ - `print(<string>)` prints the string in the console when reached by the preprocessor.
2354
+ - `error(<string>)` prints the string and exits immediately.
2355
+ - `clog2(<number>)` returns the ceil of the log2 of the input number.
2356
+ - `lshift(<number>,<number>)` returns the first input number left shifted by the second number (note: Lua now also supports `<<`).
2357
+ - `rshift(<number>)` returns the first input number right shifted by the second number (note: Lua now also supports `>>`).
2358
+ - `widthof(<identifier>)` returns the bit width of the given variable.
2359
+ - `signed(<identifier>)` returns whether the given variable is signed.
2360
+ - `findFile(<string>)` searches for a file in all known paths and returns the
2361
+ absolute path if found, the unmodified file name otherwise.
2362
+
2349
2363
## Preprocessor image and palette functions
2350
2364
2351
2365
The pre-processor has a number of function to facilitate the inclusion
You can’t perform that action at this time.
0 commit comments