rename relish to flesh
This commit is contained in:
parent
415b1181fa
commit
9b447eb5b7
58 changed files with 252 additions and 245 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/* relish: versatile lisp shell
|
||||
* Copyright (C) 2021 Aidan Hahn
|
||||
/* Flesh: Flexible Shell
|
||||
* Copyright (C) 2021 Ava Affine
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
use {
|
||||
relish::{
|
||||
flesh::{
|
||||
ast::{
|
||||
eval, lex, run,
|
||||
Ctr, Seg, SymTable, Symbol,
|
||||
|
|
@ -51,7 +51,7 @@ use {
|
|||
};
|
||||
|
||||
#[cfg(feature="posix")]
|
||||
use relish::aux::{ShellState, check_jobs};
|
||||
use flesh::aux::{ShellState, check_jobs};
|
||||
#[cfg(feature="posix")]
|
||||
use nix::unistd;
|
||||
|
||||
|
|
@ -279,14 +279,14 @@ fn add_menu_keybindings(keybindings: &mut Keybindings) {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
const HIST_FILE: &str = "/.relish_hist";
|
||||
const CONFIG_FILE_DEFAULT: &str = "/.relishrc";
|
||||
const HIST_FILE: &str = "/.flesh_hist";
|
||||
const CONFIG_FILE_DEFAULT: &str = "/.fleshrc";
|
||||
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
if env::args().count() > 1 &&
|
||||
env::args()
|
||||
.collect::<Vec<_>>()
|
||||
.contains(&"--version".to_string()) {
|
||||
println!("Relish {}", VERSION);
|
||||
println!("Flesh {}", VERSION);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -501,7 +501,7 @@ fn get_token_to_complete(line: &str, pos: usize) -> (String, bool, usize) {
|
|||
* closure as a signal handler. As of May 2023 there is no clear
|
||||
* way of doing such a thing.
|
||||
*
|
||||
* Luckily this data is only used within Relish, so we can simply
|
||||
* Luckily this data is only used within Flesh, so we can simply
|
||||
* rely on it only being read during the evaluation phase of the REPL.
|
||||
* This method will at least work for that. (ava)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* relish: versatile lisp shell
|
||||
* Copyright (C) 2021 Aidan Hahn
|
||||
/* Flesh: Flexible Shell
|
||||
* Copyright (C) 2021 Ava Affine
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* relish: versatile lisp shell
|
||||
* Copyright (C) 2021 Aidan Hahn
|
||||
/* Flesh: Flexible Shell
|
||||
* Copyright (C) 2021 Ava Affine
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* relish: highly versatile lisp interpreter
|
||||
* Copyright (C) 2021 Aidan Hahn
|
||||
/* Flesh: Flexible Shell
|
||||
* Copyright (C) 2021 Ava Affine
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* relish: highly versatile lisp interpreter
|
||||
* Copyright (C) 2021 Aidan Hahn
|
||||
/* Flesh: Flexible Shell
|
||||
* Copyright (C) 2021 Ava Affine
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -45,8 +45,8 @@ pub mod stdlib {
|
|||
R_PROMPT_VNAME,
|
||||
PROMPT_DELIM_VNAME,
|
||||
CFG_FILE_VNAME,
|
||||
RELISH_DEFAULT_CONS_HEIGHT,
|
||||
RELISH_DEFAULT_CONS_WIDTH,
|
||||
FLESH_DEFAULT_CONS_HEIGHT,
|
||||
FLESH_DEFAULT_CONS_WIDTH,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* relish: versatile lisp shell
|
||||
* Copyright (C) 2021 Aidan Hahn
|
||||
/* Flesh: Flexible Shell
|
||||
* Copyright (C) 2021 Ava Affine
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -67,7 +67,7 @@ Attempts to find argument in PATH and attempts to call argument";
|
|||
|
||||
pub fn run_callback(ast: &Seg, syms: &mut SymTable) -> Result<Ctr, Traceback> {
|
||||
if let Ctr::String(ref filename) = *ast.car {
|
||||
if filename.ends_with(".rls") {
|
||||
if filename.ends_with(".f") {
|
||||
if let Some(filepath) = find_on_path(filename.to_string()) {
|
||||
run(filepath, syms)
|
||||
.and(Ok(Ctr::None))
|
||||
|
|
@ -91,7 +91,7 @@ pub fn run_callback(ast: &Seg, syms: &mut SymTable) -> Result<Ctr, Traceback> {
|
|||
}
|
||||
} else {
|
||||
Err(start_trace(
|
||||
("<call script>", "expected a relish script with a .rls extension")
|
||||
("<call script>", "expected a flesh script with a .f extension")
|
||||
.into()))
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* relish: versatile lisp shell
|
||||
* Copyright (C) 2021 Aidan Hahn
|
||||
/* Flesh: Flexible Shell
|
||||
* Copyright (C) 2021 Ava Affine
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
30
src/stl.rs
30
src/stl.rs
|
|
@ -1,5 +1,5 @@
|
|||
/* relish: versatile lisp shell
|
||||
* Copyright (C) 2021 Aidan Hahn
|
||||
/* Flesh: Flexible Shell
|
||||
* Copyright (C) 2021 Ava Affine
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -34,16 +34,16 @@ pub mod math;
|
|||
pub mod strings;
|
||||
pub mod file;
|
||||
|
||||
pub const CONSOLE_XDIM_VNAME: &str = "_RELISH_WIDTH";
|
||||
pub const CONSOLE_YDIM_VNAME: &str = "_RELISH_HEIGHT";
|
||||
pub const POSIX_CFG_VNAME: &str = "CFG_RELISH_POSIX";
|
||||
pub const MODENV_CFG_VNAME: &str = "CFG_RELISH_ENV";
|
||||
pub const L_PROMPT_VNAME: &str = "CFG_RELISH_L_PROMPT";
|
||||
pub const R_PROMPT_VNAME: &str = "CFG_RELISH_R_PROMPT";
|
||||
pub const PROMPT_DELIM_VNAME: &str = "CFG_RELISH_PROMPT_DELIMITER";
|
||||
pub const CFG_FILE_VNAME: &str = "RELISH_CFG_FILE";
|
||||
pub const RELISH_DEFAULT_CONS_HEIGHT: i16 = 24;
|
||||
pub const RELISH_DEFAULT_CONS_WIDTH: i16 = 80;
|
||||
pub const CONSOLE_XDIM_VNAME: &str = "_FLESH_WIDTH";
|
||||
pub const CONSOLE_YDIM_VNAME: &str = "_FLESH_HEIGHT";
|
||||
pub const POSIX_CFG_VNAME: &str = "CFG_FLESH_POSIX";
|
||||
pub const MODENV_CFG_VNAME: &str = "CFG_FLESH_ENV";
|
||||
pub const L_PROMPT_VNAME: &str = "CFG_FLESH_L_PROMPT";
|
||||
pub const R_PROMPT_VNAME: &str = "CFG_FLESH_R_PROMPT";
|
||||
pub const PROMPT_DELIM_VNAME: &str = "CFG_FLESH_PROMPT_DELIMITER";
|
||||
pub const CFG_FILE_VNAME: &str = "FLESH_CFG_FILE";
|
||||
pub const FLESH_DEFAULT_CONS_HEIGHT: i16 = 24;
|
||||
pub const FLESH_DEFAULT_CONS_WIDTH: i16 = 80;
|
||||
|
||||
fn l_prompt_default_callback(_: &Seg, _: &mut SymTable) -> Result<Ctr, Traceback> {
|
||||
Ok(Ctr::String(">".to_string()))
|
||||
|
|
@ -87,7 +87,7 @@ pub fn static_stdlib(syms: &mut SymTable) {
|
|||
/// callbacks with configuration into a symtable
|
||||
#[cfg(feature="posix")]
|
||||
pub fn dynamic_stdlib(syms: &mut SymTable, shell: Option<Rc<RefCell<posix::ShellState>>>) {
|
||||
// get CFG_RELISH_ENV from syms
|
||||
// get CFG_FLESH_ENV from syms
|
||||
let env_cfg_user_form = syms
|
||||
.call_symbol(&MODENV_CFG_VNAME.to_string(), &Seg::new(), true)
|
||||
.unwrap_or_else(|_: Traceback| Box::new(Ctr::None))
|
||||
|
|
@ -207,7 +207,7 @@ default value: 1 (set)
|
|||
&String::from(CONSOLE_XDIM_VNAME),
|
||||
&String::from("Length of current console"),
|
||||
&Seg::from_mono(Box::new(
|
||||
Ctr::Integer(RELISH_DEFAULT_CONS_WIDTH.into())
|
||||
Ctr::Integer(FLESH_DEFAULT_CONS_WIDTH.into())
|
||||
)),
|
||||
None,
|
||||
)
|
||||
|
|
@ -219,7 +219,7 @@ default value: 1 (set)
|
|||
&String::from(CONSOLE_YDIM_VNAME),
|
||||
&String::from("Height of current console"),
|
||||
&Seg::from_mono(Box::new(
|
||||
Ctr::Integer(RELISH_DEFAULT_CONS_HEIGHT.into())
|
||||
Ctr::Integer(FLESH_DEFAULT_CONS_HEIGHT.into())
|
||||
)),
|
||||
None,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (C) 2021 Aidan Hahn
|
||||
/* Flesh: Flexible Shell
|
||||
* Copyright (C) 2021 Ava Affine
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (C) 2021 Aidan Hahn
|
||||
/* Flesh: Flexible Shell
|
||||
* Copyright (C) 2021 Ava Affine
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* relish: versatile lisp shell
|
||||
* Copyright (C) 2021 Aidan Hahn
|
||||
/* Flesh: Flexible Shell
|
||||
* Copyright (C) 2021 Ava Affine
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* relish: versatile lisp shell
|
||||
* Copyright (C) 2021 Aidan Hahn
|
||||
/* Flesh: Flexible Shell
|
||||
* Copyright (C) 2021 Ava Hahn
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
use crate::eval::eval;
|
||||
use crate::error::{Traceback, start_trace};
|
||||
use crate::segment::{Ctr, Seg, Type};
|
||||
use crate::stdlib::{CONSOLE_XDIM_VNAME, RELISH_DEFAULT_CONS_WIDTH};
|
||||
use crate::stdlib::{CONSOLE_XDIM_VNAME, FLESH_DEFAULT_CONS_WIDTH};
|
||||
use crate::sym::{SymTable, Symbol, UserFn, ValueType, Args};
|
||||
use std::env;
|
||||
use std::rc::Rc;
|
||||
|
|
@ -140,8 +140,8 @@ fn env_callback(_ast: &Seg, syms: &mut SymTable) -> Result<Ctr, Traceback> {
|
|||
xdim = dim;
|
||||
} else {
|
||||
println!("{} contains non integer value, defaulting to {}",
|
||||
CONSOLE_XDIM_VNAME, RELISH_DEFAULT_CONS_WIDTH);
|
||||
xdim = RELISH_DEFAULT_CONS_WIDTH as i128;
|
||||
CONSOLE_XDIM_VNAME, FLESH_DEFAULT_CONS_WIDTH);
|
||||
xdim = FLESH_DEFAULT_CONS_WIDTH as i128;
|
||||
}
|
||||
|
||||
let mut v_col_len = 0;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* relish: versatile lisp shell
|
||||
* Copyright (C) 2021 Aidan Hahn
|
||||
/* Flesh: Flexible Shell
|
||||
* Copyright (C) 2021 Ava Hahn
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (C) 2021 Aidan Hahn
|
||||
/* Flesh: Flexible Shell
|
||||
* Copyright (C) 2021 Ava Affine
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* relish: versatile lisp shell
|
||||
* Copyright (C) 2021 Aidan Hahn
|
||||
/* Flesh: Flexible Shell
|
||||
* Copyright (C) 2021 Ava Affine
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* relish: versatile lisp shell
|
||||
* Copyright (C) 2021 Aidan Hahn
|
||||
/* Flesh: Flexible Shell
|
||||
* Copyright (C) 2021 Ava Affine
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue