mirror of
https://github.com/MorizzG/rlox.git
synced 2025-12-06 04:12:42 +00:00
Chapter 17: Compiling Expressions done
This commit is contained in:
parent
b86985deaf
commit
1cca1494a4
20 changed files with 702 additions and 129 deletions
|
|
@ -1,5 +1,5 @@
|
|||
mod _resolver;
|
||||
mod error;
|
||||
mod resolve;
|
||||
|
||||
pub use _resolver::resolve;
|
||||
pub use error::ResolverError;
|
||||
pub use resolve::resolve;
|
||||
|
|
|
|||
|
|
@ -64,12 +64,9 @@ pub fn run_repl(runtime: &mut Runtime) {
|
|||
pub fn run(source: &str, runtime: &mut Runtime) -> Result<(), LoxError> {
|
||||
let tokens: Vec<Token> = scan_tokens(source)?;
|
||||
|
||||
/* let token_str = tokens
|
||||
.iter()
|
||||
.map(|token| token.to_string())
|
||||
.join(" ");
|
||||
let token_str = itertools::Itertools::join(&mut tokens.iter().map(|token| token.to_string()), " ");
|
||||
|
||||
println!("{token_str}"); */
|
||||
println!("{token_str}");
|
||||
|
||||
let statements = parse_tokens(tokens)?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue