fix: formatting

This commit is contained in:
Artemy Egorov 2024-08-14 18:26:11 +03:00
parent 947c2e123b
commit 66abb7e149
3 changed files with 6 additions and 4 deletions

2
Cargo.lock generated
View file

@ -201,7 +201,7 @@ dependencies = [
[[package]]
name = "dalet"
version = "1.0.0-pre.17"
version = "1.0.0-pre.18"
dependencies = [
"ariadne",
"bincode",

View file

@ -1,6 +1,6 @@
[package]
name = "dalet"
version = "1.0.0-pre.17"
version = "1.0.0-pre.18"
edition = "2021"
authors = ["artegoser"]
license = "MIT"

View file

@ -150,12 +150,14 @@ pub fn format<'src>(spanned_tokens: &Vec<Spanned<Token<'src>>>) -> String {
format!("{}\n", prepend_indent("]]", current_indent))
}
Token::Paragraph(t) => format!(
"{{-\n{}\n{}\n",
"{}\n{}\n{}\n",
prepend_indent("{-", current_indent),
set_indent(t, current_indent + 1),
prepend_indent("}", current_indent)
),
Token::TableSyntax(rows) => format!(
"{{> table\n{}\n{}\n",
"{}\n{}\n{}\n",
prepend_indent("{{> table", current_indent),
set_indent(&table_to_string(rows), current_indent + 1),
prepend_indent("}", current_indent)
),