cl-repl: Rename from cl-frontend.

Also disable escape code printing when debug assertions are off
This commit is contained in:
John 2024-02-28 05:32:10 -06:00
parent 048e41836a
commit 862d81a9d4
7 changed files with 10 additions and 6 deletions

View File

@ -1,5 +1,5 @@
[workspace]
members = ["libconlang", "cl-frontend"]
members = ["libconlang", "cl-repl"]
resolver = "2"
[workspace.package]

View File

@ -1,5 +1,5 @@
[package]
name = "cl-frontend"
name = "cl-repl"
repository.workspace = true
version.workspace = true
authors.workspace = true

View File

@ -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,

View File

@ -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<dyn Error>> {

View File

@ -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(())