Starting to try and annotate real compiler passes

This commit is contained in:
greg 2018-04-28 15:46:11 -07:00
parent 9015cbee21
commit 431c0fdf8c
3 changed files with 3 additions and 2 deletions

View File

@ -46,7 +46,7 @@ pub fn compiler_pass_sequence(input: TokenStream) -> TokenStream {
let output = quote! {
fn new_execute(&mut self, input: &str, _options: &EvalOptions) -> FinishedComputation {
let mut evaluation = UnfinishedComputation::default();
let evaluation = UnfinishedComputation::default();
evaluation.output(Err(#from_macro.to_string()))
}
};

View File

@ -53,7 +53,6 @@ impl ProgrammingLanguageInterface for Schala {
format!("schala")
}
#[schala_codegen::compiler_pass = "yolo"]
fn execute(&mut self, input: &str, options: &EvalOptions) -> FinishedComputation {
let mut evaluation = UnfinishedComputation::default();

View File

@ -3,6 +3,7 @@ use std::collections::HashMap;
use std::rc::Rc;
use std::iter::{Iterator, Peekable};
use std::fmt;
use ::schala_codegen;
#[derive(Debug, PartialEq, Clone)]
pub enum TokenType {
@ -107,6 +108,7 @@ fn is_operator(c: &char) -> bool {
type CharIter<I: Iterator<Item=(usize,usize,char)>> = Peekable<I>;
#[schala_codegen::compiler_pass = "tokenization"]
pub fn tokenize(input: &str) -> Vec<Token> {
let mut tokens: Vec<Token> = Vec::new();