Init
This commit is contained in:
commit
2852ee9c1f
6 changed files with 44 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/target
|
7
Cargo.lock
generated
Normal file
7
Cargo.lock
generated
Normal 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
6
Cargo.toml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[package]
|
||||||
|
name = "lisp_stuff"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[dependencies]
|
21
src/lib.rs
Normal file
21
src/lib.rs
Normal 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
3
src/main.rs
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
fn main() {
|
||||||
|
println!("Hello, world!");
|
||||||
|
}
|
6
src/test.lisp
Normal file
6
src/test.lisp
Normal 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
|
Reference in a new issue