From df728b7a2187a23796c7cc6431cd465586832f8e Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Sun, 28 Mar 2010 08:51:13 -0700 Subject: [PATCH 1/2] Support terminating method signatures with ;. Closes #416. --- Objective-J/Preprocessor.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Objective-J/Preprocessor.js b/Objective-J/Preprocessor.js index d5b78e21e..d90a71b07 100644 --- a/Objective-J/Preprocessor.js +++ b/Objective-J/Preprocessor.js @@ -612,7 +612,7 @@ Preprocessor.prototype.method = function(/*Lexer*/ tokens, ivar_names) ivar_names = ivar_names || {}; - while((token = tokens.skip_whitespace()) && token != TOKEN_OPEN_BRACE) + while((token = tokens.skip_whitespace()) && token !== TOKEN_OPEN_BRACE && token !== TOKEN_SEMICOLON) { if (token == TOKEN_COLON) { @@ -666,6 +666,16 @@ Preprocessor.prototype.method = function(/*Lexer*/ tokens, ivar_names) selector += token; } + if (token === TOKEN_SEMICOLON) + { + token = tokens.skip_whitespace(); + if (token !== TOKEN_OPEN_BRACE) + { + throw new SyntaxError(this.error_message("Invalid semi-colon in method declaration. "+ + "Semi-colons are allowed only to terminate the method signature, before the open brace.")); + } + } + var index = 0, count = parameters.length; From 7ab41cf1956af8929a5781daf6f1873a0f649f0f Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Sun, 28 Mar 2010 09:03:33 -0700 Subject: [PATCH 2/2] If there is no key window or no main window make the first opened window those things. --- AppKit/CPWindow/CPWindow.j | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j index 43f1e12b0..cfb98a5f5 100644 --- a/AppKit/CPWindow/CPWindow.j +++ b/AppKit/CPWindow/CPWindow.j @@ -738,6 +738,12 @@ CPTexturedBackgroundWindowMask if (_firstResponder === self || !_firstResponder) [self makeFirstResponder:[self initialFirstResponder]]; + + if (!CPApp._keyWindow) + [self makeKeyWindow]; + + if (!CPApp._mainWindow) + [self makeMainWindow]; } /*