documentation and cargo.toml changes
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
name = "lamm"
|
name = "lamm"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
license = "MIT"
|
||||||
|
description = "a simple, functional paradigm programming language which uses Polish notation"
|
||||||
|
repository = "https://github.com/minneelyyyy/lamm"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
regex = "1.11"
|
regex = "1.11"
|
||||||
@@ -60,6 +60,7 @@ enum Object {
|
|||||||
Function(Function),
|
Function(Function),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Executes an input of ParseTrees
|
||||||
pub struct Executor<I: Iterator<Item = Result<ParseTree, ParseError>>> {
|
pub struct Executor<I: Iterator<Item = Result<ParseTree, ParseError>>> {
|
||||||
exprs: I,
|
exprs: I,
|
||||||
globals: HashMap<String, Object>,
|
globals: HashMap<String, Object>,
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ impl Display for Type {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Represents the result of executing a ParseTree with an Executor
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq)]
|
||||||
pub enum Value {
|
pub enum Value {
|
||||||
Float(f64),
|
Float(f64),
|
||||||
|
|||||||
@@ -239,6 +239,7 @@ impl ParseTree {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Parses input tokens and produces ParseTrees for an Executor
|
||||||
pub struct Parser<I: Iterator<Item = Result<Token, TokenizeError>>> {
|
pub struct Parser<I: Iterator<Item = Result<Token, TokenizeError>>> {
|
||||||
tokens: I,
|
tokens: I,
|
||||||
|
|
||||||
|
|||||||
@@ -148,6 +148,7 @@ impl Token {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Tokenize an input stream of source code for a Parser
|
||||||
pub struct Tokenizer<R: BufRead> {
|
pub struct Tokenizer<R: BufRead> {
|
||||||
reader: R,
|
reader: R,
|
||||||
tokens: VecDeque<Token>,
|
tokens: VecDeque<Token>,
|
||||||
|
|||||||
Reference in New Issue
Block a user