Adjust some doc comments

This commit is contained in:
Greg Shuflin 2021-10-16 18:05:13 -07:00
parent 6d84675ff8
commit 25bffa339c

View File

@ -12,15 +12,18 @@ use crate::error::SchalaError;
pub type SymbolTableHandle = Rc<RefCell<symbol_table::SymbolTable>>; pub type SymbolTableHandle = Rc<RefCell<symbol_table::SymbolTable>>;
/// All the state necessary to parse and execute a Schala program are stored in this struct. /// 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.
#[allow(dead_code)] #[allow(dead_code)]
pub struct Schala { pub struct Schala {
/// Holds a reference to the original source code, parsed into line and character
source_reference: SourceReference, source_reference: SourceReference,
/// Execution state for AST-walking interpreter
state: eval::State<'static>, state: eval::State<'static>,
/// Keeps track of symbols and scopes
symbol_table: SymbolTableHandle, symbol_table: SymbolTableHandle,
resolver: crate::scope_resolution::ScopeResolver<'static>, resolver: crate::scope_resolution::ScopeResolver<'static>,
/// Contains information for type-checking
type_context: typechecking::TypeContext<'static>, type_context: typechecking::TypeContext<'static>,
/// Schala Parser
active_parser: parsing::Parser, active_parser: parsing::Parser,
} }
@ -40,7 +43,6 @@ impl Schala {
fn new_blank_env() -> Schala { fn new_blank_env() -> Schala {
let symbols = Rc::new(RefCell::new(symbol_table::SymbolTable::new())); let symbols = Rc::new(RefCell::new(symbol_table::SymbolTable::new()));
Schala { Schala {
//TODO maybe these can be the same structure
source_reference: SourceReference::new(), source_reference: SourceReference::new(),
symbol_table: symbols.clone(), symbol_table: symbols.clone(),
resolver: crate::scope_resolution::ScopeResolver::new(symbols.clone()), resolver: crate::scope_resolution::ScopeResolver::new(symbols.clone()),