Refactor some more
This commit is contained in:
		
							parent
							
								
									6ee43d4012
								
							
						
					
					
						commit
						0b3ee3bf92
					
				| @ -3,10 +3,14 @@ | |||||||
| //! used for unwrapping syntax sugar, and then be transformed into Reid MIR.
 | //! used for unwrapping syntax sugar, and then be transformed into Reid MIR.
 | ||||||
| use std::path::PathBuf; | 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 parse; | ||||||
| pub mod process; | pub mod process; | ||||||
|  | pub mod token_stream; | ||||||
| 
 | 
 | ||||||
| #[derive(Debug, Clone)] | #[derive(Debug, Clone)] | ||||||
| pub struct Type(pub TypeKind, pub TokenRange); | pub struct Type(pub TypeKind, pub TokenRange); | ||||||
|  | |||||||
| @ -1,8 +1,7 @@ | |||||||
| use crate::ast::*; | use crate::ast::*; | ||||||
| use crate::{ | use crate::lexer::Token; | ||||||
|     lexer::Token, | 
 | ||||||
|     token_stream::{Error, TokenStream}, | use super::token_stream::{Error, TokenStream}; | ||||||
| }; |  | ||||||
| 
 | 
 | ||||||
| pub trait Parse | pub trait Parse | ||||||
| where | where | ||||||
|  | |||||||
| @ -4,10 +4,10 @@ use std::{ | |||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| use crate::{ | use crate::{ | ||||||
|  |     ast::token_stream::{self, TokenRange}, | ||||||
|     codegen, |     codegen, | ||||||
|     lexer::{self, Cursor, FullToken, Position}, |     lexer::{self, Cursor, FullToken, Position}, | ||||||
|     mir::{self, pass, Metadata, SourceModuleId}, |     mir::{self, pass, Metadata, SourceModuleId}, | ||||||
|     token_stream::{self, TokenRange}, |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| fn label(text: &str) -> &str { | fn label(text: &str) -> &str { | ||||||
|  | |||||||
| @ -43,24 +43,25 @@ | |||||||
| 
 | 
 | ||||||
| use std::path::PathBuf; | use std::path::PathBuf; | ||||||
| 
 | 
 | ||||||
|  | use ast::{ | ||||||
|  |     lexer::{self, FullToken, Token}, | ||||||
|  |     token_stream::TokenStream, | ||||||
|  | }; | ||||||
| use codegen::intrinsics::{form_intrinsic_binops, form_intrinsics}; | use codegen::intrinsics::{form_intrinsic_binops, form_intrinsics}; | ||||||
| use error_raporting::{ErrorKind as ErrorRapKind, ErrorModules, ReidError}; | use error_raporting::{ErrorKind as ErrorRapKind, ErrorModules, ReidError}; | ||||||
| use lexer::FullToken; |  | ||||||
| use mir::{ | use mir::{ | ||||||
|     linker::LinkerPass, typecheck::TypeCheck, typeinference::TypeInference, typerefs::TypeRefs, |     linker::LinkerPass, typecheck::TypeCheck, typeinference::TypeInference, typerefs::TypeRefs, | ||||||
| }; | }; | ||||||
| use reid_lib::{compile::CompileOutput, Context}; | use reid_lib::{compile::CompileOutput, Context}; | ||||||
| 
 | 
 | ||||||
| use crate::{ast::TopLevelStatement, lexer::Token, token_stream::TokenStream}; | use crate::ast::TopLevelStatement; | ||||||
| 
 | 
 | ||||||
| mod ast; | mod ast; | ||||||
| mod codegen; | mod codegen; | ||||||
| pub mod error_raporting; | pub mod error_raporting; | ||||||
| pub mod ld; | pub mod ld; | ||||||
| mod lexer; |  | ||||||
| pub mod mir; | pub mod mir; | ||||||
| mod pad_adapter; | mod pad_adapter; | ||||||
| mod token_stream; |  | ||||||
| mod util; | mod util; | ||||||
| 
 | 
 | ||||||
| pub fn parse_module<'map, T: Into<String>>( | pub fn parse_module<'map, T: Into<String>>( | ||||||
|  | |||||||
| @ -5,9 +5,9 @@ | |||||||
| use std::{collections::HashMap, path::PathBuf}; | use std::{collections::HashMap, path::PathBuf}; | ||||||
| 
 | 
 | ||||||
| use crate::{ | use crate::{ | ||||||
|  |     ast::token_stream::TokenRange, | ||||||
|     codegen::intrinsics::IntrinsicFunction, |     codegen::intrinsics::IntrinsicFunction, | ||||||
|     lexer::{FullToken, Position}, |     lexer::{FullToken, Position}, | ||||||
|     token_stream::TokenRange, |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| mod fmt; | mod fmt; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user