move parser and add semicolon

This commit is contained in:
me 2025-12-14 09:24:34 +02:00
parent c66a193a6e
commit ce817c9f89
4 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,4 @@
pub mod ast; pub mod ast;
pub mod interpret; pub mod interpret;
pub mod parser;
pub mod runtime; pub mod runtime;

2
src/parser/mod.rs Normal file
View file

@ -0,0 +1,2 @@
pub mod parser;
pub use parser::*;

View file

@ -47,6 +47,11 @@ fn scan(source: String) -> Vec<LocatedToken> {
end: scanner.cursor(), end: scanner.cursor(),
token: Token::Comma, token: Token::Comma,
}), }),
';' => tokens.push(LocatedToken {
start,
end: scanner.cursor(),
token: Token::Semicolon,
}),
'{' => tokens.push(LocatedToken { '{' => tokens.push(LocatedToken {
start, start,
end: scanner.cursor(), end: scanner.cursor(),

View file

@ -1,4 +1,3 @@
pub mod parser;
pub mod runtime; pub mod runtime;
pub use runtime::*; pub use runtime::*;