Skip to content

Commit

Permalink
test: add demo for struct decl
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Sep 30, 2022
1 parent bf954a7 commit 96ad39c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crates/fkl_parser/src/parser/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -990,5 +990,16 @@ struct Cinema {
}),
}],
}));

assert_eq!(result[1], FklDeclaration::Struct(StructDecl {
name: "Cinema".to_string(),
inline_doc: "".to_string(),
fields: vec![
VariableDefinition { name: "id".to_string(), type_type: "String".to_string(), initializer: None },
VariableDefinition { name: "name".to_string(), type_type: "String".to_string(), initializer: None },
VariableDefinition { name: "address".to_string(), type_type: "String".to_string(), initializer: None },
VariableDefinition { name: "rooms".to_string(), type_type: "Set<ScreeningRoom>".to_string(), initializer: None },
],
}));
}
}

0 comments on commit 96ad39c

Please sign in to comment.