File tree 5 files changed +49
-0
lines changed
5 files changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ /target
2
+ /Cargo.lock
Original file line number Diff line number Diff line change
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 ]
Original file line number Diff line number Diff line change
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 ]
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
1
+ #[ cfg( test) ]
2
+ mod tests {
3
+ #[ test]
4
+ fn it_works ( ) {
5
+ let result = 2 + 2 ;
6
+ assert_eq ! ( result, 4 ) ;
7
+ }
8
+ }
You can’t perform that action at this time.
0 commit comments