Enforce newline after assignment / clause.
This leads to more consistent formatting across entire Aiken programs. Before that commit, only long expressions would be formatted on a newline, causing non-consistent formatting and additional reading barrier when looking at source code. Programs also now take more vertical space, which is better for more friendly diffing in version control systems (especially git).
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
// Could possibly be forbidden by the parser instead if we have no intent to support that.
|
||||
pub fn choice(self: List<Option<a>>) -> Option<a> {
|
||||
when self is {
|
||||
[] -> None
|
||||
[Some(_) as result, ..] -> result
|
||||
[None, ..others] -> choice(others)
|
||||
[] ->
|
||||
None
|
||||
[Some(_) as result, ..] ->
|
||||
result
|
||||
[None, ..others] ->
|
||||
choice(others)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
pub fn choice(self: List<Option<a>>) -> Option<a> {
|
||||
when self is {
|
||||
[] -> None
|
||||
[Some(x), ..] -> Some(x)
|
||||
[None, ..others] -> choice(others)
|
||||
[] ->
|
||||
None
|
||||
[Some(x), ..] ->
|
||||
Some(x)
|
||||
[None, ..others] ->
|
||||
choice(others)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
pub fn choice(self: List<Option<a>>) -> Option<a> {
|
||||
when self is {
|
||||
[] -> None
|
||||
[None, ..others] -> choice(others)
|
||||
[result, ..] -> result
|
||||
[] ->
|
||||
None
|
||||
[None, ..others] ->
|
||||
choice(others)
|
||||
[result, ..] ->
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user