Compare commits
3 Commits
cd4045b8e7
...
7b7e20859f
Author | SHA1 | Date | |
---|---|---|---|
|
7b7e20859f | ||
|
d3ebcc9654 | ||
|
2c64bb6c34 |
@ -152,9 +152,11 @@ impl Expression {
|
|||||||
Expression { id, kind, type_anno: None }
|
Expression { id, kind, type_anno: None }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* - commented out because unused
|
||||||
pub fn with_anno(id: ItemId, kind: ExpressionKind, type_anno: TypeIdentifier) -> Expression {
|
pub fn with_anno(id: ItemId, kind: ExpressionKind, type_anno: TypeIdentifier) -> Expression {
|
||||||
Expression { id, kind, type_anno: Some(type_anno) }
|
Expression { id, kind, type_anno: Some(type_anno) }
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
#[derive(Debug, PartialEq, Clone)]
|
||||||
|
@ -2,10 +2,10 @@ use std::rc::Rc;
|
|||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
use crate::schala::SymbolTableHandle;
|
//use crate::schala::SymbolTableHandle;
|
||||||
use crate::util::ScopeStack;
|
use crate::util::ScopeStack;
|
||||||
use crate::reduced_ast::{BoundVars, ReducedAST, Stmt, Expr, Lit, Func, Alternative, Subpattern};
|
use crate::reduced_ast::{BoundVars, ReducedAST, Stmt, Expr, Lit, Func, Alternative, Subpattern};
|
||||||
use crate::symbol_table::{SymbolSpec, Symbol, SymbolTable, FullyQualifiedSymbolName};
|
//use crate::symbol_table::{SymbolSpec, Symbol, SymbolTable, FullyQualifiedSymbolName};
|
||||||
use crate::builtin::Builtin;
|
use crate::builtin::Builtin;
|
||||||
|
|
||||||
mod test;
|
mod test;
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
//! It defines the `Schala` type, which contains the state for a Schala REPL, and implements
|
//! It defines the `Schala` type, which contains the state for a Schala REPL, and implements
|
||||||
//! `ProgrammingLanguageInterface` and the chain of compiler passes for it.
|
//! `ProgrammingLanguageInterface` and the chain of compiler passes for it.
|
||||||
|
|
||||||
extern crate itertools;
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate lazy_static;
|
extern crate lazy_static;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
@ -14,10 +13,7 @@ extern crate maplit;
|
|||||||
extern crate schala_repl;
|
extern crate schala_repl;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate schala_lang_codegen;
|
extern crate schala_lang_codegen;
|
||||||
extern crate ena;
|
|
||||||
extern crate derivative;
|
extern crate derivative;
|
||||||
extern crate colored;
|
|
||||||
extern crate radix_trie;
|
|
||||||
|
|
||||||
|
|
||||||
macro_rules! bx {
|
macro_rules! bx {
|
||||||
|
@ -155,7 +155,6 @@ impl<'a> Reducer<'a> {
|
|||||||
|
|
||||||
fn expression(&mut self, expr: &Expression) -> Expr {
|
fn expression(&mut self, expr: &Expression) -> Expr {
|
||||||
use crate::ast::ExpressionKind::*;
|
use crate::ast::ExpressionKind::*;
|
||||||
let symbol_table = self.symbol_table;
|
|
||||||
let ref input = expr.kind;
|
let ref input = expr.kind;
|
||||||
match input {
|
match input {
|
||||||
NatLiteral(n) => Expr::Lit(Lit::Nat(*n)),
|
NatLiteral(n) => Expr::Lit(Lit::Nat(*n)),
|
||||||
|
@ -18,6 +18,7 @@ pub type SourceMapHandle = Rc<RefCell<source_map::SourceMap>>;
|
|||||||
/// 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
|
/// `state` represents the execution state for the AST-walking interpreter, the other fields
|
||||||
/// should be self-explanatory.
|
/// should be self-explanatory.
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct Schala {
|
pub struct Schala {
|
||||||
source_reference: SourceReference,
|
source_reference: SourceReference,
|
||||||
source_map: SourceMapHandle,
|
source_map: SourceMapHandle,
|
||||||
|
@ -84,6 +84,7 @@ impl fmt::Display for ScopeSegment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl ScopeSegment {
|
impl ScopeSegment {
|
||||||
|
#[allow(dead_code)]
|
||||||
pub fn new(name: Rc<String>) -> ScopeSegment {
|
pub fn new(name: Rc<String>) -> ScopeSegment {
|
||||||
ScopeSegment { name }
|
ScopeSegment { name }
|
||||||
}
|
}
|
||||||
@ -134,6 +135,7 @@ impl SymbolTable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Symbol {
|
pub struct Symbol {
|
||||||
pub local_name: Rc<String>, //TODO does this need to be pub?
|
pub local_name: Rc<String>, //TODO does this need to be pub?
|
||||||
|
@ -31,6 +31,6 @@ fn main() {
|
|||||||
fn command_line_options() -> getopts::Options {
|
fn command_line_options() -> getopts::Options {
|
||||||
let mut options = getopts::Options::new();
|
let mut options = getopts::Options::new();
|
||||||
options.optflag("h", "help", "Show help text");
|
options.optflag("h", "help", "Show help text");
|
||||||
options.optflag("w", "webapp", "Start up web interpreter");
|
//options.optflag("w", "webapp", "Start up web interpreter");
|
||||||
options
|
options
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user