fix: allow class body to end without newline after last method definition

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.
This commit is contained in:
Bob Nystrom
2014-02-15 04:15:49 +00:00
parent 08618abc5d
commit 5f505c2a02
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -5,3 +5,7 @@ class A {}
class B {
}
// No newline after last method.
class C {
method {} }