#[non_exhaustive]pub struct Options {
pub trigraphs: bool,
pub line_comments: bool,
pub digit_separators: bool,
}Expand description
The dialect knobs phase 1 cares about.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.trigraphs: boolReplace trigraphs, which -trigraphs turns on.
Off by default because C23 removed them, and because leaving them on means ??!
inside a string literal silently becomes |, which has caught out every project that
ever wrote a question mark next to a punctuator.
line_comments: boolWhether // starts a comment, which C99 took from C++ and which gcc offers in gnu89 as
an extension. Off means the two slashes are two punctuators, which is what -std=c89
says and is a syntax error wherever a real line comment was written.
digit_separators: boolWhether ' between digits is part of the number, which is C23 and is not a GNU
extension. Off means 1'000'000 is a number, a multi-character character constant and
another number, which is how gcc reads it before C23 and why it does not parse.