basic jit

This commit is contained in:
Romain Paquet 2024-03-08 17:38:23 +01:00
parent 374daaff7f
commit 511be952aa
16 changed files with 971 additions and 495 deletions

View file

@ -1,4 +1,6 @@
use crate::typing::{BinaryOperator, Identifier, ModulePath, Type, TypeContext};
use crate::typing::{BinaryOperator, Identifier, ModulePath, Type, TypingContext};
use super::UnaryOperator;
#[derive(Debug)]
pub struct TypeError {
@ -38,7 +40,7 @@ impl TypeError {
}
impl TypeErrorBuilder {
pub fn context(mut self, ctx: &TypeContext) -> Self {
pub fn context(mut self, ctx: &TypingContext) -> Self {
self.file = ctx.file.clone();
self.module = Some(ctx.module.clone());
self.function = ctx.function.clone();
@ -89,4 +91,8 @@ pub enum TypeErrorKind {
WrongFunctionArguments,
ConditionIsNotBool,
IfElseMismatch,
InvalidUnaryOperator {
operator: UnaryOperator,
inner: Type,
},
}