From ce1646317b2722b18c090d021a806b0680a73d65 Mon Sep 17 00:00:00 2001 From: b01dface Date: Mon, 13 Jan 2014 20:18:42 -0500 Subject: [PATCH 1/2] Update IO print calls and a few typos. --- doc/receiver-less calls.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/receiver-less calls.txt b/doc/receiver-less calls.txt index 8378feab..7fbb4a31 100644 --- a/doc/receiver-less calls.txt +++ b/doc/receiver-less calls.txt @@ -3,8 +3,8 @@ Q1: What does this resolve to: foo(arg) It could be: - 1. this.foo(bar) - 2. EnclosingClass.foo(bar) // i.e. a static method call + 1. this.foo(arg) + 2. EnclosingClass.foo(arg) // i.e. a static method call 3. a call to a top-level function foo() If we adopt the idea that a module is just a class definition (with some @@ -49,7 +49,7 @@ This is analogous to: The obvious solution is to use the class name: class SomeModule { - static foo(arg) { io.write("called foo!") } + static foo(arg) { IO.print("called foo!") } class SomeClass { bar { @@ -63,7 +63,7 @@ class" is. Idea: it's unnamed, so you just use a leading ".": - def foo(arg) { io.write("called foo!") } + def foo(arg) { IO.print("called foo!") } class SomeClass { bar { From d8378aceed671b4611a54b12cd4c0187f73dfaf3 Mon Sep 17 00:00:00 2001 From: b01dface Date: Mon, 13 Jan 2014 20:21:25 -0500 Subject: [PATCH 2/2] Fix an error message. --- src/wren_compiler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wren_compiler.c b/src/wren_compiler.c index 2a67cff8..c2f88972 100644 --- a/src/wren_compiler.c +++ b/src/wren_compiler.c @@ -2381,7 +2381,7 @@ static void classDefinition(Compiler* compiler) compiler->fields = &fields; // Compile the method definitions. - consume(compiler, TOKEN_LEFT_BRACE, "Expect '}' after class body."); + consume(compiler, TOKEN_LEFT_BRACE, "Expect '{' after class body."); while (!match(compiler, TOKEN_RIGHT_BRACE)) { Code instruction = CODE_METHOD_INSTANCE;