first documentation run
This commit is contained in:
parent
e065108f58
commit
f59e6a5fd5
21 changed files with 64 additions and 23 deletions
|
@ -71,7 +71,7 @@ pub enum ParserError {
|
|||
SuperclassMethodNameExpected(usize),
|
||||
}
|
||||
|
||||
/// Parse the Lox language.
|
||||
/// Parse the Lox language tokens into an abstract syntax tree.
|
||||
#[derive(Debug, Clone)]
|
||||
struct Parser {
|
||||
current: usize,
|
||||
|
@ -655,7 +655,8 @@ impl Parser {
|
|||
}
|
||||
}
|
||||
|
||||
/// Try to parse the provided tokens into an AST.
|
||||
/// Try to parse the provided tokens into an Abstract Syntax Tree (AST).
|
||||
/// Return a list of statements that can be executed by the interpreter.
|
||||
pub fn ast(tokens: Vec<Token>) -> Result<Vec<Statement>, ParserError> {
|
||||
let mut parser = Parser::new(tokens)?;
|
||||
parser.run()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue