pub struct LemmyHelp { /* private fields */ }
Implementations§
Source§impl LemmyHelp
impl LemmyHelp
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new parser instance
use lemmy_help::LemmyHelp;
LemmyHelp::new();
Sourcepub fn parse(&mut self, src: &str) -> Result<&Self, Vec<Simple<TagType>>>
pub fn parse(&mut self, src: &str) -> Result<&Self, Vec<Simple<TagType>>>
Parse given lua source code to generate AST representation
use lemmy_help::{LemmyHelp, Nodes};
let mut lemmy = LemmyHelp::default();
let src = r#"
local U = {}
---Add two integar and print it
---@param this number First number
---@param that number Second number
function U.sum(this, that)
print(this + that)
end
return U
"#;
let ast = lemmy.parse(&src).unwrap();
assert!(!ast.nodes().is_empty());
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LemmyHelp
impl RefUnwindSafe for LemmyHelp
impl Send for LemmyHelp
impl Sync for LemmyHelp
impl Unpin for LemmyHelp
impl UnwindSafe for LemmyHelp
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