pub struct Parser { /* private fields */ }Expand description
A Luau parser.
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn with_input(self, input: &str) -> Self
pub fn with_input(self, input: &str) -> Self
Set the parser’s input. Meant to be chained.
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.
§Panics
If the uri was never parsed before.
Sourcepub const fn get_all_asts(&self) -> &Cache
pub const fn get_all_asts(&self) -> &Cache
Get all cached CSTs.
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the cache.
Trait Implementations§
impl Eq for Parser
impl StructuralPartialEq for Parser
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl !Send for Parser
impl !Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
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