Skip to content

Commit 172abae

Browse files
committed
init
0 parents  commit 172abae

File tree

5 files changed

+49
-0
lines changed

5 files changed

+49
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target
2+
/Cargo.lock

Cargo.toml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[package]
2+
name = "openfga-dsl-parser"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
[workspace]
8+
members = [
9+
"crates/ast"
10+
]
11+
12+
[dependencies]

crates/ast/Cargo.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "ast"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]

crates/ast/src/lib.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
pub struct Document {
2+
pub types: Vec<Type>,
3+
}
4+
5+
pub struct Type {
6+
pub name: String,
7+
pub relations: Vec<Relation>,
8+
}
9+
10+
pub struct Relation {
11+
pub name: String,
12+
pub alias: Vec<Alias>,
13+
pub from: String, // this seems to be an enum, need to read up.
14+
}
15+
16+
pub enum Alias {
17+
This,
18+
Named(String),
19+
}

src/lib.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#[cfg(test)]
2+
mod tests {
3+
#[test]
4+
fn it_works() {
5+
let result = 2 + 2;
6+
assert_eq!(result, 4);
7+
}
8+
}

0 commit comments

Comments
 (0)