diff --git a/src/compilation/pipeline.rs b/src/compilation/pipeline.rs index 5e99b76..2ad216b 100644 --- a/src/compilation/pipeline.rs +++ b/src/compilation/pipeline.rs @@ -1,13 +1,10 @@ use std::{collections::HashMap, env, fs, path::PathBuf}; -use crate::{ - frontend::{ - lexer::Lexer, - parser::Parser, - source::{SourceFile, SourceReporter}, - token::Token, - }, - repr::{uir::Bundle, uir_gen::gen_uir}, +use crate::frontend::{ + lexer::Lexer, + parser::Parser, + source::{SourceFile, SourceReporter}, + token::Token, }; #[allow(dead_code)] @@ -241,10 +238,5 @@ impl Workspace { if let Stage::Parser = self.config.max_stage { return; } - - let mut bundle = Bundle::new(); - gen_uir(&parser.compilation_module, &mut bundle); - - bundle.show(); } } diff --git a/src/frontend/parser.rs b/src/frontend/parser.rs index dfb8345..61cffae 100644 --- a/src/frontend/parser.rs +++ b/src/frontend/parser.rs @@ -1331,9 +1331,13 @@ impl Parser { let mut span = self.cur_token().get_source_ref(); self.advance_index(); // consume 'struct' + let prev_scope = self.parse_scope; + self.parse_scope = ParseScope::Struct; + // parse block let contents = self.parse_code_block()?; span = span.combine(contents.source_ref()); + self.parse_scope = prev_scope; Ok(Expr::StructDecl { contents: Box::new(contents), src: span, diff --git a/src/main.rs b/src/main.rs index 3bb5116..19bfe5b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,6 @@ use compilation::pipeline::Workspace; mod compilation; mod frontend; mod pastel; -mod repr; mod walker; const USAGE: &str = "