Skip to content

Commit

Permalink
Fix support for list patterns, #46
Browse files Browse the repository at this point in the history
  • Loading branch information
Scony committed Dec 4, 2023
1 parent 2fd2a76 commit 40dbec1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gdtoolkit/formatter/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _format_foldable_to_multiple_lines(
"actual_getattr_call": _format_call_expression_to_multiple_lines,
"actual_subscr_expr": _format_subscription_to_multiple_lines,
# patterns (fake expressions):
"list_pattern": _format_args_to_multiple_lines,
"list_pattern": _format_concrete_expression_to_single_line,
"test_pattern": _format_operator_chain_based_expression_to_multiple_lines,
"par_pattern": _format_parentheses_to_multiple_lines,
"or_pattern": _format_operator_chain_based_expression_to_multiple_lines,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
class X:
func foo(x):
match x:
# TODO:
# 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1:
# pass
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1:
pass
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" if true else "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb":
pass
true or false or true or false or true or false or true or false or true or false or true or false or true or false or true:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
class X:
func foo(x):
match x:
# TODO:
# 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1:
# pass
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1:
pass
(
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
if true
Expand Down

0 comments on commit 40dbec1

Please sign in to comment.