Refactor some more

This commit is contained in:
Sofia 2025-07-25 15:55:14 +03:00
parent 6ee43d4012
commit 0b3ee3bf92
7 changed files with 15 additions and 11 deletions

View File

@ -3,10 +3,14 @@
//! used for unwrapping syntax sugar, and then be transformed into Reid MIR.
use std::path::PathBuf;
use crate::{lexer::FullToken, token_stream::TokenRange};
use token_stream::TokenRange;
use crate::lexer::FullToken;
pub mod lexer;
pub mod parse;
pub mod process;
pub mod token_stream;
#[derive(Debug, Clone)]
pub struct Type(pub TypeKind, pub TokenRange);

View File

@ -1,8 +1,7 @@
use crate::ast::*;
use crate::{
lexer::Token,
token_stream::{Error, TokenStream},
};
use crate::lexer::Token;
use super::token_stream::{Error, TokenStream};
pub trait Parse
where

View File

@ -4,10 +4,10 @@ use std::{
};
use crate::{
ast::token_stream::{self, TokenRange},
codegen,
lexer::{self, Cursor, FullToken, Position},
mir::{self, pass, Metadata, SourceModuleId},
token_stream::{self, TokenRange},
};
fn label(text: &str) -> &str {

View File

@ -43,24 +43,25 @@
use std::path::PathBuf;
use ast::{
lexer::{self, FullToken, Token},
token_stream::TokenStream,
};
use codegen::intrinsics::{form_intrinsic_binops, form_intrinsics};
use error_raporting::{ErrorKind as ErrorRapKind, ErrorModules, ReidError};
use lexer::FullToken;
use mir::{
linker::LinkerPass, typecheck::TypeCheck, typeinference::TypeInference, typerefs::TypeRefs,
};
use reid_lib::{compile::CompileOutput, Context};
use crate::{ast::TopLevelStatement, lexer::Token, token_stream::TokenStream};
use crate::ast::TopLevelStatement;
mod ast;
mod codegen;
pub mod error_raporting;
pub mod ld;
mod lexer;
pub mod mir;
mod pad_adapter;
mod token_stream;
mod util;
pub fn parse_module<'map, T: Into<String>>(

View File

@ -5,9 +5,9 @@
use std::{collections::HashMap, path::PathBuf};
use crate::{
ast::token_stream::TokenRange,
codegen::intrinsics::IntrinsicFunction,
lexer::{FullToken, Position},
token_stream::TokenRange,
};
mod fmt;