diff --git a/compiler/cl-ast/src/ast.rs b/compiler/cl-ast/src/ast.rs index 8c87886..d2ee65f 100644 --- a/compiler/cl-ast/src/ast.rs +++ b/compiler/cl-ast/src/ast.rs @@ -9,9 +9,9 @@ //! - [AssignKind], [BinaryKind], and [UnaryKind] operators //! - [Ty] and [TyKind]: Type qualifiers //! - [Path]: Path expressions -use cl_structures::span::*; +use cl_structures::{intern::interned::Interned, span::*}; -pub use cl_structures::arena::global_intern::Sym; +pub type Sym = Interned<'static, str>; /// Whether a binding ([Static] or [Let]) or reference is mutable or not #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] diff --git a/compiler/cl-interpret/src/builtin.rs b/compiler/cl-interpret/src/builtin.rs index 041da76..525107c 100644 --- a/compiler/cl-interpret/src/builtin.rs +++ b/compiler/cl-interpret/src/builtin.rs @@ -243,7 +243,7 @@ macro cmp ($a:expr, $b:expr, $empty:literal, $op:tt) { (ConValue::Int(a), ConValue::Int(b)) => Ok(ConValue::Bool(a $op b)), (ConValue::Bool(a), ConValue::Bool(b)) => Ok(ConValue::Bool(a $op b)), (ConValue::Char(a), ConValue::Char(b)) => Ok(ConValue::Bool(a $op b)), - (ConValue::String(a), ConValue::String(b)) => Ok(ConValue::Bool(a.get() $op b.get())), + (ConValue::String(a), ConValue::String(b)) => Ok(ConValue::Bool(&**a $op &**b)), _ => Err(Error::TypeError) } } diff --git a/compiler/cl-interpret/src/lib.rs b/compiler/cl-interpret/src/lib.rs index b95cb25..54cfacd 100644 --- a/compiler/cl-interpret/src/lib.rs +++ b/compiler/cl-interpret/src/lib.rs @@ -148,7 +148,7 @@ pub mod temp_type_impl { (Self::Int(a), Self::Int(b)) => Ok(Self::Bool(a $op b)), (Self::Bool(a), Self::Bool(b)) => Ok(Self::Bool(a $op b)), (Self::Char(a), Self::Char(b)) => Ok(Self::Bool(a $op b)), - (Self::String(a), Self::String(b)) => Ok(Self::Bool(a.get() $op b.get())), + (Self::String(a), Self::String(b)) => Ok(Self::Bool(&**a $op &**b)), _ => Err(Error::TypeError) } } diff --git a/compiler/cl-parser/src/inliner.rs b/compiler/cl-parser/src/inliner.rs index 73602fb..e4913b0 100644 --- a/compiler/cl-parser/src/inliner.rs +++ b/compiler/cl-parser/src/inliner.rs @@ -64,8 +64,8 @@ impl Fold for ModuleInliner { /// Traverses down the module tree, entering ever nested directories fn fold_module(&mut self, m: Module) -> Module { let Module { name, kind } = m; - let sym = name.0.get().expect("Could not get name!"); - self.path.push(sym); // cd ./name + let sym = name.0; + self.path.push(&*sym); // cd ./name let kind = self.fold_module_kind(kind); diff --git a/compiler/cl-typeck/src/type_resolver.rs b/compiler/cl-typeck/src/type_resolver.rs index f0eaaca..63edda4 100644 --- a/compiler/cl-typeck/src/type_resolver.rs +++ b/compiler/cl-typeck/src/type_resolver.rs @@ -63,8 +63,7 @@ impl<'a> TypeResolvable<'a> for Meta { #[allow(unused_variables)] fn resolve_type(&'a self, prj: &mut Prj<'a>, id: DefID) -> Result { let Self { name: Identifier(name), kind } = self; - let name = name.get().unwrap_or_default(); - match (name.as_str(), kind) { + match (name.as_ref(), kind) { ("intrinsic", MetaKind::Equals(Literal::String(intrinsic))) => Ok(DefKind::Type( TypeKind::Intrinsic(intrinsic.parse().map_err(|_| "unknown intrinsic type")?), )),