diff options
Diffstat (limited to 'sloth/src/main.rs')
| -rw-r--r-- | sloth/src/main.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sloth/src/main.rs b/sloth/src/main.rs index 5ce631a..dec55de 100644 --- a/sloth/src/main.rs +++ b/sloth/src/main.rs @@ -22,7 +22,7 @@ use inkwell::targets::FileType; use itertools::Itertools; use lexer::Lexer; use parser::AstParser; -use symtable::{Symbol, SymbolTable}; +use symtable::{Symbol, SymbolTable, ValueSymbol}; use crate::analysis::analyze; use crate::symtable::Type; @@ -49,6 +49,18 @@ fn main() { global_symtable.insert("Float".into(), Symbol::Type(Type::Float)); global_symtable.insert("Bool".into(), Symbol::Type(Type::Boolean)); + let dummy = Symbol::Value(ValueSymbol { + typ: Type::Function { + inputs: vec![], + output: Box::new(Type::Void), + }, + id: 0, + }); + + global_symtable.insert("vpushi".into(), dummy.clone()); + global_symtable.insert("vpushf".into(), dummy.clone()); + global_symtable.insert("vpushb".into(), dummy); + // Parsing let tokens = Lexer::new(&source).collect_vec(); let mut ast = AstParser::parse(tokens, global_symtable).unwrap(); |
