From 9545130fd33b739a4c1ed1f3a8068a1c7f003130 Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 1 Nov 2017 22:41:34 -0700 Subject: [PATCH] Take TokenError type out of schala-lib --- schala-lib/src/language.rs | 11 ----------- src/maaru_lang/mod.rs | 11 +++++++++++ src/maaru_lang/tokenizer.rs | 2 +- src/robo_lang/mod.rs | 13 ++++++++++++- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/schala-lib/src/language.rs b/schala-lib/src/language.rs index 1cc6ec6..3123721 100644 --- a/schala-lib/src/language.rs +++ b/schala-lib/src/language.rs @@ -2,17 +2,6 @@ extern crate colored; use self::colored::*; -#[derive(Debug)] -pub struct TokenError { - pub msg: String, -} - -impl TokenError { - pub fn new(msg: &str) -> TokenError { - TokenError { msg: msg.to_string() } - } -} - pub struct LLVMCodeString(pub String); #[derive(Debug, Default, Serialize, Deserialize)] diff --git a/src/maaru_lang/mod.rs b/src/maaru_lang/mod.rs index 65be02f..6ecc3d9 100644 --- a/src/maaru_lang/mod.rs +++ b/src/maaru_lang/mod.rs @@ -5,6 +5,17 @@ pub mod compilation; use schala_lib::language::{ProgrammingLanguageInterface, EvalOptions, ReplOutput, TraceArtifact, LLVMCodeString}; +#[derive(Debug)] +pub struct TokenError { + pub msg: String, +} + +impl TokenError { + pub fn new(msg: &str) -> TokenError { + TokenError { msg: msg.to_string() } + } +} + pub use self::eval::Evaluator as MaaruEvaluator; pub struct Maaru<'a> { diff --git a/src/maaru_lang/tokenizer.rs b/src/maaru_lang/tokenizer.rs index 7c11fd4..1031add 100644 --- a/src/maaru_lang/tokenizer.rs +++ b/src/maaru_lang/tokenizer.rs @@ -5,7 +5,7 @@ use std::str::Chars; use self::itertools::Itertools; use std::rc::Rc; -use schala_lib::language::TokenError; +use maaru_lang::TokenError; #[derive(Debug, Clone, PartialEq)] pub enum Token { diff --git a/src/robo_lang/mod.rs b/src/robo_lang/mod.rs index 969e714..931bcf9 100644 --- a/src/robo_lang/mod.rs +++ b/src/robo_lang/mod.rs @@ -1,6 +1,6 @@ use itertools::Itertools; -use schala_lib::language::{ProgrammingLanguageInterface, EvalOptions, ReplOutput, TokenError}; +use schala_lib::language::{ProgrammingLanguageInterface, EvalOptions, ReplOutput}; pub struct Robo { } @@ -11,6 +11,17 @@ impl Robo { } } +#[derive(Debug)] +pub struct TokenError { + pub msg: String, +} + +impl TokenError { + pub fn new(msg: &str) -> TokenError { + TokenError { msg: msg.to_string() } + } +} + #[allow(dead_code)] #[derive(Debug)] pub enum Token {