summaryrefslogtreecommitdiffstats
path: root/kate/data/makefile.xml
blob: 573359208f14c200bb1553251445ef089b9e00ba (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
207
208
209
210
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<!-- Makefile syntaxfile v0.9 by Per Wigren <wigren@home.se> -->
<!-- Modified by Joseph Wenninger <jowenn@kde.org> -->
<!-- Modified by Rui Santana <santana.rui@gmail.com> -->
<!-- v2.0 by Andreas Nordal <andreas.nordal@gmail.com> -->
<!-- small priority to allow for example Makefile.cpp to be detected as cpp file -->
<language name="Makefile" section="Other"
          version="2.0" kateversion="2.4"
          extensions="GNUmakefile;Makefile;makefile;GNUmakefile.*;Makefile.*;makefile.*;*.mk"
          mimetype="text/x-makefile"
          author="Per Wigren (wigren@home.se)" license="">
  <highlighting>
    <list name = "keywords">
      <item> include </item>
      <item> define </item>
      <item> else </item>
      <item> endef </item>
      <item> endif </item>
      <item> ifdef </item>
      <item> ifeq </item>
      <item> ifndef </item>
      <item> ifneq </item>
      <item> override </item>
    </list>
    <list name = "functions">
      <item> call </item>
      <item> subst </item>
      <item> patsubst </item>
      <item> strip </item>
      <item> findstring </item>
      <item> filter </item>
      <item> filter-out </item>
      <item> sort </item>
      <item> word </item>
      <item> wordlist </item>
      <item> words </item>
      <item> firstword </item>
      <item> lastword </item>
      <item> dir </item>
      <item> notdir </item>
      <item> suffix </item>
      <item> basename </item>
      <item> addsuffix </item>
      <item> addprefix </item>
      <item> join </item>
      <item> wildcard </item>
      <item> realpath </item>
      <item> abspath </item>
      <item> if </item>
      <item> or </item>
      <item> and </item>
      <item> foreach </item>
      <item> value </item>
      <item> eval </item>
      <item> origin </item>
      <item> flavor </item>
      <item> shell </item>
      <item> error </item>
      <item> warning </item>
      <item> info </item>
    </list>

    <contexts>
      <context name="normal" attribute="Normal" lineEndContext="#stay">
        <DetectSpaces/>
        <RegExpr attribute="Comment"  context="#stay" String="#.*$"/>
        <keyword attribute="Keyword"  context="#stay" String="keywords"/>
        <RegExpr attribute="Variable" context="assign" String="[^\s:+?]*\s*(?=:=|=|\+=|\?=)"/>
        <RegExpr attribute="Section"  context="prereq" String="^\.[^.][^:]*:"/>
        <RegExpr attribute="Target"   context="prereq" String="^[^:]*:"/>
        <DetectIdentifier/>
        <DetectChar attribute="String" context="string&quot;" char="&quot;"/>
        <DetectChar attribute="String" context="string'" char="'"/>
        <DetectChar attribute="Operator" context="dollar" char="$"/>
        <Detect2Chars attribute="Special" context="#stay" char="\" char1="#"/>
        <Detect2Chars attribute="Special" context="#stay" char="\" char1="\"/>
        <AnyChar attribute="Operator" context="silent" String="@-" firstNonSpace="1"/>
      </context>

      <context name="prereq" attribute="Prereq" lineEndContext="rule">
        <DetectSpaces/>
        <DetectIdentifier/>
        <LineContinue attribute="Operator" context="#stay"/>
        <DetectChar attribute="Operator" context="dollar" char="$"/>
        <Detect2Chars attribute="Special" context="#stay" char="\" char1="#"/>
        <Detect2Chars attribute="Special" context="#stay" char="\" char1="\"/>
        <RegExpr attribute="Comment"  context="#stay" String="#.*$"/>
      </context>

      <context name="rule" attribute="Normal" lineEndContext="#stay">
        <LineContinue attribute="Operator" context="#stay"/>
        <!-- pop if there is a leading non-tab,
        and in particular, mark leading spaces as errors -->
        <RegExpr attribute="Error" context="#pop#pop#pop" String="^ +" firstNonSpace="1"/>
        <RegExpr context="#pop#pop#pop" String="^[^\t]" lookAhead="1" firstNonSpace="1"/>
        <DetectSpaces/>
        <DetectIdentifier/>
        <DetectChar attribute="String" context="string&quot;" char="&quot;"/>
        <DetectChar attribute="String" context="string'" char="'"/>
        <DetectChar attribute="Operator" context="dollar" char="$"/>
        <Detect2Chars attribute="Special" context="#stay" char="\" char1="#"/>
        <Detect2Chars attribute="Special" context="#stay" char="\" char1="\"/>
        <AnyChar attribute="Operator" context="silent" String="@-" firstNonSpace="1"/>
        <RegExpr attribute="Comment" context="#stay" String="#.*$"/>
      </context>

      <context name="silent" attribute="Silent" lineEndContext="#pop">
        <LineContinue attribute="Operator" context="#stay"/>
        <DetectSpaces/>
        <DetectIdentifier/>
        <DetectChar attribute="String" context="string&quot;" char="&quot;"/>
        <DetectChar attribute="String" context="string'" char="'"/>
        <DetectChar attribute="Operator" context="dollar" char="$"/>
        <Detect2Chars attribute="Special" context="#stay" char="\" char1="#"/>
        <Detect2Chars attribute="Special" context="#stay" char="\" char1="\"/>
        <RegExpr attribute="Comment" context="#stay" String="#.*$"/>
      </context>

      <context name="string&quot;" attribute="String" lineEndContext="#pop">
        <LineContinue attribute="Operator" context="#stay"/>
        <DetectChar attribute="String" context="#pop" char="&quot;"/>
        <DetectChar attribute="Operator" context="dollar" char="$"/>
      </context>

      <context name="string'" attribute="String" lineEndContext="#pop">
        <LineContinue attribute="String" context="#stay"/>
        <DetectChar attribute="String" context="#pop" char="'"/>
        <DetectChar attribute="Operator" context="dollar" char="$"/>
      </context>

      <context name="assign" attribute="Operator" lineEndContext="#pop">
        <DetectChar attribute="Operator" context="value" char="="/>
      </context>

      <context name="value" attribute="String" lineEndContext="#pop#pop">
        <LineContinue attribute="Operator"/>
        <DetectChar attribute="Operator" context="dollar" char="$"/>
        <RegExpr attribute="Special" context="#pop#pop" String="@[-_\d\w]*@"/>
        <DetectChar attribute="Operator" char=";" context="#pop#pop"/>
      </context>

      <context name="dollar" attribute="Operator" lineEndContext="#pop">
        <DetectChar attribute="Operator" context="call(" char="("/>
        <DetectChar attribute="Operator" context="call{" char="{"/>
        <RegExpr attribute="Operator" context="#pop" String="."/>
      </context>

      <context name="call(" attribute="Variable" lineEndContext="#stay" fallthroughContext="callVar(" fallthrough="1">
        <keyword attribute="Keyword" context="callFunc(" String="functions"/>
      </context>

      <context name="call{" attribute="Variable" lineEndContext="#stay" fallthroughContext="callVar{" fallthrough="1">
        <keyword attribute="Keyword" context="callFunc{" String="functions"/>
      </context>

      <context name="callVar(" attribute="Variable" lineEndContext="#stay">
        <DetectChar attribute="Operator" char=")" context="#pop#pop#pop"/>
        <DetectChar attribute="Operator" context="dollar" char="$"/>
        <DetectSpaces attribute="Error" context="#stay"/>
        <AnyChar attribute="Error" context="#stay" String="=#:"/>
      </context>

      <context name="callVar{" attribute="Variable" lineEndContext="#stay">
        <DetectChar attribute="Operator" char="}" context="#pop#pop#pop"/>
        <DetectChar attribute="Operator" context="dollar" char="$"/>
        <DetectSpaces attribute="Error" context="#stay"/>
        <AnyChar attribute="Error" context="#stay" String="=#:"/>
      </context>

      <context name="callFunc(" attribute="FuncParam" lineEndContext="#stay">
        <DetectChar attribute="Operator" char=")" context="#pop#pop#pop"/>
        <DetectChar attribute="Operator" context="dollar" char="$"/>
        <DetectChar attribute="Keyword" context="#stay" char=","/>
        <DetectChar attribute="String" context="string'" char="'"/>
      </context>

      <context name="callFunc{" attribute="FuncParam" lineEndContext="#stay">
        <DetectChar attribute="Operator" char="}" context="#pop#pop#pop"/>
        <DetectChar attribute="Operator" context="dollar" char="$"/>
        <DetectChar attribute="Keyword" context="#stay" char=","/>
        <DetectChar attribute="String" context="string'" char="'"/>
      </context>

    </contexts>
    <itemDatas>
      <itemData name="Normal"    defStyleNum="dsNormal" spellChecking="0"/>
      <itemData name="Keyword"   defStyleNum="dsKeyword" spellChecking="0"/>
      <itemData name="Comment"   defStyleNum="dsComment"/>
      <itemData name="String"    defStyleNum="dsString" spellChecking="0"/>
      <itemData name="Variable"  defStyleNum="dsDataType" spellChecking="0"/>
      <itemData name="Target"    defStyleNum="dsDecVal" spellChecking="0"/>
      <itemData name="Section"   defStyleNum="dsOthers" spellChecking="0"/>
      <itemData name="Prereq"    defStyleNum="dsDataType" spellChecking="0"/>
      <itemData name="FuncParam" defStyleNum="dsString" spellChecking="0"/>
      <itemData name="Operator"  defStyleNum="dsChar" spellChecking="0"/>
      <itemData name="Silent"    defStyleNum="dsFunction" spellChecking="0"/>
      <itemData name="Special"   defStyleNum="dsFloat" spellChecking="0"/>
      <itemData name="Error"     defStyleNum="dsError" spellChecking="0"/>
    </itemDatas>
  </highlighting>
  <general>
    <comments>
      <comment name = "singleLine" start = "#"/>
    </comments>
    <!-- '-' is not a deliminator in function filter-out -->
    <keywords casesensitive="1" weakDeliminator = "-"/>
  </general>
</language>
<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->