Starting to try and annotate real compiler passes
This commit is contained in:
parent
9015cbee21
commit
431c0fdf8c
@ -46,7 +46,7 @@ pub fn compiler_pass_sequence(input: TokenStream) -> TokenStream {
|
|||||||
|
|
||||||
let output = quote! {
|
let output = quote! {
|
||||||
fn new_execute(&mut self, input: &str, _options: &EvalOptions) -> FinishedComputation {
|
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()))
|
evaluation.output(Err(#from_macro.to_string()))
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -53,7 +53,6 @@ impl ProgrammingLanguageInterface for Schala {
|
|||||||
format!("schala")
|
format!("schala")
|
||||||
}
|
}
|
||||||
|
|
||||||
#[schala_codegen::compiler_pass = "yolo"]
|
|
||||||
fn execute(&mut self, input: &str, options: &EvalOptions) -> FinishedComputation {
|
fn execute(&mut self, input: &str, options: &EvalOptions) -> FinishedComputation {
|
||||||
|
|
||||||
let mut evaluation = UnfinishedComputation::default();
|
let mut evaluation = UnfinishedComputation::default();
|
||||||
|
@ -3,6 +3,7 @@ use std::collections::HashMap;
|
|||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::iter::{Iterator, Peekable};
|
use std::iter::{Iterator, Peekable};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
use ::schala_codegen;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
#[derive(Debug, PartialEq, Clone)]
|
||||||
pub enum TokenType {
|
pub enum TokenType {
|
||||||
@ -107,6 +108,7 @@ fn is_operator(c: &char) -> bool {
|
|||||||
|
|
||||||
type CharIter<I: Iterator<Item=(usize,usize,char)>> = Peekable<I>;
|
type CharIter<I: Iterator<Item=(usize,usize,char)>> = Peekable<I>;
|
||||||
|
|
||||||
|
#[schala_codegen::compiler_pass = "tokenization"]
|
||||||
pub fn tokenize(input: &str) -> Vec<Token> {
|
pub fn tokenize(input: &str) -> Vec<Token> {
|
||||||
let mut tokens: Vec<Token> = Vec::new();
|
let mut tokens: Vec<Token> = Vec::new();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user