Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix extra spaces in if-expr with bool negation (#24)
Currently, verusfmt adds a space for each 'condition' node. However, the grammar is set up so that this has _two_ negation nodes: ``` if !b { } ``` so it ends up formatted as: ``` if !b { } ``` See the expansion has two 'condition' nodes: ``` if_expr { if_str {} condition { bang_str {} condition { expr_no_struct { path_expr_no_generics { path_no_generics { path_segment_no_generics { name_ref { identifier {} } } } } } } } ``` The PR changes the handling of the space to be with an 'if' expression or 'while' expression, rather than having it handled with the 'condition' node. Co-authored-by: Travis Hance <[email protected]>
- Loading branch information