Update Objc Rules

This commit is contained in:
Garen Torikian 2012-11-09 18:02:13 -05:00 committed by nightwing
commit 8b1404bd4e
4 changed files with 55 additions and 54 deletions

View file

@ -118,16 +118,10 @@ var c_cppHighlightRules = function() {
regex : "<[a-zA-Z0-9.]+>"
}, {
token : "keyword", // pre-compiler directivs
regex : "(?:#include|#pragma|#line|#define|#undef|#ifdef|#else|#elif|#endif|#ifndef)"
regex : "(?:#include|#import|#pragma|#line|#define|#undef|#ifdef|#else|#elif|#endif|#ifndef)"
}, {
token : "support.function.C99.c",
regex : cFunctions
}, {
// function myFunc(arg) { }
token : [
"text", "entity.name.function", "text", "paren.lparen"
],
regex : "(\\s+)(" + identifierRe + ")(\\s*)(\\()"
}, {
token : keywordMapper,
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"

File diff suppressed because one or more lines are too long

View file

@ -5,7 +5,8 @@ var http = require("http")
, mime = require("mime")
, url = require("url")
, fs = require("fs")
, port = process.env.PORT || 8888;
, port = process.env.PORT || 8888
, ip = process.env.IP || "0.0.0.0";
// compatibility with node 0.6
if (!fs.exists)
@ -40,6 +41,6 @@ http.createServer(function(request, response) {
response.end();
});
});
}).listen(port, "0.0.0.0");
}).listen(port, ip);
console.log("http://localhost:" + port);

View file

@ -0,0 +1,21 @@
// a little script to turn giant keyword regexps into
// something that ace can use; for example:
//
// \b(NS(Rect(ToCGRect|FromCGRect)|MakeCollectable|S(tringFromProtocol))\b
//
// into
//
// (?:\\b)(NS(?:Rect(?:ToCGRect|FromCGRect)|MakeCollectable|S(?:tringFromProtocol))(?:\b)
var inputString = process.argv.splice(2)[0];
// solve word boundaries
var outputString = inputString.replace(/\\b/g, "(?:\\\\b)");
// I apparently need to do this, instead of something clever, because the regexp
// lastIndex is screwing up my positional
outputString = outputString.split("b)(");
outputString = outputString[0] + "b)(" + outputString[1].replace(/\(([^\?])/g, "(?:$1");
console.log("\n\n" + outputString + "\n\n");