blob: f09ff27d93c2299e6111bc9f1d59c0b4dfdd86de (
plain)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
<?xml version="1.0"?>
<!-- syntaxdefinition for PHP 2001 by Chad Smith & Mike Krueger -->
<!-- converted to AvalonEdit format by Siegfried Pammer in 2010 -->
<SyntaxDefinition name ="PHP" extensions = ".php" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color name="Comment" foreground="Green" exampleText="// comment" />
<Color name="String" foreground="Blue" exampleText="$text = "Hello, World!"" />
<Color name="NumberLiteral" foreground="DarkBlue" exampleText="3.1415" />
<Color name="Punctuation" foreground="DarkGreen" exampleText="a(b + c)" />
<Color name="FunctionCall" foreground="MidnightBlue" fontWeight="bold" exampleText="abs(num);"/>
<Color name="AccessKeywords" foreground="Black" fontWeight="bold" exampleText="global $database;" />
<Color name="OperatorKeywords" foreground="DarkCyan" fontWeight="bold" exampleText="if (x === false and y === false) { }" />
<Color name="SelectionStatements" foreground="Blue" fontWeight="bold" exampleText="if (true) { } else { }" />
<Color name="IterationStatements" foreground="Blue" fontWeight="bold" exampleText="while (true) { }" />
<Color name="JumpStatements" foreground="Navy" fontWeight="bold" exampleText="if (x == 5) continue;" />
<Color name="ControlStatements" foreground="Teal" fontWeight="bold" exampleText="include("test.php");" />
<Color name="ValueTypes" foreground="Red" fontWeight="bold" exampleText="int test = 5;" />
<Color name="OtherTypes" foreground="Red" exampleText="object test = null;" />
<Color name="AccessModifiers" foreground="Blue" fontWeight="bold" exampleText="public function test() {}" />
<RuleSet>
<Span color="Comment">
<Begin>\#</Begin>
</Span>
<Span color="Comment">
<Begin>//</Begin>
</Span>
<Span color="Comment" multiline="true">
<Begin>/\*</Begin>
<End>\*/</End>
</Span>
<!-- Digits -->
<Rule color="NumberLiteral">
\b0[xX][0-9a-fA-F]+ # hex number
|
\b0[0-9]+ # octal number
|
( \b\d+(\.[0-9]+)? #number with optional floating point
| \.[0-9]+ #or just starting with floating point
)
([eE][+-]?[0-9]+)? # optional exponent
</Rule>
<Rule color="Punctuation">
[?,.:;()\[\]{}+\-/%*<>&^!|~@]+
</Rule>
<!-- Mark previous rule-->
<Rule color="FunctionCall">
\b
[\d\w_]+ # an identifier
(?=\s*\() # followed by (
</Rule>
<Span color="String" multiline="true">
<Begin>'</Begin>
<End>'</End>
<RuleSet>
<!-- span for escape sequences -->
<Span begin="\\" end="."/>
</RuleSet>
</Span>
<Span color="String" multiline="true">
<Begin>"</Begin>
<End>"</End>
<RuleSet>
<!-- span for escape sequences -->
<Span begin="\\" end="."/>
</RuleSet>
</Span>
<!-- heredoc syntax -->
<Span color="String" multiline="true">
<Begin><<<\"?[\d\w_]+\"?$</Begin>
<End>^[\d\w_]+;</End>
</Span>
<!-- nowdoc syntax -->
<Span color="String" multiline="true">
<Begin><<<\'[\d\w_]+\'$</Begin>
<End>^[\d\w_]+;</End>
</Span>
<Keywords color="AccessKeywords">
<Word>global</Word>
<Word>my</Word>
<Word>var</Word>
</Keywords>
<Keywords color="OperatorKeywords">
<Word>and</Word>
<Word>or</Word>
<Word>new</Word>
<Word>clone</Word>
<Word>instanceof</Word>
<Word>xor</Word>
<Word>true</Word>
<Word>false</Word>
</Keywords>
<Keywords color="SelectionStatements">
<Word>else</Word>
<Word>else</Word>
<Word>switch</Word>
<Word>case</Word>
<Word>endif</Word>
<Word>elseif</Word>
</Keywords>
<Keywords color="IterationStatements">
<Word>do</Word>
<Word>for</Word>
<Word>foreach</Word>
<Word>while</Word>
<Word>endwhile</Word>
<Word>exit</Word>
</Keywords>
<Keywords color="JumpStatements">
<Word>break</Word>
<Word>continue</Word>
<Word>default</Word>
<Word>goto</Word>
<Word>return</Word>
</Keywords>
<Keywords color="ControlStatements">
<Word>require</Word>
<Word>include</Word>
<Word>require</Word>
<Word>include</Word>
<Word>function</Word>
</Keywords>
<Keywords color="ValueTypes">
<Word>int</Word>
<Word>integer</Word>
<Word>real</Word>
<Word>double</Word>
<Word>float</Word>
<Word>string</Word>
<Word>array</Word>
<Word>object</Word>
</Keywords>
<Keywords color="OtherTypes">
<Word>class</Word>
<Word>void</Word>
</Keywords>
<Keywords color="AccessModifiers">
<Word>public</Word>
<Word>private</Word>
</Keywords>
</RuleSet>
</SyntaxDefinition>
|