mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-06-22 18:51:22 +02:00
Renamed to 'kalk'.
This commit is contained in:
parent
bccbbee2c4
commit
cbc0b340a1
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
|||||||
*/target
|
*/target
|
||||||
lek/Cargo.lock
|
kalk/Cargo.lock
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "lek"
|
name = "kalk"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["paddi"]
|
authors = ["paddi"]
|
||||||
edition = "2018"
|
edition = "2018"
|
6
lek_cli/Cargo.lock → kalk_cli/Cargo.lock
generated
6
lek_cli/Cargo.lock → kalk_cli/Cargo.lock
generated
@ -135,7 +135,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lek"
|
name = "kalk"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"phf",
|
"phf",
|
||||||
@ -143,11 +143,11 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lek_cli"
|
name = "kalk_cli"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ansi_term",
|
"ansi_term",
|
||||||
"lek",
|
"kalk",
|
||||||
"rustyline",
|
"rustyline",
|
||||||
]
|
]
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "lek_cli"
|
name = "kalk_cli"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["PaddiM8 <paddim8@pm.me>"]
|
authors = ["PaddiM8 <paddim8@pm.me>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
@ -8,6 +8,6 @@ edition = "2018"
|
|||||||
panic = "abort"
|
panic = "abort"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lek = { path = "../lek" }
|
kalk = { path = "../kalk" }
|
||||||
rustyline = "6.1.2"
|
rustyline = "6.1.2"
|
||||||
ansi_term = "0.12"
|
ansi_term = "0.12"
|
@ -1,8 +1,8 @@
|
|||||||
mod output;
|
mod output;
|
||||||
mod repl;
|
mod repl;
|
||||||
|
|
||||||
use lek::parser::Unit;
|
use kalk::parser::Unit;
|
||||||
use lek::parser::{self};
|
use kalk::parser::{self};
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
@ -1,5 +1,5 @@
|
|||||||
use ansi_term::Colour::Red;
|
use ansi_term::Colour::Red;
|
||||||
use lek::parser::{self};
|
use kalk::parser::{self};
|
||||||
|
|
||||||
pub fn eval(parser: &mut parser::Context, input: &str) {
|
pub fn eval(parser: &mut parser::Context, input: &str) {
|
||||||
match parser::parse(parser, input, 53) {
|
match parser::parse(parser, input, 53) {
|
@ -1,19 +1,19 @@
|
|||||||
use crate::output;
|
use crate::output;
|
||||||
use ansi_term::Colour::Cyan;
|
use ansi_term::Colour::Cyan;
|
||||||
use lek::parser;
|
use kalk::parser;
|
||||||
use rustyline::error::ReadlineError;
|
use rustyline::error::ReadlineError;
|
||||||
use rustyline::Editor;
|
use rustyline::Editor;
|
||||||
use std::process;
|
use std::process;
|
||||||
|
|
||||||
pub fn start(mut parser: &mut parser::Context) {
|
pub fn start(mut parser: &mut parser::Context) {
|
||||||
let mut rl = Editor::<()>::new();
|
let mut editor = Editor::<()>::new();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let readline = rl.readline(&Cyan.paint(">> ").to_string());
|
let readline = editor.readline(&Cyan.paint(">> ").to_string());
|
||||||
|
|
||||||
match readline {
|
match readline {
|
||||||
Ok(input) => {
|
Ok(input) => {
|
||||||
rl.add_history_entry(input.as_str());
|
editor.add_history_entry(input.as_str());
|
||||||
eval_repl(&mut parser, &input);
|
eval_repl(&mut parser, &input);
|
||||||
}
|
}
|
||||||
Err(ReadlineError::Interrupted) => break,
|
Err(ReadlineError::Interrupted) => break,
|
Loading…
x
Reference in New Issue
Block a user