update version, add version' global constant
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "lamm"
|
name = "lamm"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
description = "a simple, functional paradigm programming language which uses Polish notation"
|
description = "a simple, functional paradigm programming language which uses Polish notation"
|
||||||
|
|||||||
10
src/lib.rs
10
src/lib.rs
@@ -178,8 +178,14 @@ impl<'a, R: BufRead> Runtime<'a, R> {
|
|||||||
pub fn new(reader: R) -> Self {
|
pub fn new(reader: R) -> Self {
|
||||||
Self {
|
Self {
|
||||||
tokenizer: Tokenizer::new(reader).peekable(),
|
tokenizer: Tokenizer::new(reader).peekable(),
|
||||||
global_types: HashMap::new(),
|
global_types: HashMap::from([
|
||||||
globals: HashMap::new(),
|
("version'".into(), Type::String)
|
||||||
|
]),
|
||||||
|
globals: HashMap::from([
|
||||||
|
("version'".into(), Arc::new(
|
||||||
|
Mutex::new(
|
||||||
|
Object::value(Value::String(env!("CARGO_PKG_VERSION").into()), HashMap::new(), HashMap::new()))))
|
||||||
|
]),
|
||||||
parser: None,
|
parser: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user