In classDefinition in wren_compiler.c, add a check for TOKEN_RIGHT_BRACE before requiring a newline after the last method definition, so that a closing brace immediately following a method is accepted. Update test/class/syntax.wren with a test case for this syntax.
12 lines
115 B
Plaintext
12 lines
115 B
Plaintext
// Empty body.
|
|
class A {}
|
|
|
|
// Newline body.
|
|
class B {
|
|
|
|
}
|
|
|
|
// No newline after last method.
|
|
class C {
|
|
method {} }
|