[−][src]Function full_moon::parse
pub fn parse(code: &str) -> Result<Ast<'_>, Error<'_>>
Creates an Ast
from Lua code
Errors
If the code passed cannot be tokenized, a TokenizerError will be returned. If the code passed is not valid Lua 5.1 code, an AstError will be returned, specifically AstError::UnexpectedToken.
assert!(full_moon::parse("local x = 1").is_ok()); assert!(full_moon::parse("local x = ").is_err());