Initial commit

Includes: runtime base from a previous project, syn(tax) module with
parser and lexer

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-09-01 17:32:48 -07:00
commit 178ed4a952
24 changed files with 1139 additions and 0 deletions

30
runtime/src/obj/int.rs Normal file
View File

@@ -0,0 +1,30 @@
use crate::obj::{names::*, prelude::*};
use shredder::Scan;
#[derive(Debug, Scan)]
pub struct Int {
value: i64,
attrs: Attrs,
}
impl Int {
pub fn new(value: i64) -> ObjRef<Self> {
let obj_ref = ObjRef::new(Self {
value,
attrs: Default::default(),
});
{
write_obj!(let obj = obj_ref);
obj.set_attr(*GET_ATTR_MEMBER_SYM, GET_ATTR_MEMBER_FUN.clone());
}
obj_ref
}
pub fn value(&self) -> i64 {
self.value
}
}
impl_obj!(Int, attrs);