feat: simple support for comments

This commit is contained in:
Jonathan Kelley committed 2022-06-28 15:01:51 -04:00
1 parent d70b436157
commit a825cdcf58
7 files changed
+218 -51

No files matched your search

+37 -2
View File
@@ -97,7 +97,7 @@ fn print_cases() {
}
}
div { class: "alksdjasd", onclick: move |_| {
// hi!
liberty!();
},
div {
@@ -105,7 +105,7 @@ fn print_cases() {
}
}
commented{
commented {
// is unparalled
class: "asdasd",
@@ -113,6 +113,10 @@ fn print_cases() {
div {
"hi"
}
div {
}
}
}
}
@@ -120,6 +124,37 @@ fn print_cases() {
);
}
#[test]
fn format_comments() {
let block = r#"
div {
adsasd: "asd", block: "asd",
// this is a comment
"hello"
// this is a comment 1
// this is a comment 2
"hello"
div {
// this is a comment
"hello"
}
div {
// empty space
}
}
"#;
let formatted = fmt_block(block).unwrap();
println!("{formatted}");
}
#[test]
fn formats_component() {
let block = r#"