blob: 8702c189e8e2dec7867799d1ebf7d1107c26684d [file] [log] [blame]
40 columns |
>>> indentation
class A {
var z;
inc(int x) => ++x;
foo(int x) {
if (x == 0) {
return true;
}}}
<<<
class A {
var z;
inc(int x) => ++x;
foo(int x) {
if (x == 0) {
return true;
}
}
}
>>> trailing space inside body
class A {
}
<<<
class A {}
>>> leading space before "class"
class A {
}
<<<
class A {}
>>>
class A { int meaningOfLife() => 42; }
<<<
class A {
int meaningOfLife() => 42;
}
>>>
class A {
}
<<<
class A {}
>>>
class A{var z;inc(int x) => ++x;}
<<<
class A {
var z;
inc(int x) => ++x;
}
>>> eats newlines
abstract
class
A{}
<<<
abstract class A {}
>>> native class
class A extends B
native
"Zapp" {
}
<<<
class A extends B native "Zapp" {}
>>> require blank line after non-empty block-bodied members
class Foo {
var a = 1; b() {;} c() => null; get d {;} get e => null; set f(value) {;
} set g(value) => null; var h = 1;}
<<<
class Foo {
var a = 1;
b() {
;
}
c() => null;
get d {
;
}
get e => null;
set f(value) {
;
}
set g(value) => null;
var h = 1;
}
>>> no required blank line after empty block-bodied members
class Foo {
var a = 1; b() {} c() => null; get d {} get e => null; set f(value) {
} set g(value) => null; var h = 1;}
<<<
class Foo {
var a = 1;
b() {}
c() => null;
get d {}
get e => null;
set f(value) {}
set g(value) => null;
var h = 1;
}
>>>
class Foo {
covariant var bar;
covariant int baz;
@wat covariant int zoop;
}
<<<
class Foo {
covariant var bar;
covariant int baz;
@wat
covariant int zoop;
}
>>> blank line before and after class
var x = 1;
class A {}
var y = 2;
<<<
var x = 1;
class A {}
var y = 2;
>>> late fields
class Foo {
static late final int i;
static late int i;
static late var i;
covariant late var i;
covariant late int i;
late final int i;
late int i;
late var i;
}
<<<
class Foo {
static late final int i;
static late int i;
static late var i;
covariant late var i;
covariant late int i;
late final int i;
late int i;
late var i;
}
>>> abstract fields
class Foo {
abstract covariant var a , b ;
abstract final int c;
abstract int i;
}
<<<
class Foo {
abstract covariant var a, b;
abstract final int c;
abstract int i;
}
>>> discard trailing newlines in body
class Foo {
bar() {}
}
<<<
class Foo {
bar() {}
}
>>> class modifiers
class C1 {}
base class C2 {}
interface class C3 {}
final class C4 {}
sealed class C5 {}
abstract class C6 {}
abstract base class C7 {}
abstract interface class C8 {}
abstract final class C9 {}
mixin class C10 {}
base mixin class C11 {}
abstract mixin class C12 {}
abstract base mixin class C13 {}
<<<
class C1 {}
base class C2 {}
interface class C3 {}
final class C4 {}
sealed class C5 {}
abstract class C6 {}
abstract base class C7 {}
abstract interface class C8 {}
abstract final class C9 {}
mixin class C10 {}
base mixin class C11 {}
abstract mixin class C12 {}
abstract base mixin class C13 {}
>>> mixin application modifiers
class C1 = Object with Mixin;
base class C2 = Object with Mixin;
interface class C3 = Object with Mixin;
final class C4 = Object with Mixin;
sealed class C5 = Object with Mixin;
abstract class C6 = Object with Mixin;
abstract base class C7 = Object with Mixin;
abstract interface class C8 = Object with Mixin;
abstract final class C9 = Object with Mixin;
mixin class C10 = Object with Mixin;
base mixin class C11 = Object with Mixin;
abstract mixin class C12 = Object with Mixin;
abstract base mixin class C13 = Object with Mixin;
<<<
class C1 = Object with Mixin;
base class C2 = Object with Mixin;
interface class C3 = Object with Mixin;
final class C4 = Object with Mixin;
sealed class C5 = Object with Mixin;
abstract class C6 = Object with Mixin;
abstract base class C7 = Object
with Mixin;
abstract interface class C8 = Object
with Mixin;
abstract final class C9 = Object
with Mixin;
mixin class C10 = Object with Mixin;
base mixin class C11 = Object
with Mixin;
abstract mixin class C12 = Object
with Mixin;
abstract base mixin class C13 = Object
with Mixin;