Skip to content
Snippets Groups Projects
Commit 0595fc98 authored by Maks Rawski's avatar Maks Rawski
Browse files

prepare to publish to crates.io

- change the project name to lispi
- update README
- update Cargo.toml
parent 73bd03de
No related branches found
No related tags found
No related merge requests found
Pipeline #1049336749 passed
......@@ -155,7 +155,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128"
[[package]]
name = "lisp-interpreter"
name = "lispi"
version = "0.1.0"
dependencies = [
"env_logger",
......
[package]
name = "lisp-interpreter"
name = "lispi"
version = "0.1.0"
edition = "2021"
license = "MIT"
description = "Lisp I interpreter"
readme = "README.md"
repository = "https://gitlab.com/MaksRawski/lispi"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
keywords = ["lisp", "repl"]
categories = ["parser-implementations"]
[dependencies]
log = "0.4.20"
......
# LISP interpreter
# LISP I interpreter
![coverage](https://gitlab.com/MaksRawski/lisp-interpreter/badges/main/coverage.svg)
Implementation of lisp interpreter according to
[the original paper from 1960](https://www-formal.stanford.edu/jmc/recursive.pdf)
and partly
[the programmer's manual from 1985](https://www.lispmachine.net/books/LISP_1.5_Programmers_Manual.pdf).
Welcome to LISP I, the world's most beautiful programming language.
First discovered by Paul McCarthy in 1960 and described in the paper
["Recursive functions of symbolic expressions and their computation by machine"](https://www-formal.stanford.edu/jmc/recursive.pdf).
Two years later explained in further detail in the
[LISP I Programmer's Manual](https://bitsavers.org/pdf/mit/rle_lisp/LISP_I_Programmers_Manual_Mar60.pdf).
This project is an interpreter for the language and I'm on a quest to implement every function described in the manual
(there is 90 of them listed in the "Alphabetic Index to Functions" on the page 147 of the manual).
## Usage
The interpreter and parser are done but I haven't yet got them to work together.
So for now you can run `cargo test` to run all unit tests and see all those green ok's!
NOTE: this project is FAR from being finished. Right now only a basic REPL with elementary functions is available.
After installing from crates.io with `cargo install lispi`, you can get access to the REPL by just running `lispi`.
## LICENSE
Obviously MIT. Available in the `LICENSE` file.
......@@ -49,8 +49,8 @@ fn test_list_macro() {
/// Compose car and cdr functions and apply them to a list.
/// Example usage:
/// ```
/// use lisp_interpreter::list_macros::compose_car_cdr;
/// use lisp_interpreter::elementary_functions::cons;
/// use lispi::list_macros::compose_car_cdr;
/// use lispi::elementary_functions::cons;
///
/// let c = cons(cons(1,2), cons(3,4));
///
......
mod repl;
use lisp_interpreter::parser::parse;
use lispi::parser::parse;
use repl::MyHelper;
use rustyline::{error::ReadlineError, Editor};
......
......@@ -77,8 +77,8 @@ fn parse_as_other_symbol(s: &str) -> Option<Atom> {
}
fn parse_sexp(s: &str) -> Option<SExpression> {
let sraka: String = s.replace('(', " ( ").replace(')', " ) ");
let mut tokens = sraka.split_whitespace().into_iter().peekable();
let str: String = s.replace('(', " ( ").replace(')', " ) ");
let mut tokens = str.split_whitespace().into_iter().peekable();
parse_tokens_iter(&mut tokens)
}
......
use lisp_interpreter::parser::parse;
use lispi::parser::parse;
#[test]
fn test_parse_eval_ff() {
......@@ -20,7 +20,7 @@ fn test_parse_eval_car_cons() {
#[test]
fn test_parse_eval_cond() {
use lisp_interpreter::types::Atom;
use lispi::types::Atom;
let text = "(cond ((atom 1) \"OK\") (T \"ERROR\"))";
let prog = parse(text).unwrap();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment