[prev in list] [next in list] [prev in thread] [next in thread]
List: kwrite-devel
Subject: [PATCH] Literate haskell syntax highlighting bug fixes
From: Bjorn Buckwalter <bjorn.buckwalter () gmail ! com>
Date: 2009-03-14 20:22:08
Message-ID: 8b2a1a960903141322q1ccb4b7dn1dc40eda584bf0a3 () mail ! gmail ! com
[Download RAW message or body]
Hi,
Please find attached (also pasted below) a patch for the literate
haskell syntax highlighting file
(trunk/KDE/kdelibs/kate/syntax/literate-haskell.xml).
The change on line 330 prevents the context stack from growing
indefinitely with interleaved "literate-normal" and "normal" contexts.
The change on line 346 pops twice at the end of an
"comment_single_line" in order to return to the "literate-normal"
context (rather than the "normal" context). Without this fix the next
line starts in "normal" context which causes the bird-track to not to
be "special" in code like:
> -- My single line comment
> f = undefined
Please excuse the cross-posting, it was unclear which mailing list was
appropriate.
Thanks,
Bjorn Buckwalter
Index: literate-haskell.xml
===================================================================
--- literate-haskell.xml (revision 939391)
+++ literate-haskell.xml (working copy)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
-<language name="Literate Haskell" version="1.04" kateversion="2.4"
section="Sources" extensions="*.lhs" author="Marcel Martin
(mmar@freenet.de)" license="">
+<language name="Literate Haskell" version="1.05" kateversion="2.4"
section="Sources" extensions="*.lhs" author="Marcel Martin
(mmar@freenet.de)" license="">
<highlighting>
<list name="keywords">
<item> case </item>
@@ -327,7 +327,7 @@
<context attribute="Comment" lineEndContext="#stay"
name="literate-normal">
<DetectChar attribute="Special"
context="normal" char=">" column="0"/>
</context>
- <context attribute="Normal Text"
lineEndContext="literate-normal" name="normal">
+ <context attribute="Normal Text" lineEndContext="#pop"
name="normal">
<Detect2Chars attribute="Comment"
context="comment_multi_line" char="{" char1="-" />
<Detect2Chars attribute="Comment"
context="comment_single_line" char="-" char1="-" />
<keyword attribute="Keyword" context="#stay"
String="keywords" />
@@ -343,7 +343,7 @@
<Float attribute="Float" context="#stay" />
<Int attribute="Decimal" context="#stay" />
</context>
- <context attribute="Comment" lineEndContext="#pop"
name="comment_single_line" />
+ <context attribute="Comment" lineEndContext="#pop#pop"
name="comment_single_line" />
<context attribute="Comment" lineEndContext="#stay"
name="comment_multi_line">
<Detect2Chars attribute="Comment"
context="#pop" char="-" char1="}" />
</context>
["lithaskpatch.diff" (application/octet-stream)]
Index: literate-haskell.xml
===================================================================
--- literate-haskell.xml (revision 939391)
+++ literate-haskell.xml (working copy)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
-<language name="Literate Haskell" version="1.04" kateversion="2.4" section="Sources" \
extensions="*.lhs" author="Marcel Martin (mmar@freenet.de)" license=""> +<language \
name="Literate Haskell" version="1.05" kateversion="2.4" section="Sources" \
extensions="*.lhs" author="Marcel Martin (mmar@freenet.de)" license=""> \
<highlighting> <list name="keywords">
<item> case </item>
@@ -327,7 +327,7 @@
<context attribute="Comment" lineEndContext="#stay" name="literate-normal">
<DetectChar attribute="Special" context="normal" char=">" column="0"/>
</context>
- <context attribute="Normal Text" lineEndContext="literate-normal" name="normal">
+ <context attribute="Normal Text" lineEndContext="#pop" name="normal">
<Detect2Chars attribute="Comment" context="comment_multi_line" char="{" char1="-" \
/> <Detect2Chars attribute="Comment" context="comment_single_line" char="-" \
char1="-" /> <keyword attribute="Keyword" context="#stay" String="keywords" />
@@ -343,7 +343,7 @@
<Float attribute="Float" context="#stay" />
<Int attribute="Decimal" context="#stay" />
</context>
- <context attribute="Comment" lineEndContext="#pop" name="comment_single_line" />
+ <context attribute="Comment" lineEndContext="#pop#pop" name="comment_single_line" \
/> <context attribute="Comment" lineEndContext="#stay" name="comment_multi_line">
<Detect2Chars attribute="Comment" context="#pop" char="-" char1="}" />
</context>
_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic