diff --git a/Cargo.toml b/Cargo.toml index 2e6a538..6dc37cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = ["libconlang", "cl-frontend"] +members = ["libconlang", "cl-repl"] resolver = "2" [workspace.package] diff --git a/cl-frontend/Cargo.toml b/cl-repl/Cargo.toml similarity index 94% rename from cl-frontend/Cargo.toml rename to cl-repl/Cargo.toml index bac1e19..6358b94 100644 --- a/cl-frontend/Cargo.toml +++ b/cl-repl/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "cl-frontend" +name = "cl-repl" repository.workspace = true version.workspace = true authors.workspace = true diff --git a/cl-frontend/examples/collect-identifiers.rs b/cl-repl/examples/collect-identifiers.rs similarity index 99% rename from cl-frontend/examples/collect-identifiers.rs rename to cl-repl/examples/collect-identifiers.rs index 55dc8af..a6158ca 100644 --- a/cl-frontend/examples/collect-identifiers.rs +++ b/cl-repl/examples/collect-identifiers.rs @@ -1,6 +1,6 @@ //! Collects identifiers into a list -use cl_frontend::repline::Repline; +use cl_repl::repline::Repline; use conlang::{common::Loc, lexer::Lexer, parser::Parser}; use std::{ collections::HashMap, diff --git a/cl-frontend/examples/identify_tokens.rs b/cl-repl/examples/identify_tokens.rs similarity index 100% rename from cl-frontend/examples/identify_tokens.rs rename to cl-repl/examples/identify_tokens.rs diff --git a/cl-frontend/src/lib.rs b/cl-repl/src/lib.rs similarity index 100% rename from cl-frontend/src/lib.rs rename to cl-repl/src/lib.rs diff --git a/cl-frontend/src/main.rs b/cl-repl/src/main.rs similarity index 75% rename from cl-frontend/src/main.rs rename to cl-repl/src/main.rs index ec50ac4..2dfb6cd 100644 --- a/cl-frontend/src/main.rs +++ b/cl-repl/src/main.rs @@ -1,4 +1,4 @@ -use cl_frontend::{args::Args, cli::CLI}; +use cl_repl::{args::Args, cli::CLI}; use std::error::Error; fn main() -> Result<(), Box> { diff --git a/cl-frontend/src/repline.rs b/cl-repl/src/repline.rs similarity index 98% rename from cl-frontend/src/repline.rs rename to cl-repl/src/repline.rs index 87130fd..18f05b4 100644 --- a/cl-frontend/src/repline.rs +++ b/cl-repl/src/repline.rs @@ -255,7 +255,9 @@ impl<'a, R: Read> Repline<'a, R> { } } c if c.is_ascii_control() => { - eprint!("\\x{:02x}", c as u32); + if cfg!(debug_assertions) { + eprint!("\\x{:02x}", c as u32); + } } c => { self.ed.push(c, stdout)?; @@ -296,7 +298,9 @@ impl<'a, R: Read> Repline<'a, R> { } } other => { - eprint!("{}", other.escape_unicode()); + if cfg!(debug_assertions) { + eprint!("{}", other.escape_unicode()); + } } } Ok(())