Implemented functions and aliases

This commit is contained in:
2025-03-02 22:49:36 -05:00
parent a9a9642a2a
commit 5dd9ee96ad
20 changed files with 424 additions and 95 deletions

View File

@@ -22,16 +22,21 @@ pub fn main() {
loop {
log!(TRACE, "Entered loop");
let line = match prompt::read_line(&mut shenv) {
let mut line = match prompt::read_line(&mut shenv) {
Ok(line) => line,
Err(e) => {
eprintln!("{}",e);
continue;
}
};
if let Some(line_exp) = expand_aliases(&line, &mut shenv) {
line = line_exp;
}
let input = Rc::new(line);
log!(INFO, "New input: {:?}", input);
let token_stream = Lexer::new(input).lex();
log!(DEBUG, token_stream);
log!(DEBUG, token_stream);
log!(TRACE, "Token stream: {:?}", token_stream);
match Parser::new(token_stream).parse() {
Err(e) => {