#[non_exhaustive]pub struct Syntax {
pub line_comments: &'static [&'static str],
pub block_comment: Option<(&'static str, &'static str)>,
pub nested_block_comments: bool,
pub quotes: &'static [char],
pub interpolated_quote: Option<char>,
pub escapes: bool,
pub regex_literals: bool,
pub raw_strings: bool,
pub triple_quotes: bool,
pub char_literals: bool,
pub significant_indentation: bool,
pub identifier_extra: &'static [char],
}Expand description
The lexical rules of one language.
The flags are independent lexical facts rather than a state machine, so they are listed plainly instead of being packed into an option type that would obscure which language has which behaviour.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.line_comments: &'static [&'static str]§block_comment: Option<(&'static str, &'static str)>§nested_block_comments: bool§quotes: &'static [char]§interpolated_quote: Option<char>Quote that opens a string containing ${...} expressions.
escapes: bool§regex_literals: boolWhether / can open a regular-expression literal.
raw_strings: boolWhether r"..." and r#"..."# forms exist.
triple_quotes: boolWhether """...""" spans lines.
char_literals: boolWhether ' opens a character literal that a lifetime is also written
with. Rust needs this: 'a is a lifetime and '"' is a quote
character, and treating ' as an ordinary quote or as ordinary
punctuation gets one of the two wrong.
significant_indentation: bool§identifier_extra: &'static [char]Trait Implementations§
Auto Trait Implementations§
impl Freeze for Syntax
impl RefUnwindSafe for Syntax
impl Send for Syntax
impl Sync for Syntax
impl Unpin for Syntax
impl UnsafeUnpin for Syntax
impl UnwindSafe for Syntax
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more