start ast
This commit is contained in:
parent
83774a7ed5
commit
bd082b186b
2 changed files with 40 additions and 11 deletions
19
Cargo.lock
generated
Normal file
19
Cargo.lock
generated
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 4
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cogs_ast"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cogs_axum"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cogs_codegen"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cogs_parser"
|
||||||
|
version = "0.1.0"
|
|
@ -1,14 +1,24 @@
|
||||||
pub fn add(left: u64, right: u64) -> u64 {
|
pub struct Component {
|
||||||
left + right
|
pub elements: Vec<Element>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
pub enum Element {
|
||||||
mod tests {
|
Html(HtmlTag),
|
||||||
use super::*;
|
Block(CodeBlock),
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
pub struct HtmlTag {
|
||||||
fn it_works() {
|
pub tag: String,
|
||||||
let result = add(2, 2);
|
pub attributes: Vec<Attribute>,
|
||||||
assert_eq!(result, 4);
|
pub content: Vec<Element>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct Attribute {
|
||||||
|
pub name: String,
|
||||||
|
pub value: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct CodeBlock {
|
||||||
|
pub is_async: bool,
|
||||||
|
pub content: String,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue