From 9bb31f57226877f78f23fb766773aa8486297bb7 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 30 Jun 2011 00:52:42 +0200 Subject: initial commit --- deps/highlight.js/languages/php.js | 58 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 deps/highlight.js/languages/php.js (limited to 'deps/highlight.js/languages/php.js') diff --git a/deps/highlight.js/languages/php.js b/deps/highlight.js/languages/php.js new file mode 100644 index 0000000..2269ad9 --- /dev/null +++ b/deps/highlight.js/languages/php.js @@ -0,0 +1,58 @@ +/* +Language: PHP +Author: Victor Karamzin +*/ + +this.lang = function(hljs){ + +hljs.LANGUAGES.php = { + defaultMode: { + lexems: [hljs.IDENT_RE], + contains: ['comment', 'number', 'string', 'variable', 'preprocessor'], + keywords: {'and': 1, 'include_once': 1, 'list': 1, 'abstract': 1, 'global': 1, 'private': 1, 'echo': 1, 'interface': 1, 'as': 1, 'static': 1, 'endswitch': 1, 'array': 1, 'null': 1, 'if': 1, 'endwhile': 1, 'or': 1, 'const': 1, 'for': 1, 'endforeach': 1, 'self': 1, 'var': 1, 'while': 1, 'isset': 1, 'public': 1, 'protected': 1, 'exit': 1, 'foreach': 1, 'throw': 1, 'elseif': 1, 'extends': 1, 'include': 1, '__FILE__': 1, 'empty': 1, 'require_once': 1, 'function': 1, 'do': 1, 'xor': 1, 'return': 1, 'implements': 1, 'parent': 1, 'clone': 1, 'use': 1, '__CLASS__': 1, '__LINE__': 1, 'else': 1, 'break': 1, 'print': 1, 'eval': 1, 'new': 1, 'catch': 1, '__METHOD__': 1, 'class': 1, 'case': 1, 'exception': 1, 'php_user_filter': 1, 'default': 1, 'die': 1, 'require': 1, '__FUNCTION__': 1, 'enddeclare': 1, 'final': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1, 'endfor': 1, 'endif': 1, 'declare': 1, 'unset': 1} + }, + case_insensitive: true, + modes: [ + hljs.C_LINE_COMMENT_MODE, + hljs.HASH_COMMENT_MODE, + { + className: 'comment', + begin: '/\\*', end: '\\*/', + contains: ['phpdoc'] + }, + { + className: 'phpdoc', + begin: '\\s@[A-Za-z]+', end: '^', + relevance: 10 + }, + hljs.C_NUMBER_MODE, + { + className: 'string', + begin: '\'', end: '\'', + contains: ['escape'], + relevance: 0 + }, + { + className: 'string', + begin: '"', end: '"', + contains: ['escape'], + relevance: 0 + }, + hljs.BACKSLASH_ESCAPE, + { + className: 'variable', + begin: '\\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*', end: '^' + }, + { + className: 'preprocessor', + begin: '<\\?php', end: '^', + relevance: 10 + }, + { + className: 'preprocessor', + begin: '\\?>', end: '^' + } + ] +}; + +}; -- cgit v1.2.3