1
0
mirror of https://github.com/KarolS/millfork.git synced 2026-04-21 09:16:34 +00:00

Module templates

This commit is contained in:
Karol Stasiak
2020-06-03 23:13:17 +02:00
parent b5134dfbd1
commit 718245c56a
16 changed files with 279 additions and 26 deletions
+15
View File
@@ -129,6 +129,16 @@ These features are used to identify the target machine in multiplatform programs
### Built-in preprocessor functions and operators
The `same` function returns 1 if given identical identifiers and 0 otherwise.
It is the only function that does not support any other kind of parameters, and it's only useful in module templates.
// prints 1:
#infoeval same(a,a)
// prints 0:
#infoeval same(a,b)
// fails to compile
#infoeval same(a,1)
The `defined` function returns 1 if the feature is defined, 0 otherwise.
All the other functions and operators treat undefined features as if they were defined as 0.
@@ -145,6 +155,11 @@ TODO
The following Millfork operators and functions are not available in the preprocessor:
`+'`, `-'`, `*'`, `<<'`, `>>'`, `:`, `>>>>`, `nonet`, all the assignment operators
### `#template`
Defines the source to be a module template. See [Modules](./modules.md) for more information.
### `#if/#elseif/#else/#endif`
#if <expr>