From 944916d6af8cf20907497996169ead5c6ffa5a0f Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 21 Oct 2019 04:09:43 -0700 Subject: [PATCH] Alias for symbol table handle type --- schala-lang/language/src/eval.rs | 7 +++---- schala-lang/language/src/schala.rs | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/schala-lang/language/src/eval.rs b/schala-lang/language/src/eval.rs index 0c96451..f97add4 100644 --- a/schala-lang/language/src/eval.rs +++ b/schala-lang/language/src/eval.rs @@ -1,11 +1,10 @@ - -use std::cell::RefCell; use std::rc::Rc; use std::fmt::Write; use std::io; use itertools::Itertools; +use crate::schala::SymbolTableHandle; use crate::util::ScopeStack; use crate::reduced_ast::{BoundVars, ReducedAST, Stmt, Expr, Lit, Func, Alternative, Subpattern}; use crate::symbol_table::{SymbolSpec, Symbol, SymbolTable, FullyQualifiedSymbolName}; @@ -15,11 +14,11 @@ mod test; pub struct State<'a> { values: ScopeStack<'a, Rc, ValueEntry>, - symbol_table_handle: Rc>, + symbol_table_handle: SymbolTableHandle, } impl<'a> State<'a> { - pub fn new(symbol_table_handle: Rc>) -> State<'a> { + pub fn new(symbol_table_handle: SymbolTableHandle) -> State<'a> { let values = ScopeStack::new(Some(format!("global"))); State { values, symbol_table_handle } } diff --git a/schala-lang/language/src/schala.rs b/schala-lang/language/src/schala.rs index 9516506..85548d1 100644 --- a/schala-lang/language/src/schala.rs +++ b/schala-lang/language/src/schala.rs @@ -12,6 +12,8 @@ LangMetaRequest, LangMetaResponse, GlobalOutputStats, DebugResponse, DebugAsk}; use crate::{ast, reduced_ast, tokenizing, parsing, eval, typechecking, symbol_table}; +pub type SymbolTableHandle = Rc>; + /// All the state necessary to parse and execute a Schala program are stored in this struct. /// `state` represents the execution state for the AST-walking interpreter, the other fields /// should be self-explanatory.