Clement Escoffier | 0210fa0 | 2009-07-21 11:48:26 +0000 | [diff] [blame] | 1 | dp.sh.Brushes.Php = function()
|
| 2 | {
|
| 3 | var keywords = 'and or xor __FILE__ __LINE__ array as break case ' +
|
| 4 | 'cfunction class const continue declare default die do echo else ' +
|
| 5 | 'elseif empty enddeclare endfor endforeach endif endswitch endwhile eval exit ' +
|
| 6 | 'extends for foreach function global if include include_once isset list ' +
|
| 7 | 'new old_function print require require_once return static switch unset use ' +
|
| 8 | 'var while __FUNCTION__ __CLASS__';
|
| 9 |
|
| 10 | this.regexList = [
|
| 11 | { regex: new RegExp('//.*$', 'gm'), css: 'comment' }, // one line comments
|
| 12 | { regex: new RegExp('/\\*[\\s\\S]*?\\*/', 'g'), css: 'comment' }, // multiline comments
|
| 13 | { regex: new RegExp('"(?:[^"\n]|[\"])*?"', 'g'), css: 'string' }, // double quoted strings
|
| 14 | { regex: new RegExp("'(?:[^'\n]|[\'])*?'", 'g'), css: 'string' }, // single quoted strings
|
| 15 | { regex: new RegExp('\\$\\w+', 'g'), css: 'vars' }, // variables
|
| 16 | { regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword' } // keyword
|
| 17 | ];
|
| 18 |
|
| 19 | this.CssClass = 'dp-c';
|
| 20 | }
|
| 21 |
|
| 22 | dp.sh.Brushes.Php.prototype = new dp.sh.Highlighter();
|
| 23 | dp.sh.Brushes.Php.Aliases = ['php'];
|