add component support

This commit is contained in:
Evan Almloff committed 2022-05-27 09:47:44 -05:00
1 parent 07da854455
commit a0c7e4d78a
8 files changed
+62 -14

No files matched your search

+3
View File
@@ -22,6 +22,7 @@ use syn::{
token, Expr, Ident, LitStr, Result, Token,
};
#[derive(PartialEq, Eq)]
pub struct Component {
pub name: syn::Path,
pub body: Vec<ComponentField>,
@@ -149,11 +150,13 @@ impl ToTokens for Component {
}
// the struct's fields info
#[derive(PartialEq, Eq)]
pub struct ComponentField {
pub name: Ident,
pub content: ContentField,
}
#[derive(PartialEq, Eq)]
pub enum ContentField {
ManExpr(Expr),
Formatted(LitStr),