[go: up one dir, main page]

pub enum Preprocessor {
    Version(PreprocessorVersion),
    Extension(PreprocessorExtension),
}
Expand description

Some basic preprocessor commands.

As it’s important to carry them around the AST because they cannot be substituted in a normal preprocessor (they’re used by GPU’s compilers), those preprocessor commands are available for inspection.

Important note: others preprocessor commands can be used in your source. However, they’ll get substituted upfront. For instance, if you use have #define foo 42 defined in your file, every occurrence to foo will get replaced by 42 and then treated as a normal GLSL expression (in that case, ending as an Expr::IntConst(42) value). This might be unfortunate for people seeking minimal size. However, you’re free to use a minifier aftewards to re-enable _that kind of feature. To be honest, it’s not worth it to interleave the AST with preprocessor command annotations just so that the resulting code size is minimal. Just use a minifier.

Variants§

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Parse from a byte slice.
Parse from a string.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.