This commit is contained in:
Apache 2024-06-06 23:32:35 -05:00
commit 2852ee9c1f
Signed by: apache
GPG key ID: 6B10F3EAF14F4C77
6 changed files with 44 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/target

7
Cargo.lock generated Normal file
View file

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "lisp_stuff"
version = "0.1.0"

6
Cargo.toml Normal file
View file

@ -0,0 +1,6 @@
[package]
name = "lisp_stuff"
version = "0.1.0"
edition = "2021"
[dependencies]

21
src/lib.rs Normal file
View file

@ -0,0 +1,21 @@
pub enum Token {
OpenParen,
CloseParen,
Identifier(String),
String(String),
Integer(i32)
}
pub trait Tokenizable {
fn tokenize(&self) -> Vec<Token>;
}
impl Tokenizable for String {
fn tokenize(&self) -> Vec<Token> {
let tokens = Vec::new();
tokens
}
}

3
src/main.rs Normal file
View file

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

6
src/test.lisp Normal file
View file

@ -0,0 +1,6 @@
; This is a comment
(print "Hello, World")
(print (add 1 2))
; OpenParen, Identifier, String, CloseParen
; OpenParen, Identifier, OpenParen, Identifier, Int, Int, CloseParen, CloseParen