Skip to content

Commit

Permalink
Merge branch 'master' into support-db-only-file-uris
Browse files Browse the repository at this point in the history
  • Loading branch information
V-FEXrt authored Aug 30, 2024
2 parents 2f0e47d + 462ae15 commit b33e547
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/wake-format/basic/basic.wake
Original file line number Diff line number Diff line change
Expand Up @@ -1498,3 +1498,4 @@ def a = a |> b |> c
def a = a |< b |< c
def a = a |> b |< c
def a = a |< b |> c
def a = a | b |> c | c |< d
7 changes: 7 additions & 0 deletions tests/wake-format/basic/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -1802,3 +1802,10 @@ def a =
a
|< b
|> c

def a =
a
| b
|> c
| c
|< d
6 changes: 4 additions & 2 deletions tools/wake-format/emitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1389,8 +1389,10 @@ wcl::doc Emitter::walk_binary(ctx_t ctx, CSTElement node) {
std::vector<CSTElement> parts = {};
if (is_op_left_assoc(op_token)) {
if (is_binop_matching_str(op_token, TOKEN_OP_OR, "|>") ||
is_binop_matching_str(op_token, TOKEN_OP_OR, "|<")) {
parts = collect_left_binary({{TOKEN_OP_OR, "|>"}, {TOKEN_OP_OR, "|<"}}, node);
is_binop_matching_str(op_token, TOKEN_OP_OR, "|<") ||
is_binop_matching_str(op_token, TOKEN_OP_OR, "|")) {
parts =
collect_left_binary({{TOKEN_OP_OR, "|>"}, {TOKEN_OP_OR, "|<"}, {TOKEN_OP_OR, "|"}}, node);
} else {
parts = collect_left_binary({{op_token.id(), op_token.fragment().segment().str()}}, node);
}
Expand Down

0 comments on commit b33e547

Please sign in to comment.