typescript-jit 0.1.0

A native Typescript parser and JIT runner.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::{collections::HashMap, sync::Arc};

use super::value::Value;

pub struct Context {
    pub parent: Option<Arc<Context>>,
    pub variables: HashMap<String, Arc<Value>>,
}

impl Context {
    pub fn new() -> Arc<Context> {
        Arc::new(Self {
            parent: None,
            variables: HashMap::new(),
        })
    }
}