Created
March 26, 2011 20:47
-
-
Save marijnh/888623 to your computer and use it in GitHub Desktop.
non-embedded PHP mode for codemirror
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
function keywords(str) { | |
var obj = {}, words = str.split(" "); | |
for (var i = 0; i < words.length; ++i) obj[words[i]] = true; | |
return obj; | |
} | |
var phpKeywords = | |
keywords("abstract and array as break case catch cfunction class clone const continue declare " + | |
"default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends " + | |
"final for foreach function global goto if implements interface instanceof namespace " + | |
"new or private protected public static switch throw try use var while xor"); | |
CodeMirror.defineMIME("application/x-httpd-php", {name: "clike", keywords: phpKeywords, multiLineStrings: true, $vars: true}); | |
)(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment