diff --git a/Cargo.lock b/Cargo.lock index 298844a..da1ed9d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,5 +3,5 @@ version = 4 [[package]] -name = "mot" +name = "zern" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index f6f35f1..dc7f217 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "mot" +name = "zern" version = "0.1.0" edition = "2024" diff --git a/README.md b/README.md index c559a55..2f9101e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# mot +# zern A very cool language diff --git a/examples/fib.mot b/examples/fib.zr similarity index 100% rename from examples/fib.mot rename to examples/fib.zr diff --git a/src/codegen_x86_64.rs b/src/codegen_x86_64.rs index 0325aaa..7a4e719 100644 --- a/src/codegen_x86_64.rs +++ b/src/codegen_x86_64.rs @@ -3,7 +3,7 @@ use std::{error::Error, fmt::Write}; use crate::{ codegen::{Codegen, Env}, parser::{Expr, Stmt}, - tokenizer::{MotError, TokenType, error}, + tokenizer::{TokenType, ZernError, error}, }; pub struct CodegenX86_64 { diff --git a/src/parser.rs b/src/parser.rs index 00e9d88..1d1e879 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -1,6 +1,6 @@ use std::error::Error; -use crate::tokenizer::{MotError, Token, TokenType, error}; +use crate::tokenizer::{Token, TokenType, ZernError, error}; #[derive(Debug, Clone)] pub struct Param { diff --git a/src/tokenizer.rs b/src/tokenizer.rs index 0cc718c..1d635bf 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -44,22 +44,22 @@ pub enum TokenType { } #[derive(Debug)] -pub struct MotError { +pub struct ZernError { pub loc: Loc, pub message: String, } -impl fmt::Display for MotError { +impl fmt::Display for ZernError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{} \x1b[91mERROR\x1b[0m: {}", self.loc, self.message) } } -impl std::error::Error for MotError {} +impl std::error::Error for ZernError {} macro_rules! error { ($loc:expr, $msg:expr) => { - Err(Box::new(MotError { + Err(Box::new(ZernError { loc: $loc.clone(), message: $msg.into(), }))