mirror of
https://github.com/lune-org/lune.git
synced 2025-05-04 10:43:57 +01:00
fix: remove orphan testing code
This commit is contained in:
parent
1051d55cdc
commit
bef0df6d91
1 changed files with 2 additions and 14 deletions
|
@ -1,5 +1,4 @@
|
||||||
use std::{
|
use std::{
|
||||||
fmt::Write,
|
|
||||||
io::ErrorKind,
|
io::ErrorKind,
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
process::{exit, ExitCode},
|
process::{exit, ExitCode},
|
||||||
|
@ -9,15 +8,10 @@ use anyhow::Result;
|
||||||
use clap::Command;
|
use clap::Command;
|
||||||
use directories::UserDirs;
|
use directories::UserDirs;
|
||||||
use lune::lua::stdio::formatting::pretty_format_luau_error;
|
use lune::lua::stdio::formatting::pretty_format_luau_error;
|
||||||
use lune::{Lune, LuneError};
|
use lune::Lune;
|
||||||
use mlua::ExternalError;
|
use mlua::ExternalError;
|
||||||
use rustyline::{error::ReadlineError, history::FileHistory, DefaultEditor, Editor};
|
use rustyline::{error::ReadlineError, history::FileHistory, DefaultEditor, Editor};
|
||||||
|
|
||||||
enum PromptState {
|
|
||||||
Regular,
|
|
||||||
Continuation,
|
|
||||||
}
|
|
||||||
|
|
||||||
// Isn't dependency injection plain awesome?!
|
// Isn't dependency injection plain awesome?!
|
||||||
pub async fn show_interface(cmd: Command) -> Result<ExitCode> {
|
pub async fn show_interface(cmd: Command) -> Result<ExitCode> {
|
||||||
let lune_version = cmd.get_version();
|
let lune_version = cmd.get_version();
|
||||||
|
@ -63,18 +57,12 @@ pub async fn show_interface(cmd: Command) -> Result<ExitCode> {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut prompt_kind: PromptState = PromptState::Regular;
|
|
||||||
let mut interrupt_counter = 0u32;
|
let mut interrupt_counter = 0u32;
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let mut source_code = String::new();
|
let mut source_code = String::new();
|
||||||
|
|
||||||
let prompt = match prompt_kind {
|
match repl.readline("> ") {
|
||||||
PromptState::Regular => "> ",
|
|
||||||
PromptState::Continuation => ">> ",
|
|
||||||
};
|
|
||||||
|
|
||||||
match repl.readline(prompt) {
|
|
||||||
Ok(code) => {
|
Ok(code) => {
|
||||||
source_code = code.clone();
|
source_code = code.clone();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue