-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmake.hrc
171 lines (142 loc) · 6.61 KB
/
cmake.hrc
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
159
160
161
162
163
164
165
166
167
168
169
170
171
<?xml version="1.0" encoding='Windows-1251'?>
<!DOCTYPE hrc PUBLIC "-//Cail Lomecb//DTD Colorer HRC take5//EN"
"http://colorer.sf.net/2003/hrc.dtd"[
<!ENTITY cmake-dict SYSTEM "cmake.ent.hrc">
<!ENTITY cmake-auto SYSTEM "cmake-auto.ent.hrc">
]>
<hrc version="take5"
xmlns="http://colorer.sf.net/2003/hrc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://colorer.sf.net/2003/hrc http://colorer.sf.net/2003/hrc.xsd">
<annotation>
<documentation>
CMake Files Syntax
</documentation>
<contributors><![CDATA[
Extrunder <extrunder.spb@gmail.com>
]]></contributors>
<appinfo>
<todo>
Add following lines into proto.hrc and correct location link, don't forget to remove comments ;)
<!--
<prototype name="cmake" group="scripts" description="CMake script">
<location link="types/cmake.hrc"/>
<filename>/(\.cmake)$/i</filename>
<filename weight="3">/(^CMakeLists\.txt)$/i</filename>
<firstline weight="2">/^cmake_minimum_required/xi</firstline>
</prototype>
-->
</todo>
</appinfo>
</annotation>
<package name="cmake-dict">
<location link="cmake.ent.hrc"/>
</package>
<package name="cmake-auto">
<location link="cmake-auto.ent.hrc"/>
</package>
<type name="cmake">
<region name="cmake_function_names" parent="def:Function"/>
<region name="cmake_parameters" parent="def:Parameter"/>
<region name="cmake_variables" parent="def:VarStrong"/>
<region name="cmake_operators" parent="def:Operator"/>
<region name="cmake_string" parent="def:StringContent"/>
<region name="cmake_keywords" parent="def:Keyword"/>
<scheme name="cmake">
<inherit scheme="Expressions" />
</scheme>
<scheme name="RegexContent">
<inherit scheme="regexp:std.regexp" />
</scheme>
<scheme name="Strings">
<block start="/(?{def:StringEdge}[Ll]?")/" end="/(?{def:StringEdge}")/" scheme="StringContent" region="def:String" inner-region="yes"
region00="def:PairStart" region10="def:PairEnd" />
<block start="/(?{def:StringEdge}\[\[)/" end="/(?{def:StringEdge}\]\])/" scheme="RegexContent" inner-region="yes"
region00="def:PairStart" region10="def:PairEnd" />
</scheme>
<scheme name="StringContent">
<regexp match="/\\\\$/" region="def:Error"/>
<regexp match="/(\%)\w+(\%)/" region="def:Const" region1="def:PairStart" region2="def:PairEnd"/>
<regexp match="/\\[^xX\d]/" region="def:StringContent"/>
<regexp match="/\\$/" region="def:StringContent"/>
<regexp match="/\\x[\da-fA-F]{1,8}/i" region="def:StringContent"/>
<regexp match="/\\[0-7]{1,12}/" region="def:StringContent"/>
<regexp match="/\%[\-\+\#0]*?[\d\*]*(\.[\d\*]+)?[Ll]?[SsCcsuidopxXnEefgG]/" region="def:StringContent"/>
<regexp match="/[^\\\"]$/" region="def:Error"/>
<!-- regexp match="/\M(\$\{)([^(\})]+)(\})/" region1="def:Symbol" region3="def:Symbol" / -->
<!-- regexp match="/(\$\{)([^(\})]+)(\})\m/" region1="def:PairStart" region3="def:PairEnd" / -->
<inherit scheme="Variables"/>
<inherit scheme="TabsAsErrors"/>
</scheme>
<scheme name="TabsAsErrors" if="tabs-as-errors">
<regexp match="/\t+/" region='def:Error'/>
</scheme>
<entity name="Sep" value="(?:(?:[\s]|\n|\r)*)" />
<entity name="Args" value="(?:%Sep;\(&Sep;(?{All}(?{First}[^\)\s]*)[^\)]*)\))" />
<entity name="ArgsMatch1" value="(?:%Sep;\(%Sep;(?:\y{First}||(?{def:Error}.+))%Sep;\))" />
<entity name="ArgsMatch0" value="(?:%Sep;\(%Sep;(?:\y{All}||(?{def:Error}.+))%Sep;\))" />
<!-- CMakeKeywords, CMakeVariables, CMakeCommands, etc... -->
&cmake-dict;
&cmake-auto;
<scheme name="If">
<block start="/(?:if)?#2(\()/" end="/(\))/" scheme="Keywords_if"
region00="def:Symbol" region01="def:PairStart" region10="def:Symbol" region11="def:PairEnd" inner-region="yes"/>
<inherit scheme="Expressions" />
</scheme>
<scheme name="While">
<block start="/(?:while)?#5(\()/" end="/(\))/" scheme="Keywords_if"
region00="def:Symbol" region01="def:PairStart" region10="def:Symbol" region11="def:PairEnd" inner-region="yes"/>
<inherit scheme="Expressions" />
</scheme>
<scheme name="Command">
<inherit scheme="FunctionArguments" />
<inherit scheme="CompositeExpression" />
</scheme>
<scheme name="Comments">
<block start="/#\[(?{id}.*?)\[/" end="/\](\y{id})\]/" scheme="def:Comment" region="def:CommentContent"
region00="def:PairStart" region10="def:PairEnd"/>
<regexp match="/\m\#.*$/" region="def:CommentContent" />
</scheme>
<scheme name="Variables">
<block start="/(\$(?:ENV)?\{)/" end="/(\})/" scheme="CompositeExpression"
region="def:String" region00="def:Symbol" region01="def:PairStart" region10="def:Symbol" region11="def:PairEnd"/>
<block start="/(\$<)\M([^\:]+)(\:)/" end="/(>)/" scheme="CompositeExpression"
region="def:String" region00="def:Symbol" region01="def:PairStart" region02="def:String" region03="def:Symbol" region10="def:Symbol" region11="def:PairEnd"/>
<inherit scheme="CMakeVariables" />
</scheme>
<scheme name="Arguments">
<inherit scheme="CompositeExpression" />
</scheme>
<scheme name="CompositeExpression">
<inherit scheme="Comments" />
<inherit scheme="Strings" />
<inherit scheme="Variables" />
<inherit scheme="CMakeKeywords" />
</scheme>
<scheme name="Expressions">
<inherit scheme="CompositeExpression" />
<inherit scheme="CMakeCommands" />
<block start="/\b(%CMakeCommands;\b%Sep;\()/ix" end="/(\))/" scheme="Command"
region00="def:Symbol" region01="def:PairStart"
region10="def:Symbol" region11="def:PairEnd" priority="low"/>
<block start="/(\()/" end="/(\))/" scheme="Expressions"
region00="def:Symbol" region01="def:PairStart"
region10="def:Symbol" region11="def:PairEnd"/>
<block start="/\b(if)\b\M%Args;/i" end="/\b(endif)\b%ArgsMatch0;/i" scheme="If"
region00="def:Symbol" region01="def:PairStart"
region10="def:Symbol" region11="def:PairEnd"/>
<block start="/\b(while)\b\M%Args;/i" end="/\b(endwhile)\b%ArgsMatch0;/i" scheme="While"
region00="def:Symbol" region01="def:PairStart"
region10="def:Symbol" region11="def:PairEnd"/>
<block start="/\b(foreach)\b\M%Args;/i" end="/\b(endforeach)\b%ArgsMatch1;/i" scheme="Expressions"
region00="def:Symbol" region01="def:PairStart"
region10="def:Symbol" region11="def:PairEnd"/>
<block start="/\b(function)\b\M%Args;/i" end="/\b(endfunction)\b%ArgsMatch1;/i" scheme="Expressions"
region00="def:Symbol" region01="def:PairStart"
region10="def:Symbol" region11="def:PairEnd"/>
<block start="/\b(macro)\b\M%Args;/i" end="/\b(endmacro)\b%ArgsMatch1;/i" scheme="Expressions"
region00="def:Symbol" region01="def:PairStart"
region10="def:Symbol" region11="def:PairEnd"/>
</scheme>
</type>
</hrc>