![]() |
Spicy
|
#include <preprocessor.h>
Public Types | |
enum | State { Include, Skip } |
using | ID = std::string |
using | Value = int |
Public Member Functions | |
SourceCodePreprocessor (std::map< ID, Value > constants) | |
Result< State > | processLine (std::string_view directive, std::string_view expression="") |
State | state () const |
bool | expectingDirective () |
Helper to preprocess/@ directives in lines of input.
This currently supports the following set of directives:
- `[!] < [!] <
|
strong |
Current inclusion state while processing input.
|
inline |
Constructor.
constants | map of constants that preprocessor directives can work on |
|
inline |
Returns true if the proprocessor expects further directives that closed previously opened blocks
hilti::Result< hilti::util::SourceCodePreprocessor::State > hilti::util::SourceCodePreprocessor::processLine | ( | std::string_view | directive, |
std::string_view | expression = "" |
||
) |
Process one preprocessor directive of the form @<id> [expression]
.
This evaluates the directive and updates internal state accordingly.
directive | a supported directive ID, which must start with @ . |
expression | string with expression that the directive is taking |
|
inline |
Returns the current inclusion state.