summaryrefslogtreecommitdiffstats
path: root/kate/data/c.xml
blob: 01566d5d95af7b7971ca5fef994ecfa617956888 (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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="C" section="Sources"
          version="1.45" kateversion="2.4"
          indenter="cstyle"
          extensions="*.c;*.C;*.h"
          mimetype="text/x-csrc;text/x-c++src;text/x-chdr"
          priority="5">
<!--
##########################################################################
## Fixes by Sebastian Pipping ([email protected])
##
## NOTE: Keep in sync with C++ highlighter! (cpp.xml)
##########################################################################
-->
  <highlighting>
    <list name="keywords">
      <item> break </item>
      <item> case </item>
      <item> continue </item>
      <item> default </item>
      <item> do </item>
      <item> else </item>
      <item> enum </item>
      <item> extern </item>
      <item> for </item>
      <item> goto </item>
      <item> if </item>
      <item> inline </item>
      <item> return </item>
      <item> sizeof </item>
      <item> struct </item>
      <item> switch </item>
      <item> typedef </item>
      <item> union </item>
      <item> while </item>
    </list>
    <list name="types">
      <item> auto </item>
      <item> char </item>
      <item> const </item>
      <item> double </item>
      <item> float </item>
      <item> int </item>
      <item> long </item>
      <item> register </item>
      <item> restrict </item>
      <item> short </item>
      <item> signed </item>
      <item> static </item>
      <item> unsigned </item>
      <item> void </item>
      <item> volatile </item>
      <item> int8_t </item>
      <item> int16_t </item>
      <item> int32_t </item>
      <item> int64_t </item>
      <item> uint8_t </item>
      <item> uint16_t </item>
      <item> uint32_t </item>
      <item> uint64_t </item>
      <item> wchar_t </item>
      <item> _Imaginary </item>
      <item> _Complex </item>
      <item> _Bool </item>
    </list>
    <contexts>
      <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
        <DetectSpaces />
	<RegExpr attribute="Preprocessor" context="Outscoped" String="#\s*if\s+0\s*$" beginRegion="PP" firstNonSpace="true" />
        <DetectChar context="AfterHash" char="#" firstNonSpace="true" lookAhead="true" />
        <StringDetect attribute="Region Marker" context="Region Marker" String="//BEGIN" beginRegion="Region1" firstNonSpace="true" />
        <StringDetect attribute="Region Marker" context="Region Marker" String="//END" endRegion="Region1" firstNonSpace="true" />
        <keyword attribute="Keyword" context="#stay" String="keywords"/>
        <keyword attribute="Data Type" context="#stay" String="types"/>
        <DetectIdentifier />
        <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />
        <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />
        <Float attribute="Float" context="#stay">
          <AnyChar String="fF" attribute="Float" context="#stay"/>
        </Float>
        <HlCOct attribute="Octal" context="#stay"/>
        <HlCHex attribute="Hex" context="#stay"/>
        <RegExpr attribute="Binary" context="#stay" String="0b[01]+[ul]{0,3}" insensitive="true" />
        <Int attribute="Decimal" context="#stay" >
          <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
          <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
          <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
          <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
          <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
          <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
          <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
          <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
        </Int>
        <HlCChar attribute="Char" context="#stay"/>
        <DetectChar attribute="String" context="String" char="&quot;"/>
        <IncludeRules context="##Doxygen" />
        <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
        <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
        <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/>
      </context>

      <context attribute="String" lineEndContext="#pop" name="String">
        <LineContinue attribute="String" context="#stay"/>
        <HlCStringChar attribute="String Char" context="#stay"/>
        <DetectChar attribute="String" context="#pop" char="&quot;"/>
      </context>

      <context attribute="Region Marker" lineEndContext="#pop" name="Region Marker">
      </context>

      <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
        <LineContinue attribute="Comment" context="#stay"/>
        <IncludeRules context="##Alerts" />
      </context>

      <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
        <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
        <IncludeRules context="##Alerts" />
      </context>

      <context attribute="Error" lineEndContext="#pop" name="AfterHash">
        <!-- define, elif, else, endif, error, if, ifdef, ifndef, include, include_next, line, pragma, undef, warning -->
        <RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s*if(?:def|ndef)?(?=\s+\S)" insensitive="true" beginRegion="PP" firstNonSpace="true" />
        <RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s*endif" insensitive="true" endRegion="PP" firstNonSpace="true" />
        <RegExpr attribute="Preprocessor" context="Define" String="#\s*define.*((?=\\))" insensitive="true" firstNonSpace="true" />
        
        <!-- folding for apple style #pragma mark - label -->
        <RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s*pragma\s+mark\s+-\s*$" insensitive="true" firstNonSpace="true" endRegion="pragma_mark" />
        <RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s*pragma\s+mark" insensitive="true" firstNonSpace="true" endRegion="pragma_mark" beginRegion="pragma_mark" />
        
        <RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s*(?:el(?:se|if)|include(?:_next)?|define|undef|line|error|warning|pragma)" insensitive="true" firstNonSpace="true" />
        <RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s+[0-9]+" insensitive="true" firstNonSpace="true" />
      </context>

      <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
        <LineContinue attribute="Preprocessor" context="#stay"/>
        <RangeDetect attribute="Prep. Lib" context="#stay" char="&quot;" char1="&quot;"/>
        <RangeDetect attribute="Prep. Lib" context="#stay" char="&lt;" char1="&gt;"/>
        <IncludeRules context="##Doxygen" />
        <Detect2Chars attribute="Comment" context="Commentar/Preprocessor" char="/" char1="*" beginRegion="Comment2" />
        <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/" />
      </context>

      <context attribute="Preprocessor" lineEndContext="#pop" name="Define">
        <LineContinue attribute="Preprocessor" context="#stay"/>
      </context>

      <context attribute="Comment" lineEndContext="#stay" name="Commentar/Preprocessor">
        <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment2" />
      </context>

      <context attribute="Comment" lineEndContext="#stay" name="Outscoped" >
        <DetectSpaces />
        <IncludeRules context="##Alerts" />
        <DetectIdentifier />
        <DetectChar attribute="String" context="String" char="&quot;"/>
        <IncludeRules context="##Doxygen" />
        <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
        <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
        <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="PP" firstNonSpace="true" />
        <RegExpr attribute="Preprocessor" context="#pop" String="#\s*el(?:se|if)" firstNonSpace="true" />
        <RegExpr attribute="Preprocessor" context="#pop" String="#\s*endif" endRegion="PP" firstNonSpace="true" />
      </context>

      <context attribute="Comment" lineEndContext="#stay" name="Outscoped intern">
        <DetectSpaces />
        <IncludeRules context="##Alerts" />
        <DetectIdentifier />
        <DetectChar attribute="String" context="String" char="&quot;"/>
        <IncludeRules context="##Doxygen" />
        <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
        <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
        <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="PP" firstNonSpace="true" />
        <RegExpr attribute="Comment" context="#pop" String="#\s*endif" endRegion="PP" firstNonSpace="true" />
      </context>
    </contexts>
    <itemDatas>
      <itemData name="Normal Text"  defStyleNum="dsNormal" spellChecking="false"/>
      <itemData name="Keyword"      defStyleNum="dsKeyword" spellChecking="false"/>
      <itemData name="Data Type"    defStyleNum="dsDataType" spellChecking="false"/>
      <itemData name="Decimal"      defStyleNum="dsDecVal" spellChecking="false"/>
      <itemData name="Octal"        defStyleNum="dsBaseN" spellChecking="false"/>
      <itemData name="Hex"          defStyleNum="dsBaseN" spellChecking="false"/>
      <itemData name="Binary"       defStyleNum="dsBaseN" spellChecking="false"/>
      <itemData name="Float"        defStyleNum="dsFloat" spellChecking="false"/>
      <itemData name="Char"         defStyleNum="dsChar" spellChecking="false"/>
      <itemData name="String"       defStyleNum="dsString"/>
      <itemData name="String Char"  defStyleNum="dsChar"/>
      <itemData name="Comment"      defStyleNum="dsComment"/>
      <itemData name="Symbol"       defStyleNum="dsNormal" spellChecking="false"/>
      <itemData name="Preprocessor" defStyleNum="dsOthers" spellChecking="false"/>
      <itemData name="Prep. Lib"    defStyleNum="dsOthers" spellChecking="false"/> <!--,Qt::darkYellow,Qt::yellow,false,false)); -->
      <itemData name="Alert"        defStyleNum="dsAlert" spellChecking="false"/>
      <itemData name="Region Marker" defStyleNum="dsRegionMarker" spellChecking="false"/>
      <itemData name="Error"        defStyleNum="dsError" spellChecking="false"/>
    </itemDatas>
  </highlighting>
  <general>
    <comments>
      <comment name="singleLine" start="//" />
      <comment name="multiLine" start="/*" end="*/" />
    </comments>
    <keywords casesensitive="1" additionalDeliminator="'&quot;" />
  </general>
</language>