diff options
Diffstat (limited to 'v_windows/v/vlib/v/fmt/tests/infix_expr_input.vv')
-rw-r--r-- | v_windows/v/vlib/v/fmt/tests/infix_expr_input.vv | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/v_windows/v/vlib/v/fmt/tests/infix_expr_input.vv b/v_windows/v/vlib/v/fmt/tests/infix_expr_input.vv new file mode 100644 index 0000000..7bfec62 --- /dev/null +++ b/v_windows/v/vlib/v/fmt/tests/infix_expr_input.vv @@ -0,0 +1,24 @@ +fn grouped_cond_single_line() { + // fmt tries to keep grouped conditions together... + _ := one_condition_before && another_condition && (inside_paren || is_kept_together || if_possible) && end_cond +} + +fn unwrap_grouped_conds() { + // ...but sometimes they have to be splitted + _ := one_condition && before_condition && (conds_inside_paren || are_kept_together || if_possible || but_this_is_really_too_much || for_one_line) + _ := (also_inside_parens || just_as_above || but_this_is_also_more || than_a_single_line_could_fit) && end_cond + fields = fields.filter((it.typ in [string_type, int_type, bool_type] || c.table.types[int(it.typ)].kind == .struct_) && !it.attrs.contains('skip')) +} + +fn main() { + clean_struct_v_type_name = clean_struct_v_type_name.replace('_Array', '_array').replace('_T_', '<').replace('_', ', ') + '>' + { + { + { + // Indent this much to force a break after the assign (`:=`). + // Check that the trailing space is removed + should_cast := (g.table.type_kind(stmt.left_types.first()) in js.shallow_equatables) && (g.cast_stack.len <= 0 || stmt.left_types.first() != g.cast_stack.last()) + } + } + } +} |