Can't get syntax highlighting to work
Parzival Herzog
parzp at shaw.ca
Fri Nov 7 08:21:44 GMT 2003
I am trying to get kate to syntax highlight for the unicon programmaing
language, but I get no highlighting, and no messages.
I took the python.xml file and editted it (see below), then placed it in
~/.kde/share/apps/katepart. Kate complained when there was a syntax error in
the file, which I fixed. But it did not recognize my <filename>.icn source
text and colour it. the Unicon syntax is in its list of possibilities, along
with the *.icn extension filter.
I tried it with and without a
mimetype="text/x-unicon"
specification - ther was no difference in the result.
What else needs to be done?
-- Parzival
<?xml version="1.02" encoding="UTF-8"?>
<!DOCTYPE language>
<!-- Unicon syntax highlightning v0.2 by Parzival Herzog -->
<language name="Unicon" version="0.2" kateversion="2.1" section="Scripts"
extensions="*.icn" mimetype="text/x-unicon" casesensitive="1">
<highlighting>
<list name="prep">
<item> global </item>
<item> initial </item>
<item> local </item>
<item> main </item>
<item> procedure </item>
<item> record </item>
<item> static </item>
</list>
<list name="statements">
<item> break </item>
<item> by </item>
<item> case </item>
<item> create </item>
<item> default </item>
<item> do </item>
<item> else </item>
<item> end </item>
<item> every </item>
<item> fail </item>
<item> goto </item>
<item> if </item>
<item> link </item>
<item> next </item>
<item> not </item>
<item> of </item>
<item> repeat </item>
<item> return </item>
<item> suspend </item>
<item> then </item>
<item> to </item>
<item> until </item>
<item> while </item>
</list>
<list name="builtinfuncs">
<item> XActive </item>
<item> XAttrib </item>
<item> XBg </item>
<item> XBind </item>
<item> XClearArea </item>
<item> XClip </item>
<item> XColor </item>
<item> XColorValue </item>
<item> XCopyArea </item>
<item> XDefault </item>
<item> XDrawArc </item>
<item> XDrawCurve </item>
<item> XDrawLine </item>
<item> XDrawRectangle </item>
<item> XDrawSegment </item>
<item> XDrawString </item>
<item> XEraseArea </item>
<item> XEvent </item>
<item> XFg </item>
<item> XFillArc </item>
<item> XFillPolygon </item>
<item> XFillRectangle </item>
<item> XFlush </item>
<item> XFont </item>
<item> XFreeColor </item>
<item> XGotoRC </item>
<item> XGotoXY </item>
<item> XLower </item>
<item> XNewColor </item>
<item> XPattern </item>
<item> XPending </item>
<item> XPixel </item>
<item> XQueryPointer </item>
<item> XRaise </item>
<item> XReadImage </item>
<item> XSync </item>
<item> XTextWidth </item>
<item> XUnbind </item>
<item> XWriteImage </item>
<item> XdrawPoint </item>
<item> asin </item>
<item> atan </item>
<item> bal </item>
<item> callout </item>
<item> center </item>
<item> char </item>
<item> chdir </item>
<item> collect </item>
<item> copy </item>
<item> cos </item>
<item> cset </item>
<item> delay </item>
<item> delete </item>
<item> detab </item>
<item> display </item>
<item> entab </item>
<item> errorclear </item>
<item> exit </item>
<item> exp </item>
<item> find </item>
<item> flush </item>
<item> function </item>
<item> get </item>
<item> getch </item>
<item> getche </item>
<item> getenve </item>
<item> iand </item>
<item> icom </item>
<item> image </item>
<item> insert </item>
<item> integer </item>
<item> ior </item>
<item> ishift </item>
<item> ixor </item>
<item> kbhit </item>
<item> key </item>
<item> left </item>
<item> list </item>
<item> log </item>
<item> many </item>
<item> map </item>
<item> match </item>
<item> member </item>
<item> mmout </item>
<item> mmpause </item>
<item> mmshow </item>
<item> move </item>
<item> name </item>
<item> numeric </item>
<item> open </item>
<item> ord </item>
<item> pop </item>
<item> pos </item>
<item> proc </item>
<item> pull </item>
<item> push </item>
<item> push </item>
<item> put </item>
<item> read </item>
<item> reads </item>
<item> real </item>
<item> remove </item>
<item> rename </item>
<item> repl </item>
<item> reverse </item>
<item> right </item>
<item> rtod </item>
<item> runerr </item>
<item> save </item>
<item> seek </item>
<item> seq </item>
<item> set </item>
<item> sin </item>
<item> sort </item>
<item> sortf </item>
<item> sqrt </item>
<item> stop </item>
<item> string </item>
<item> system </item>
<item> tab </item>
<item> table </item>
<item> tan </item>
<item> trim </item>
<item> type </item>
<item> variable </item>
<item> where </item>
<item> write </item>
<item> writes </item>
</list>
<list name="specialvars">
<item> & </item>
<item> &allocated </item>
<item> &ascii </item>
<item> &clock </item>
<item> &col </item>
<item> &collections </item>
<item> &control </item>
<item> &cset </item>
<item> ¤t </item>
<item> &date </item>
<item> &dateline </item>
<item> &digits </item>
<item> &e </item>
<item> &error </item>
<item> &errornumber </item>
<item> &errortext </item>
<item> &errorvalue </item>
<item> &errout </item>
<item> &fail </item>
<item> &features </item>
<item> &file </item>
<item> &host </item>
<item> &input </item>
<item> &interval </item>
<item> &lcase </item>
<item> &ldrag </item>
<item> &letters </item>
<item> &level </item>
<item> &line </item>
<item> &lpress </item>
<item> &lrelease </item>
<item> &main </item>
<item> &mdrag </item>
<item> &meta </item>
<item> &mpress </item>
<item> &mrelease </item>
<item> &null </item>
<item> &output </item>
<item> &phi </item>
<item> &pi </item>
<item> &pos </item>
<item> &progname </item>
<item> &random </item>
<item> &rdrag </item>
<item> ®ions </item>
<item> &resize </item>
<item> &row </item>
<item> &rpress </item>
<item> &rrelease </item>
<item> &shift </item>
<item> &source </item>
<item> &storage </item>
<item> &subject </item>
<item> &time </item>
<item> &trace </item>
<item> &ucase </item>
<item> &version </item>
<item> &window </item>
<item> &x </item>
<item> &y </item>
</list>
<contexts>
<context name="Normal" attribute="Normal Text" lineEndContext="#stay">
<keyword attribute="Preprocessor" String="prep" context="#stay"/>
<keyword attribute="Keyword" String="statements" context="#stay"/>
<keyword attribute="Builtin Function" String="builtinfuncs"
context="#stay"/>
<keyword attribute="Special Variable" String="specialvars"
context="#stay"/>
<RegExpr attribute="Normal" String="[a-zA-Z_][a-zA-Z_0-9]+"
context="#stay"/>
<RegExpr attribute="Long" String="[1-9][0-9]*([eE][0-9.]+)?[Ll]"
context="#stay"/>
<RegExpr attribute="Hex" String="[0-9a-fA-F]+[rR]0*16]" context="#stay"/>
<RegExpr attribute="Octal" String="[0-7]+[rR]0*8]" context="#stay"/>
<RegExpr attribute="Float"
String="([1-9][0-9]*)?\.[0-9]*([eE][1-9][0-9]*(\.[0-9]*)?)?"
context="#stay"/>
<RegExpr attribute="Int" String="[0-9]+" context="#stay"/>
<RegExpr attribute="Comment" String="#.*$" context="#stay"/>
<DetectChar attribute="String" char="'" context="Single A-string"/>
<DetectChar attribute="String" char=""" context="Single Q-string"/>
<RegExpr attribute="Operator"
String="[+*/\(\)%\|\[\]\{\}:=;\!<>!^&~-]" context="#stay"/>
</context>
<context name="Single A-string" attribute="String" lineEndContext="#stay">
<HlCStringChar attribute="String" context="#stay"/>
<DetectChar attribute="String" char="'" context="#pop"/>
</context>
<context name="Single Q-string" attribute="String" lineEndContext="#stay">
<HlCStringChar attribute="String" context="#stay"/>
<DetectChar attribute="String" char=""" context="#pop"/>
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal"/>
<itemData name="Operator" defStyleNum="dsChar"/>
<itemData name="Keyword" defStyleNum="dsKeyword"/>
<itemData name="Builtin Function" defStyleNum="dsDataType"/>
<itemData name="Special Variable" defStyleNum="dsOthers"/>
<itemData name="Preprocessor" defStyleNum="dsChar"/>
<itemData name="Float" defStyleNum="dsFloat"/>
<itemData name="Int" defStyleNum="dsDecVal"/>
<itemData name="Hex" defStyleNum="dsOthers"/>
<itemData name="Octal" defStyleNum="dsOthers"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="String" defStyleNum="dsString"/>
</itemDatas>
</highlighting>
<general>
<comments>
<comment name="singleLine" start="#" />
</comments>
<keywords casesensitive="1" />
</general>
</language>
___________________________________________________
This message is from the kde mailing list.
Account management: https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.
More information about the kde
mailing list