From 431c0fdf8c1d7e5f49601c21391ecb78bf72fb5b Mon Sep 17 00:00:00 2001 From: greg Date: Sat, 28 Apr 2018 15:46:11 -0700 Subject: [PATCH] Starting to try and annotate real compiler passes --- schala-codegen/src/lib.rs | 2 +- schala-lang/src/lib.rs | 1 - schala-lang/src/tokenizing.rs | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/schala-codegen/src/lib.rs b/schala-codegen/src/lib.rs index a64a29b..8a176df 100644 --- a/schala-codegen/src/lib.rs +++ b/schala-codegen/src/lib.rs @@ -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())) } }; diff --git a/schala-lang/src/lib.rs b/schala-lang/src/lib.rs index 1f6af72..a0ca73e 100644 --- a/schala-lang/src/lib.rs +++ b/schala-lang/src/lib.rs @@ -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(); diff --git a/schala-lang/src/tokenizing.rs b/schala-lang/src/tokenizing.rs index 14e4b3c..abeb947 100644 --- a/schala-lang/src/tokenizing.rs +++ b/schala-lang/src/tokenizing.rs @@ -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> = Peekable; +#[schala_codegen::compiler_pass = "tokenization"] pub fn tokenize(input: &str) -> Vec { let mut tokens: Vec = Vec::new();