BEGIN LICENSE BLOCK END LICENSE BLOCK if typeof Bespin undefined Bespi

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* ***** BEGIN LICENSE BLOCK *****
* ***** END LICENSE BLOCK ***** */
if (typeof Bespin == "undefined") Bespin = {};
if (!Bespin.Syntax) Bespin.Syntax = {};
// ** {{{ Bespin.Syntax.PHPSyntaxEngine }}} **
Bespin.Syntax.PHPLConstants = {
OTHER: "plain",
QUESTION_MARK: "question_mark", /* <?php, ?> */
STRING: "string",
STRING_VAR: "string_variable",
VAR: "variable",
KEYWORD: "keyword",
OPERATOR: "operator",
COMMENT: "comment"
}
Bespin.Syntax.PHPSyntaxEngine = Class.create({
keywords: 'and include_once list abstract global private echo interface as static ' +
'endswitch array null if endwhile or const for endforeach self var while ' +
'isset public protected exit foreach throw elseif extends include __FILE__ ' +
'empty require_once function do xor return implements parent clone use ' +
'__CLASS__ __LINE__ else break eval new catch __METHOD__ class case ' +
'exception php_user_filter default die require __FUNCTION__ enddeclare final ' +
'try this switch continue endfor endif declare unset'.split(" "),
operators: '! @ # $ % ^ & * ( ) _ + { } [ ] " \' + -',
});
// Register
Bespin.Syntax.EngineResolver.register(new Bespin.Syntax.PHPSyntaxEngine(), ['php', 'php3', 'phtml']);