We utilise the preproc fakeyword to designate that a statement should be treated as a preprocessor directive.

Variables

For variable declarations we specify the type as preproc | X where X is the actual data type:

This will generate the equivalent to a preprocessor #define statement on target platforms that support preprocessor directives.

Macros

The stub APIs for your target platform will provide many standard macros, such as __FILE__ and __LINE__.

Support for defining your own macro functions is a future enhancement that is not currently supported by Sempiler.

The current proposal is to use the same define mechanism for variables and macros, and treat those with lambda function initializers as macros.

Feedback on this and any other Sempiler topics can be relayed via these channels.

If

For if statements we provide a type assertion on the condition that specifies it should be interpreted as preproc:

This will generate the equivalent to a preprocessor #if statement on target platforms that support preprocessor directives.

Elif

You do NOT need to repeat preproc on any else if branches. Their preprocessor status is inferred from the root if statement that they belong to.

IfDef

Support for ifdef is a future enhancement that is not currently supported by Sempiler.