pub struct LanguageSyntax {
pub line_comments: &'static [&'static str],
pub block_comments: &'static [(&'static str, &'static str)],
pub string_delimiters: &'static [&'static str],
pub backslash_escapes: bool,
}Expand description
The comment and string syntax of one language.
Empty delimiters are ignored: a comment prefix or a block-comment pair with an empty side would otherwise match at every position (or panic while scanning for the closing delimiter).
Fields§
§line_comments: &'static [&'static str]Prefixes that start a comment running to the end of the line.
block_comments: &'static [(&'static str, &'static str)]Delimiter pairs that start and end a block comment.
string_delimiters: &'static [&'static str]Delimiters that start and end a string literal.
Longer delimiters are matched first, so a language can list """
alongside " to support multi-line strings.
backslash_escapes: boolWhether a backslash escapes the next character inside a string.
Trait Implementations§
Source§impl Clone for LanguageSyntax
impl Clone for LanguageSyntax
impl Copy for LanguageSyntax
Source§impl Debug for LanguageSyntax
impl Debug for LanguageSyntax
Auto Trait Implementations§
impl Forget for LanguageSyntax
impl Freeze for LanguageSyntax
impl Move for LanguageSyntax
impl RefUnwindSafe for LanguageSyntax
impl Send for LanguageSyntax
impl Sync for LanguageSyntax
impl Unpin for LanguageSyntax
impl UnsafeUnpin for LanguageSyntax
impl UnwindSafe for LanguageSyntax
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