From 88029fc55a1888b109cb3603c8024406f742eb72 Mon Sep 17 00:00:00 2001 From: greg Date: Fri, 19 Jul 2019 22:29:02 -0700 Subject: [PATCH] Move bx macro to util --- schala-lang/language/src/lib.rs | 9 +-------- schala-lang/language/src/parsing.rs | 4 ---- schala-lang/language/src/util.rs | 4 ++++ 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/schala-lang/language/src/lib.rs b/schala-lang/language/src/lib.rs index 8afe164..c3aab47 100644 --- a/schala-lang/language/src/lib.rs +++ b/schala-lang/language/src/lib.rs @@ -4,7 +4,7 @@ #![feature(slice_patterns, box_patterns, box_syntax)] //! `schala-lang` is where the Schala programming language is actually implemented. -//! It defines the `Schala` type, which contains the state for a Schala REPL, and implements +//! The crate defines the `Schala` type, which contains the state for a Schala REPL, and implements //! `ProgrammingLanguageInterface` and the chain of compiler passes for it. extern crate itertools; @@ -17,16 +17,10 @@ extern crate schala_repl; extern crate schala_lang_codegen; extern crate ena; - -macro_rules! bx { - ($e:expr) => { Box::new($e) } -} - #[macro_use] mod util; #[macro_use] mod typechecking; - mod tokenizing; mod ast; mod parsing; @@ -34,7 +28,6 @@ mod symbol_table; mod builtin; mod reduced_ast; mod eval; - mod schala; pub use schala::Schala; diff --git a/schala-lang/language/src/parsing.rs b/schala-lang/language/src/parsing.rs index 60bd508..9688873 100644 --- a/schala-lang/language/src/parsing.rs +++ b/schala-lang/language/src/parsing.rs @@ -143,15 +143,11 @@ //! mod test; - use std::rc::Rc; - use crate::tokenizing::*; use crate::tokenizing::Kw::*; use crate::tokenizing::TokenKind::*; - use crate::ast::*; - use crate::builtin::{BinOp, PrefixOp}; /// Represents a parsing error diff --git a/schala-lang/language/src/util.rs b/schala-lang/language/src/util.rs index 73add43..70de237 100644 --- a/schala-lang/language/src/util.rs +++ b/schala-lang/language/src/util.rs @@ -2,6 +2,10 @@ use std::collections::HashMap; use std::hash::Hash; use std::cmp::Eq; +macro_rules! bx { + ($e:expr) => { Box::new($e) } +} + #[derive(Default, Debug)] pub struct ScopeStack<'a, T: 'a, V: 'a> where T: Hash + Eq { parent: Option<&'a ScopeStack<'a, T, V>>,