Move bx macro to util

This commit is contained in:
greg 2019-07-19 22:29:02 -07:00
parent 37c77d93d7
commit 88029fc55a
3 changed files with 5 additions and 12 deletions

View File

@ -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;

View File

@ -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

View File

@ -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>>,