Add Stmt and incorporate meta statements
This helps split up expressions, meta calls (like includes) that can be expanded into more expressions. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
// want it to clog the warnings yet.
|
||||
#![allow(dead_code)]
|
||||
|
||||
use crate::syn::ast::SpExpr;
|
||||
use crate::syn::ast::SpStmt;
|
||||
use crate::vm::{error::Result, machine::Machine};
|
||||
use crate::{scope::Scope, syn::span::Span, vm::inst::Inst};
|
||||
use std::cell::RefCell;
|
||||
@@ -33,7 +33,7 @@ impl Quote {
|
||||
/// A table of compiled quotes, their expression trees, and their spans.
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct QuoteTable {
|
||||
table: Vec<(Span, Scope, Vec<SpExpr>, Rc<Vec<Inst>>)>,
|
||||
table: Vec<(Span, Scope, Vec<SpStmt>, Rc<Vec<Inst>>)>,
|
||||
}
|
||||
|
||||
impl QuoteTable {
|
||||
@@ -45,7 +45,7 @@ impl QuoteTable {
|
||||
&mut self,
|
||||
span: Span,
|
||||
scope: Scope,
|
||||
quote: Vec<SpExpr>,
|
||||
quote: Vec<SpStmt>,
|
||||
compiled: Rc<Vec<Inst>>,
|
||||
) -> Quote {
|
||||
let next = Quote(self.table.len());
|
||||
@@ -53,7 +53,7 @@ impl QuoteTable {
|
||||
next
|
||||
}
|
||||
|
||||
pub fn get(&self, quote: Quote) -> &(Span, Scope, Vec<SpExpr>, Rc<Vec<Inst>>) {
|
||||
pub fn get(&self, quote: Quote) -> &(Span, Scope, Vec<SpStmt>, Rc<Vec<Inst>>) {
|
||||
&self.table[quote.0]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user