diff options
Diffstat (limited to 'kate/data/bibtex.xml')
-rw-r--r-- | kate/data/bibtex.xml | 96 |
1 files changed, 64 insertions, 32 deletions
diff --git a/kate/data/bibtex.xml b/kate/data/bibtex.xml index 5ee9436b8..e167c270e 100644 --- a/kate/data/bibtex.xml +++ b/kate/data/bibtex.xml @@ -1,6 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE language SYSTEM "language.dtd"> -<language name="BibTeX" version="1.15" kateversion="2.0" extensions="*.bib" section="Markup" mimetype="text/x-bib" casesensitive="1" author="Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)+Thomas Braun (braun@physik.fu-berlin.de)" license="LGPL"> +<!DOCTYPE language SYSTEM "language.dtd" + [ + <!ENTITY stringVariable "[a-zA-Z0-9\-]+"> + <!ENTITY fieldFormat "[a-zA-Z0-9\-_\.]+"> + <!ENTITY latexCmd "\\([a-zA-Z@]+|[^ ])"> + <!ENTITY refKeyFormat "[a-zA-Z0-9_@\\-\\:]+"> <!--taken from kile 2.0.3--> + ]> +<language name="BibTeX" version="1.17" kateversion="2.3" extensions="*.bib" section="Markup" mimetype="text/x-bib" casesensitive="1" author="Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)+Thomas Braun (thomas.braun@virtuell-zuhause.de)" license="LGPL"> <highlighting> <list name="kw_entry"> <item>@article</item> @@ -26,49 +32,75 @@ <item>@techreport</item> <item>@unpublished</item> <item>@www</item> - </list> - <list name="kw_command"> - <item>@string</item> - <item>@preamble</item> - <item>@comment</item> + <item>@person</item> <!--all three from the directory package--> + <item>@company</item> + <item>@place</item> </list> <contexts> - <context name="Normal" attribute="Normal Text" lineEndContext="#stay"> - <RegExpr String="([a-zA-Z0-9]+)" attribute="Field" context="Field" firstNonSpace="true"/> + <context name="Normal" attribute="Comment" lineEndContext="#stay"> <keyword String="kw_entry" attribute="Entry" context="Entry"/> - <keyword String="kw_command" attribute="Command" context="#stay"/> - <DetectChar char="{" attribute="Normal Text" context="#stay" beginRegion="block" /> - <DetectChar char="}" attribute="Normal Text" context="#stay" endRegion="block" /> - <RegExpr String="\\([a-zA-Z]+|.)" attribute="Char" context="#stay"/> - <DetectChar char=""" attribute="String" context="String"/> + <StringDetect String="@string" attribute="Command" insensitive="true" context="StringCommand"/> + <StringDetect String="@preamble" attribute="Command" insensitive="true" context="PreambleCommand"/> + <StringDetect String="@comment" attribute="Comment" insensitive="true" context="#stay"/> <!--nothing special needed here--> + </context> + + <context name="PreambleCommand" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop" lineEndContext="#stay" > + <DetectChar char="{" context="CurlyBracket" /> + </context> + + <context name="StringCommand" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop" lineEndContext="#stay" > + <DetectChar char="{" context="CurlyBracket" /> + <RegExpr String="&stringVariable;" attribute="String" context="CurlyBracket"/> + </context> + + <context name="Entry" attribute="Normal Text" lineEndContext="#stay"> + <DetectChar char="{" context="#stay" beginRegion="block" /> + <RegExpr String="&refKeyFormat;" attribute="Ref Key" context="#stay"/> + <DetectChar char="," context="Field"/> + <DetectChar char="}" attribute="Normal Text" context="#pop" endRegion="block" /> </context> - <context name="Entry" attribute="Ref Key" lineEndContext="#stay"> - <DetectChar char="," attribute="Normal Text" context="#pop"/> - <DetectChar char="{" attribute="Normal Text" context="#stay" beginRegion="block" /> - <DetectChar char="}" attribute="Normal Text" context="#stay" endRegion="block" /> - <RegExpr String="\\([a-zA-Z]+|.)" attribute="Char" context="#stay"/> - <DetectChar char=""" attribute="String" context="#pop"/> + <context name="Field" attribute="Normal Text" lineEndContext="#stay"> + <RegExpr String="&fieldFormat;" attribute="Field" firstNonSpace="true"/> + <DetectSpaces/> + <DetectChar char="=" context="#stay"/> + <DetectSpaces/> + <DetectChar char="{" context="CurlyBracket"/> + <DetectChar char="}" context="#pop" lookAhead="true"/> + <DetectChar char=""" attribute="Normal Text" context="QuotedText"/> + <DetectChar char="," context="#stay"/> + <DetectChar char="#" context="#stay"/> <!-- the bibtex string concatenate character --> + <RegExpr String="[0-9]+" context="#stay"/> + <RegExpr String="&stringVariable;" attribute="String" /> <!-- assume this is a variable created with @String --> + <DetectSpaces/> + <RegExpr String="." attribute="Error" context="#stay"/> <!--this rule catches all errors--> </context> - <context name="Field" attribute="Field" lineEndContext="#pop"> - <DetectChar char="=" attribute="Normal Text" context="#pop"/> + <context name="CurlyBracket" attribute="Normal Text" lineEndContext="#stay"> + <DetectChar char="{" context="CurlyBracket"/> + <RegExpr String="&latexCmd;" attribute="LatexCommand" context="#stay"/> + <RegExpr String="}$" context="#pop#pop"/> + <DetectChar char="}" context="#pop"/> </context> - <context name="String" attribute="String" lineEndContext="#stay"> - <RegExpr String="\\([a-zA-Z]+|.)" attribute="Char" context="#stay"/> - <DetectChar char=""" attribute="String" context="#pop"/> + <context name="QuotedText" attribute="String" lineEndContext="#stay"> + <DetectChar char=""" attribute="Normal Text" context="#pop"/> + <RegExpr String="&latexCmd;" attribute="LatexCommand" context="#stay"/> </context> + </contexts> + <itemDatas> <itemData name="Normal Text" defStyleNum="dsNormal"/> - <itemData name="Entry" defStyleNum="dsKeyword" color="#0000ff"/> - <itemData name="Command" defStyleNum="dsFunction"/> - <itemData name="Field" defStyleNum="dsDataType"/> - <itemData name="Ref Key" defStyleNum="dsOthers"/> - <itemData name="String" defStyleNum="dsString"/> - <itemData name="Char" defStyleNum="dsChar"/> - </itemDatas> + <itemData name="Entry" defStyleNum="dsKeyword" color="#0000ff" spellChecking="false"/> + <itemData name="Command" defStyleNum="dsFunction" spellChecking="false"/> + <itemData name="Field" defStyleNum="dsDataType" spellChecking="false"/> + <itemData name="Ref Key" defStyleNum="dsOthers" spellChecking="false"/> + <itemData name="LatexCommand" defStyleNum="dsChar" spellChecking="false"/> + <itemData name="Comment" defStyleNum="dsComment" spellChecking="false"/> + <itemData name="Error" defStyleNum="dsAlert" spellChecking="false"/> + <itemData name="String" defStyleNum="dsString" spellChecking="true"/> +</itemDatas> </highlighting> <general> <keywords casesensitive="0" weakDeliminator="\" wordWrapDeliminator=",{}[]"/> |