Debian Codegraph @

data/syntax/bibtex.xml

raw
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE language
3 [
4 <!ENTITY stringVariable "[a-zA-Z0-9\-]+">
5 <!ENTITY fieldFormat "[a-zA-Z0-9\-_\.]+">
6 <!ENTITY latexCmd "\\([a-zA-Z@]+|[^ ])">
7 <!ENTITY refKeyFormat "[a-zA-Z0-9_@\\-\\:]+"> <!--taken from kile 2.0.3-->
8 ]>
9 <language name="BibTeX" version="5" kateversion="5.0" extensions="*.bib" section="Markup" mimetype="text/x-bib" casesensitive="1" author="Jeroen Wijnhout ([email protected])+Thomas Braun ([email protected])" license="LGPL">
10 <highlighting>
11 <list name="kw_entry">
12 <item>@article</item>
13 <item>@book</item>
14 <item>@booklet</item>
15 <item>@conference</item>
16 <item>@collection</item>
17 <item>@electronic</item>
18 <item>@inbook</item>
19 <item>@incollection</item>
20 <item>@inproceedings</item>
21 <item>@manual</item>
22 <item>@mastersthesis</item>
23 <item>@misc</item>
24 <item>@online</item>
25 <item>@patent</item>
26 <item>@periodical</item>
27 <item>@proceedings</item>
28 <item>@report</item>
29 <item>@phdthesis</item>
30 <item>@set</item>
31 <item>@thesis</item>
32 <item>@techreport</item>
33 <item>@unpublished</item>
34 <item>@www</item>
35 <item>@person</item> <!--all three from the directory package-->
36 <item>@company</item>
37 <item>@place</item>
38 </list>
39 <contexts>
40 <context name="Normal" attribute="Comment" lineEndContext="#stay">
41 <keyword String="kw_entry" attribute="Entry" context="Entry"/>
42 <StringDetect String="@string" attribute="Command" insensitive="true" context="StringCommand"/>
43 <StringDetect String="@preamble" attribute="Command" insensitive="true" context="PreambleCommand"/>
44 <StringDetect String="@comment" attribute="Comment" insensitive="true" context="#stay"/> <!--nothing special needed here-->
45 </context>
46
47 <context name="PreambleCommand" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop" lineEndContext="#stay" >
48 <DetectChar char="{" context="CurlyBracket" />
49 </context>
50
51 <context name="StringCommand" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop" lineEndContext="#stay" >
52 <DetectChar char="{" context="CurlyBracket" />
53 <RegExpr String="&stringVariable;" attribute="String" context="CurlyBracket"/>
54 </context>
55
56 <context name="Entry" attribute="Normal Text" lineEndContext="#stay">
57 <DetectChar char="{" context="#stay" beginRegion="block" />
58 <RegExpr String="&refKeyFormat;" attribute="Ref Key" context="#stay"/>
59 <DetectChar char="," context="Field"/>
60 <DetectChar char="}" attribute="Normal Text" context="#pop" endRegion="block" />
61 </context>
62
63 <context name="Field" attribute="Normal Text" lineEndContext="#stay">
64 <RegExpr String="&fieldFormat;" attribute="Field" firstNonSpace="true"/>
65 <DetectSpaces/>
66 <DetectChar char="=" context="#stay"/>
67 <DetectChar char="{" context="CurlyBracket"/>
68 <DetectChar char="}" context="#pop" lookAhead="true"/>
69 <DetectChar char="&quot;" attribute="Normal Text" context="QuotedText"/>
70 <AnyChar String=",#" context="#stay"/> <!-- # is the bibtex string concatenate character -->
71 <RegExpr String="[0-9]+" context="#stay"/>
72 <RegExpr String="&stringVariable;" attribute="String" /> <!-- assume this is a variable created with @String -->
73 <RegExpr String="." attribute="Error" context="#stay"/> <!--this rule catches all errors-->
74 </context>
75
76 <context name="CurlyBracket" attribute="Normal Text" lineEndContext="#stay">
77 <DetectChar char="{" context="CurlyBracket"/>
78 <RegExpr String="&latexCmd;" attribute="LatexCommand" context="#stay"/>
79 <LineContinue char="}" context="#pop#pop"/>
80 <DetectChar char="}" context="#pop"/>
81 </context>
82
83 <context name="QuotedText" attribute="String" lineEndContext="#stay">
84 <DetectChar char="&quot;" attribute="Normal Text" context="#pop"/>
85 <RegExpr String="&latexCmd;" attribute="LatexCommand" context="#stay"/>
86 </context>
87
88 </contexts>
89
90 <itemDatas>
91 <itemData name="Normal Text" defStyleNum="dsNormal"/>
92 <itemData name="Entry" defStyleNum="dsVariable" spellChecking="false"/>
93 <itemData name="Command" defStyleNum="dsFunction" spellChecking="false"/>
94 <itemData name="Field" defStyleNum="dsDataType" spellChecking="false"/>
95 <itemData name="Ref Key" defStyleNum="dsOthers" spellChecking="false"/>
96 <itemData name="LatexCommand" defStyleNum="dsChar" spellChecking="false"/>
97 <itemData name="Comment" defStyleNum="dsComment" spellChecking="false"/>
98 <itemData name="Error" defStyleNum="dsError" spellChecking="false"/>
99 <itemData name="String" defStyleNum="dsString" spellChecking="true"/>
100 </itemDatas>
101 </highlighting>
102 <general>
103 <keywords casesensitive="0" weakDeliminator="\" wordWrapDeliminator=",{}[]"/>
104 </general>
105 </language>