Re: Highlighting in the 3.1 release

Roland Pabel <[email protected]> Wed, 14 Aug 2002 01:01:48 +0200
Newsgroups gmane.comp.kde.devel.kate
Message-ID <[email protected]>
On Wednesday 14 August 2002 00:35, you wrote:
> Hi Roland
>
> Highlighting files, which still need fixing
[...]
> Roland, could you have a look at the files from
> bash to java?  I'll look at kbasic to pascal. I hope someone else will have
> a look at the rest
Ok, I've checkout'd CVS and did the bash file, which is attached. I could do 
some more files, if someone else would do intensive testing :-) I've never 
done any fortran or java programming anyway...

> Please increment the version numbers by 0.01 for each updated file and if
How important exactly is the kateversion="..." keyword in the <language> tag? 
(I guess version=".." is for programmers). I forgot about these in my 
scheme.xml and could resend it, if it matters....

> possible compare the results of the unported with the ported version.
As I wrote above, could all others on this list please do the testing?!
Esp. a casual bash programmer or the creator of the bash.xml file could answer 
these :
- The contexts "String" and "Parameter" are unused, they won't be entered. 
 bash strings are handled by a RangeDetect, but multilinestring don't work.
- According to the bash man page, the "\#" is "the command number of this 
command". Is this really what was intended to be highlighted ? : 
<Detect2Chars attribute="Normal Text" context="Parameter" char = "\" char1 = 
"#"/>
(I guess this should recognize multiline commands/strings, but it does not 
here...)

I can fix this, any objections?
Roland
-- 
ICQ UIN 49339118			Linux Counter #88774
GPG-Key 1024D/C969F3F2 2001-02-28 Roland Pabel <[email protected]>
fingerprint = C8A7 BF6A 12FE CE55 724D  667B 4060 B228 C969 F3F2
bash.xml (text/xml, 4.3 KB)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="Bash" version="1.02" kateversion="2.0" section="Scripts" extensions="" mimetype="text/x-shellscript">
        <highlighting>
                <list name = "keywords">
                        <item> break </item>
                        <item> case </item>
                        <item> done </item>
                        <item> do </item>
                        <item> elif </item>
                        <item> else </item>
                        <item> esac </item>
                        <item> exit </item>
                        <item> export </item>
                        <item> fi </item>
                        <item> for </item>
                        <item> function </item>
                        <item> if </item>
                        <item> in </item>
                        <item> return </item>
                        <item> select </item>
                        <item> then </item>
                        <item> until </item>
                        <item> while </item>
                        <item> . </item>
                </list>
                <list name = "commands">
                        <item> cp </item>
                        <item> date </item>
                        <item> echo </item>
                        <item> eval </item>
                </list>
                <contexts>
                        <context name = "Base" attribute = "Normal Text" lineEndContext = "#stay">
                                <keyword String = "keywords" attribute = "Keyword" context = "#stay"/>
                                <keyword String = "commands" attribute = "Command" context = "#stay"/>
                                <Int attribute = "Decimal" context = "#stay"/>
                                <RegExpr String = "\$[A-Za-z0-9_?{}!]+" attribute = "Parameter" context = "#stay"/>
                                <RangeDetect char = "&quot;" char1 = "&quot;" attribute = "String" context = "#stay"/>
                                <AnyChar String = "|&lt;&gt;=;" attribute = "Operator" context = "#stay"/>
                                <DetectChar char="`" attribute = "Substitution" context = "Substitution"/>
                                <Detect2Chars attribute = "Normal Text" context = "#stay" char = "\" char1 = "#"/>
                                <RegExpr String= "#.*$" attribute = "Comment" context="#stay"/>
                        </context>
                        <context name = "String" attribute = "String" lineEndContext="#stay">
                                <DetectChar char = "&quot;" attribute = "String" context = "#pop"/>
                        </context>
                        <context name = "Substitution" attribute = "Substitution" lineEndContext="#stay">
                                <DetectChar char = "`" attribute = "Substitution" context = "#pop"/>
                        </context>
                        <context name = "Parameter" attribute = "Parameter" lineEndContext="#stay">
                                <RegExpr String = "\$[A-Za-z0-9_?]+" attribute = "Parameter" context="#pop"/>
                        </context>
                </contexts>
                <itemDatas>
                        <itemData name = "Normal Text" defStyleNum = "dsNormal"/>
                        <itemData name = "Keyword" defStyleNum = "dsKeyword"/>
                        <itemData name = "Decimal" defStyleNum = "dsDecVal"/>
                        <itemData name = "Float" defStyleNum = "dsFloat"/>
                        <itemData name = "Char" defStyleNum = "dsChar"/>
                        <itemData name = "String" defStyleNum = "dsString"/>
                        <itemData name = "Comment" defStyleNum = "dsComment"/>
                        <itemData name = "Substitution" defStyleNum = "dsOthers"/>
                        <itemData name = "Parameter" defStyleNum = "dsOthers"/>
                        <itemData name = "Operator" defStyleNum = "dsOthers"/>
                        <itemData name = "Command" defStyleNum = "dsNormal"/>
                </itemDatas>
        </highlighting>
        <general>
                <comments>
                        <comment name="singleLine" start="#"/>
                </comments>
                <keywords casesensitive="1"/>
        </general>
</language>