pub struct SyntaxDef {
pub name: String,
pub kind: SyntaxKind,
pub parser: Vec<SyntaxItem>,
}Expand description
A syntax declaration that extends a syntactic category.
Fields§
§name: StringName of the syntax extension.
kind: SyntaxKindWhich syntactic category it extends.
parser: Vec<SyntaxItem>The parser specification.
Implementations§
Source§impl SyntaxDef
impl SyntaxDef
Sourcepub fn new(name: String, kind: SyntaxKind, parser: Vec<SyntaxItem>) -> Self
pub fn new(name: String, kind: SyntaxKind, parser: Vec<SyntaxItem>) -> Self
Create a new syntax definition.
Sourcepub fn item_count(&self) -> usize
pub fn item_count(&self) -> usize
Number of parser items.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SyntaxDef
impl RefUnwindSafe for SyntaxDef
impl Send for SyntaxDef
impl Sync for SyntaxDef
impl Unpin for SyntaxDef
impl UnsafeUnpin for SyntaxDef
impl UnwindSafe for SyntaxDef
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