adapt to TypeDict trait

This commit is contained in:
Michael Sippel 2024-10-04 02:14:54 +02:00
parent 0cbbcd5b24
commit 8fd59f04ee
Signed by: senvas
GPG key ID: F96CF119C34B64A6
3 changed files with 112 additions and 65 deletions
ltcc/src

View file

@ -6,6 +6,7 @@ use {
std::{boxed::Box, ops::Deref},
std::io::Write,
tiny_ansi::TinyAnsi,
laddertypes::dict::TypeDict,
ltcore::{
lexer::InputRegionTag,
expr::{LTExpr, Statement},
@ -32,8 +33,7 @@ fn main() {
let mut linker = tisc::Linker::new();
let root_scope = ltcore::runtime::init_runtime(&mut linker);
let main_scope = Scope::with_parent(&root_scope);
let typectx = main_scope.read().unwrap().typectx.clone();
let mut main_scope = Scope::with_parent(&root_scope);
for path in args.sources {
let iter_chars = iterate_text::file::characters::IterateFileCharacters::new(path.clone());
@ -49,13 +49,13 @@ fn main() {
})
.peekable();
match ltcore::parser::parse_expr( &typectx, &mut program_tokens ) {
Ok( ast ) => {
match ltcore::parser::parse_expr( &mut main_scope, &mut program_tokens ) {
Ok( mut ast ) => {
let (exports, diagnostics, proc_code) = ProcedureCompiler::new(&main_scope)
.compile(&ast)
.into_asm(&path);
for (region, message) in diagnostics {
for (region, message) in diagnostics {
crate::diagnostic::print_diagnostic(
path.as_str(),
region,