pub struct Parser<'a> { /* private fields */ }Expand description
A Luau parser.
Implementations§
Source§impl<'a> Parser<'a>
impl<'a> Parser<'a>
Sourcepub fn get_ast(&self, uri: &str) -> &Cst
pub fn get_ast(&self, uri: &str) -> &Cst
Get a specific CST from the cache, this function assumes the
cst does exist. If it may or may not exist, use
maybe_get_ast.
Sourcepub fn get_or_create(&mut self, uri: &str, code: &'a str) -> Cst
pub fn get_or_create(&mut self, uri: &str, code: &'a str) -> Cst
Get a specific CST from the cache, or parse code and return the
Sourcepub fn maybe_get_ast(&self, uri: &str) -> Option<&Cst>
pub fn maybe_get_ast(&self, uri: &str) -> Option<&Cst>
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the cache.
Auto Trait Implementations§
impl<'a> Freeze for Parser<'a>
impl<'a> RefUnwindSafe for Parser<'a>
impl<'a> !Send for Parser<'a>
impl<'a> !Sync for Parser<'a>
impl<'a> Unpin for Parser<'a>
impl<'a> UnwindSafe for Parser<'a>
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