Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
zerodegress committed Apr 4, 2023
1 parent 98f3d68 commit 546330f
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk


# Added by cargo

/target
10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[workspace]
members = [
"core"
]

[workspace.dependencies]
hashbrown = { version = "0.13.2", features = ["default", "serde"] }
serde = { version = "1.0.159" }
tokio = { version = "1.27.0", features = ["fs", "macros"] }
regex = { version = "1.7.3" }
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# RWScript
# rwscript

A script language for Rusted Warfare modding.

WIP.
6 changes: 6 additions & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "rwscript_core"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1 change: 1 addition & 0 deletions core/src/lexer/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// TODO:实现分词器
19 changes: 19 additions & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// TODO:rwscript的核心功能

pub mod parser;
pub mod lexer;

pub fn add(left: usize, right: usize) -> usize {
left + right
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}
1 change: 1 addition & 0 deletions core/src/parser/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//TODO:实现解析器

0 comments on commit 546330f

Please sign in to comment.