Skip to content

Instantly share code, notes, and snippets.

@boucher
Created September 9, 2009 19:10
Show Gist options
  • Select an option

  • Save boucher/183995 to your computer and use it in GitHub Desktop.

Select an option

Save boucher/183995 to your computer and use it in GitHub Desktop.
diff --git a/Objective-J/preprocess.js b/Objective-J/preprocess.js
index ad96215..63c94af 100644
--- a/Objective-J/preprocess.js
+++ b/Objective-J/preprocess.js
@@ -169,6 +169,7 @@ objj_stringBuffer.prototype.isEmpty = function()
var objj_preprocessor = function(aString, aSourceFile, aBundle, flags)
{
+ this._currentSelector = "";
this._currentClass = "";
this._currentSuperClass = "";
this._currentSuperMetaClass = "";
@@ -362,6 +363,7 @@ objj_preprocessor.prototype.implementation = function(tokens, /*objj_stringBuffe
this._currentSuperClass = NULL;
this._currentSuperMetaClass = NULL;
this._currentClass = class_name;
+ this._currentSelector = "";
// If we reach an open parenthesis, we are declaring a category.
if((token = tokens.skip_whitespace()) == TOKEN_OPEN_PARENTHESIS)
@@ -657,6 +659,8 @@ objj_preprocessor.prototype.method = function(tokens)
CONCAT(buffer, selector);
CONCAT(buffer, "\"), function");
+ this._currentSelector = selector;
+
if (this._flags & OBJJ_PREPROCESSOR_DEBUG_SYMBOLS)
CONCAT(buffer, " $" + this._currentClass + "__" + selector.replace(/:/g, "_"));
@@ -884,7 +888,7 @@ objj_preprocessor.prototype.preprocess = function(tokens, /*objj_stringBuffer*/
// If we get this far and we're parsing an objj_msgSend (or array), then we have a problem.
if (tuple)
- objj_exception_throw(new objj_exception(OBJJParseException, "*** Expected ']' - Unterminated message send or array."));
+ objj_exception_throw(new objj_exception(OBJJParseException, "*** Expected ']' - Unterminated message send or array. Possible Context: ["+this._currentClass+" "+this._currentSelector+"]"));
if (!aStringBuffer)
return buffer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment