X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=index.js;h=feaf66e439f9a8286f859980bdc553544ae6f2cb;hb=70f567a0fa292abb7aef7b22c51b273e9690975a;hp=f02ac5acaddadcfeec4ca96016ceef0c7b010483;hpb=26a62311e466992b321019dbca9521ee36e19ada;p=mdref%2Fmdref diff --git a/index.js b/index.js index f02ac5a..feaf66e 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,11 @@ function log() { } function is_constant(s) { - return s.length > 1 && s.toUpperCase(s) === s; + s = s.replace(/v\d+(_\d+)?$/, ""); + if (s.length < 2) { + return false; + } + return s.toUpperCase(s) === s; } function is_variable(s) { @@ -27,6 +31,7 @@ function type(s, nn) { case "int": case "float": case "string": + case "resource": case "array": case "object": case "callable": @@ -48,6 +53,7 @@ function type(s, nn) { case "RecursiveArrayIterator": case "SplObserver": case "SplSubject": + case "SplObjectStorage": return ""; // keywords @@ -78,11 +84,11 @@ function type(s, nn) { t = s.substring(i+2); if (!is_constant(t) && !is_variable(t)) { // methods - return ""; + return ""; } } - if (-1 !== (j = s.indexOf("\\"))) { - return ""; + if (-1 !== (j = s.indexOf("\\")) && s.substr(j+1,1) !== "n") { + return ""; } switch (s.toLowerCase()) { @@ -145,10 +151,10 @@ function walk(i, e) { function blink(c) { var $c = $(c); - $c.fadeOut("slow").queue(function(next) { + $c.fadeOut("fast").queue(function(next) { this.style.color = "red"; next(); - }).fadeIn("fast").fadeOut("fast").queue(function(next) { + }).fadeIn("fast").fadeOut("slow").queue(function(next) { this.style.color = ""; next(); }).fadeIn("slow");