Formatting

This commit is contained in:
Brian Carroll 2022-01-28 16:50:05 +00:00
parent e43cd8c399
commit 929ee7f560
3 changed files with 14 additions and 13 deletions

View File

@ -27,9 +27,9 @@ pub const INSTRUCTIONS: &str = "Enter an expression, or :help, or :exit/:q.\n";
pub const PROMPT: &str = concatcp!("\n", BLUE, "»", END_COL, " "); pub const PROMPT: &str = concatcp!("\n", BLUE, "»", END_COL, " ");
pub const CONT_PROMPT: &str = concatcp!(BLUE, "", END_COL, " "); pub const CONT_PROMPT: &str = concatcp!(BLUE, "", END_COL, " ");
mod app_memory;
#[cfg(feature = "llvm")] #[cfg(feature = "llvm")]
mod eval; mod eval;
mod app_memory;
#[cfg(feature = "llvm")] #[cfg(feature = "llvm")]
mod gen; mod gen;

View File

@ -157,7 +157,10 @@ fn unroll_aliases<'a, M: AppMemory>(env: &Env<'a, 'a, M>, mut content: &'a Conte
content content
} }
fn unroll_recursion_var<'a, M: AppMemory>(env: &Env<'a, 'a, M>, mut content: &'a Content) -> &'a Content { fn unroll_recursion_var<'a, M: AppMemory>(
env: &Env<'a, 'a, M>,
mut content: &'a Content,
) -> &'a Content {
while let Content::RecursionVar { structure, .. } = content { while let Content::RecursionVar { structure, .. } = content {
content = env.subs.get_content_without_compacting(*structure); content = env.subs.get_content_without_compacting(*structure);
} }
@ -216,15 +219,9 @@ fn tag_id_from_data<'a, M: AppMemory>(
let tag_id_addr = data_addr + offset as usize; let tag_id_addr = data_addr + offset as usize;
match union_layout.tag_id_builtin() { match union_layout.tag_id_builtin() {
Builtin::Bool => { Builtin::Bool => env.app_memory.deref_bool(tag_id_addr) as i64,
env.app_memory.deref_bool(tag_id_addr) as i64 Builtin::Int(IntWidth::U8) => env.app_memory.deref_u8(tag_id_addr) as i64,
} Builtin::Int(IntWidth::U16) => env.app_memory.deref_u16(tag_id_addr) as i64,
Builtin::Int(IntWidth::U8) => {
env.app_memory.deref_u8(tag_id_addr) as i64
}
Builtin::Int(IntWidth::U16) => {
env.app_memory.deref_u16(tag_id_addr) as i64
}
Builtin::Int(IntWidth::U64) => { Builtin::Int(IntWidth::U64) => {
// used by non-recursive unions at the // used by non-recursive unions at the
// moment, remove if that is no longer the case // moment, remove if that is no longer the case
@ -1129,7 +1126,11 @@ fn byte_to_ast<'a, M: AppMemory>(env: &Env<'a, '_, M>, value: u8, content: &Cont
} }
} }
fn num_to_ast<'a, M: AppMemory>(env: &Env<'a, '_, M>, num_expr: Expr<'a>, content: &Content) -> Expr<'a> { fn num_to_ast<'a, M: AppMemory>(
env: &Env<'a, '_, M>,
num_expr: Expr<'a>,
content: &Content,
) -> Expr<'a> {
use Content::*; use Content::*;
let arena = env.arena; let arena = env.arena;

View File

@ -1,5 +1,5 @@
use crate::repl::eval;
use crate::repl::app_memory::AppMemoryInternal; use crate::repl::app_memory::AppMemoryInternal;
use crate::repl::eval;
use bumpalo::Bump; use bumpalo::Bump;
use inkwell::context::Context; use inkwell::context::Context;
use inkwell::module::Linkage; use inkwell::module::Linkage;