Light fixes (#2455)

* Add optional commas for items in lists and tables

* A couple last fixes
This commit is contained in:
Jonathan Turner
2020-08-30 19:03:18 +12:00
committed by GitHub
parent abc05ece21
commit df691c6c91
3 changed files with 44 additions and 2 deletions

View File

@ -610,6 +610,22 @@ impl SpannedExpression {
}
false
}
Expression::Table(headers, cells) => {
for l in headers {
if l.has_shallow_it_usage() {
return true;
}
}
for row in cells {
for cell in row {
if cell.has_shallow_it_usage() {
return true;
}
}
}
false
}
Expression::Invocation(block) => {
for commands in block.block.iter() {
for command in commands.list.iter() {
@ -646,6 +662,20 @@ impl SpannedExpression {
item.expand_it_usage();
}
}
SpannedExpression {
expr: Expression::Table(headers, cells),
..
} => {
for header in headers.iter_mut() {
header.expand_it_usage();
}
for row in cells.iter_mut() {
for cell in row {
cell.expand_it_usage()
}
}
}
SpannedExpression {
expr: Expression::Path(path),
..