blob: 6ff53d86288023622fd1c3b487da8c8425e4b9be [file] [log] [blame]
40 columns |
### Pattern variable declaration statements.
>>> Prefer to split at "=" instead of pattern.
var (longIdentifier && anotherOne) = value;
<<<
var (longIdentifier && anotherOne) =
value;
>>> Split in infix pattern.
var (longIdentifier && anotherAlsoLongOne) = value;
<<<
var (longIdentifier &&
anotherAlsoLongOne) =
value;
>>> Split in list pattern.
var [first, second, third, fourth, fifth] = value;
<<<
var [
first,
second,
third,
fourth,
fifth,
] = value;
>>> Split in initializer but not block-splittable pattern.
var [first] = expression + anotherOperand + aThirdOperand;
<<<
var [first] =
expression +
anotherOperand +
aThirdOperand;
>>> Split in map pattern.
var {first: second, third: fourth, fifth: sixth} = value;
<<<
var {
first: second,
third: fourth,
fifth: sixth,
} = value;
>>> Split in record pattern.
var (first, second, third, fourth, fifth) = value;
<<<
var (
first,
second,
third,
fourth,
fifth,
) = value;
>>> Split in object pattern.
var Foo(:first, :second, :third, :fourth, :fifth) = value;
<<<
var Foo(
:first,
:second,
:third,
:fourth,
:fifth,
) = value;
>>> Split in value.
var (first, second, third) = longValueExpression + anotherOperand + aThirdOperand;
<<<
var (first, second, third) =
longValueExpression +
anotherOperand +
aThirdOperand;
>>> Expression split in both.
var (longIdentifier && anotherAlsoLongOne) = longValueExpression + anotherOperand + aThirdOperand;
<<<
var (longIdentifier &&
anotherAlsoLongOne) =
longValueExpression +
anotherOperand +
aThirdOperand;
>>> Block split in both.
var (first, second, third, fourth, fifth) = (first, second, third, fourth, fifth);
<<<
var (
first,
second,
third,
fourth,
fifth,
) = (
first,
second,
third,
fourth,
fifth,
);
>>> Expression split in pattern, block split in value.
var (longIdentifier && anotherAlsoLongOne) = (first, second, third, fourth, fifth);
<<<
var (longIdentifier &&
anotherAlsoLongOne) = (
first,
second,
third,
fourth,
fifth,
);
>>> Block split in pattern, expression split in value.
var (first, second, third, fourth, fifth) = longValueExpression + anotherOperand + aThirdOperand;
<<<
var (
first,
second,
third,
fourth,
fifth,
) = longValueExpression +
anotherOperand +
aThirdOperand;