[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

New syntax highlighting for Web 68/Algol 68



Dear Maintainers

I attach the file web68.xml which provides syntax highlighting for the Web 68 language which is the basis of the Web 68 System of Structured Documentation (a Literate Programming System based on Algol 68). The background of a line and the current line needs to be set to black for the highlighting to work best.

I have been unable to switch off bold face for the "Construct" itemData. I should like to know why that cannot be done. Apart from that, Web 68/Algol 68 is displayed in glorious technicolour.

Have fun

Regards

--
Sian Mountbatten
Specialisto pri Algol 68

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
	<!ENTITY identifier      "[a-z_][0-9a-z_ ]*">
	<!ENTITY indicant      "[A-Z_][0-9A-Z_]*">
]>
<language name="Web 68" section="Sources" extensions="*.w68;*.a68;*.w"
          version="1.0" kateversion="2.5.9" mimetype="text/plain"
	       casesensitive="true" license="GPL"
	       author="Sian Mountbatten (poenikatu&#64;fastmail.co.uk)">
  <highlighting>
    <list name="constructs">
      <item> AT </item>
      <item> BEGIN </item>
      <item> BY </item>
      <item> CASE </item>
      <item> CONTEXT </item>
      <item> DECS </item>
      <item> DO </item>
      <item> ELIF </item>
      <item> ELSE </item>
      <item> END </item>
      <item> ESAC </item>
      <item> FI </item>
      <item> FINISH </item>
      <item> FINISH </item>
      <item> FOR </item>
      <item> FROM </item>
      <item> IF </item>
      <item> IN </item>
      <item> KEEP </item>
      <item> MODE </item>
      <item> OD </item>
      <item> OP </item>
      <item> OUSE </item>
      <item> OUT </item>
      <item> PRIO </item>
      <item> PROGRAM </item>
      <item> THEN </item>
      <item> TO </item>
      <item> USE </item>
      <item> WHILE </item>
    </list>
    <list name="modes">
      <item> BITS </item>
      <item> BOOL </item>
      <item> CHANNEL </item>
      <item> CHAR </item>
      <item> COMPL </item>
      <item> FILE </item>
      <item> FLEX </item>
      <item> HEAP </item>
      <item> INT </item>
      <item> LOC </item>
      <item> LONG </item>
      <item> PROC </item>
      <item> REAL </item>
      <item> REF </item>
      <item> SHORT </item>
      <item> STRING </item>
      <item> STRUCT </item>
      <item> UNION </item>
      <item> VOID </item>
    </list>
    <list name="values">
      <item>  </item>
      <item> EMPTY </item>
      <item> FALSE </item>
      <item> NIL </item>
      <item> SKIP </item>
      <item> TRUE </item>
    </list>
    <list name="operators">
      <item> ABS </item>
      <item> AND </item>
      <item> ARG </item>
      <item> BIN </item>
      <item> CONJ </item>
		<item> DIV </item>
		<item> DIVAB </item>
		<item> DOWN </item>
      <item> ELEM </item>
      <item> ENTIER </item>
      <item> EQ </item>
      <item> GE </item>
      <item> GT </item>
		<item> I </item>
      <item> LE </item>
      <item> LENG </item>
      <item> LT </item>
		<item> LWB </item>
		<item> MAX </item>
		<item> MINUSAB </item>
		<item> MIN </item>
		<item> MODAB </item>
		<item> MOD </item>
		<item> NE </item>
      <item> NOT </item>
      <item> ODD </item>
      <item> OR </item>
		<item> OVERAB </item>
		<item> OVER </item>
		<item> PLUSAB </item>
		<item> PLUSTO </item>
      <item> REPR </item>
      <item> ROUND </item>
      <item> SHL </item>
      <item> SHORTEN </item>
      <item> SHR </item>
      <item> SIGN </item>
		<item> TIMESAB </item>
		<item> UPB </item>
		<item> UP </item>
    </list>
    <contexts>
		 <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
			 <DetectSpaces />
			 <DetectChar char="!" attribute="Punctuation" context="BangString" />
			 <DetectChar char="#" attribute="Cmmnt" context="Brief Cmmnt" />
			 <DetectChar char="&lt;" attribute="Punctuation" context="HTML tag" />
			 <Detect2Chars char="&#64;" char1="m" attribute="Web68Cmd" context="Macro" firstNonSpace="true" />
			 <Detect2Chars char="&#64;" char1="d" attribute="Web68Cmd" context="Macro" firstNonSpace="true" />
			 <Detect2Chars char="&#64;" char1="a" attribute="Web68Cmd" context="Algol 68" />
			 <StringDetect String="PROGRAM" attribute="Construct" context="Algol 68" />
			 <StringDetect String="DECS" attribute="Construct" context="Algol 68" />
			 <RegExpr String="^&#64;$" attribute="Web68Cmd" context="#stay" />
			 <RegExpr String="&#64;[ 123,/\\!]" attribute="Web68Cmd" context="#stay" />
			 <RegExpr String="&#64;[hi&lt;^.]" attribute="Web68Cmd" context="Web68String" />
		 </context>
		 <context name="Web68String" attribute="Cmmnt" lineEndContext="#stay" >
			 <StringDetect String="&#64;&gt;=" attribute="Web68Cmd" context="Algol 68" />
			 <StringDetect String="&#64;&gt;" attribute="Web68Cmd" context="#pop" />
		 </context>
		 <context name="BangString" attribute="String" lineEndContext="#stay">
			 <DetectSpaces />
			 <DetectChar char="!" attribute="Punctuation" context="#pop"/>
		 </context>
		 <context name="HTML tag" attribute="Cmmnt" lineEndContext="#pop">
			 <DetectChar char="&gt;" attribute="Punctuation" context="#pop"/>
		 </context>
		 <context name="Macro" attribute="Normal Text" lineEndContext="#pop">
			 <RegExpr String="&identifier;" attribute="Normal Text" context="Algol 68" />
			 <RegExpr String="&indicant;" attribute="Mode" context="Algol 68" />
		 </context>
		 <context name="Algol 68" attribute="Normal Text" lineEndContext="#stay">
			 <RangeDetect char="&quot;" char1="&quot;" attribute="String" context="#stay" />
			 <DetectChar char="#" attribute="Construct" context="Brief Cmmnt" beginRegion="comment" />
			 <DetectChar char="{" attribute="Construct" context="Brace Cmmnt" beginRegion="comment" />
			 <Detect2Chars char="&#64;" char1="m" attribute="Web68Cmd" context="Macro" />
			 <Detect2Chars char="&#64;" char1="d" attribute="Web68Cmd" context="Macro" />
			 <Detect2Chars char="&#64;" char1="a" attribute="Web68Cmd" context="#stay" />
			 <Detect2Chars char="|" char1=":" attribute="Construct" context="#stay" />
			 <Detect2Chars char=":" char1="=" attribute="Punctuation" context="#stay" />
			 <Detect2Chars char="&#64;" char1="&#64;" attribute="Construct" context="#stay" />
			 <Detect2Chars char="2" char1="r" attribute="BaseNum" context="Binary" />
			 <Detect2Chars char="4" char1="r" attribute="BaseNum" context="Quarternary" />
			 <Detect2Chars char="8" char1="r" attribute="BaseNum" context="Octal" />
			 <StringDetect String="16r" attribute="BaseNum" context="Hexadecimal" />
			 <WordDetect String="CO" attribute="Construct" context="Cmmnt1" beginRegion="comment" />
			 <WordDetect String="COMMENT" attribute="Construct" context="Cmmnt2" beginRegion="comment" />
			 <keyword String="constructs" attribute="Construct" context="#stay" />
			 <keyword String="modes" attribute="Mode" context="#stay" />
			 <keyword String="values" attribute="Integer" context="#stay" />
			 <keyword String="operators" attribute="Operator" context="#stay" />
			 <Int attribute="Integer" context="#stay" />
			 <Float attribute="Real" context="#stay" />
			 <RegExpr String="^&#64;$" attribute="Web68Cmd" context="Normal" />
			 <RegExpr String="&#64;[ 123]" attribute="Web68Cmd" context="Normal" />
			 <RegExpr String="&#64;[a,/\\!]" attribute="Web68Cmd" context="#stay" />
			 <RegExpr String="&#64;[h&lt;^.]" attribute="Web68Cmd" context="Web68String" />
			 <RegExpr String="&#64;[ 123]" attribute="Web68Cmd" context="Normal" />
			 <RegExpr String="[(|):&#59;,]+" attribute="Punctuation" context="#stay" />
			 <RegExpr String="[&lt;&gt;-+*/^%&amp;=]+" attribute="Operator" context="#stay" />
			 <RegExpr String="&identifier;" attribute="Normal Text" context="#stay" />
			 <RegExpr String="&indicant;" attribute="Mode" context="#stay" />
		 </context>
		 <context name="Brief Cmmnt" attribute="Cmmnt" lineEndContext="#stay">
			 <DetectChar char="#" attribute="Construct" context="#pop" endRegion="comment" />
		 </context>
		 <context name="Brace Cmmnt" attribute="Cmmnt" lineEndContext="#stay">
			 <DetectChar char="}" attribute="Construct" context="#pop" endRegion="comment" />
		 </context>
		 <context name="Cmmnt1" attribute="Cmmnt" lineEndContext="#stay">
			 <WordDetect String="CO" attribute="Construct" context="#pop" endRegion="comment" />
		 </context>
		 <context name="Cmmnt2" attribute="Cmmnt" lineEndContext="#stay">
			 <WordDetect String="COMMENT" attribute="Construct" context="#pop" endRegion="comment" />
		 </context>
		 <context name="Binary" attribute="BaseNum" lineEndContext="#stay">
			 <RegExpr String="[01 ]+" attribute="BaseNum" context="#pop" />
		 </context>
		 <context name="Quarternary" attribute="BaseNum" lineEndContext="#stay">
			 <RegExpr String="[0-3 ]+" attribute="BaseNum" context="#pop" />
		 </context>
		 <context name="Octal" attribute="BaseNum" lineEndContext="#stay">
			 <RegExpr String="[0-7 ]+" attribute="BaseNum" context="#pop" />
		 </context>
		 <context name="Hexadecimal" attribute="BaseNum" lineEndContext="#stay">
			 <RegExpr String="[0-9a-f ]+" attribute="BaseNum" context="#pop" />
		 </context>
    </contexts>
    <itemDatas>
      <itemData name="Alert"       defStyleNum="dsAlert" />
      <itemData name="BaseNum"     defStyleNum="dsBaseN"
		color="#FF0000" backgroundColor="#000000" selColor="#000000" selBackgroundColor="#FF0000"/>
      <itemData name="Cmmnt"     defStyleNum="dsNormal" italic="false"
		color="#FFA500" backgroundColor="#000000" selColor="#000000" selBackgroundColor="#FFA500"/>
      <itemData name="Construct"   defStyleNum="dsNormal" bold="false"
		color="#CD5555" backgroundColor="#000000" selColor="#000000" selBackgroundColor="#CD5555"/>
      <itemData name="Integer"     defStyleNum="dsDecVal"
		color="#FF0000" backgroundColor="#000000" selColor="#000000" selBackgroundColor="#FF0000"/>
      <itemData name="Mode"        defStyleNum="dsNormal"
		color="#00BFFF" backgroundColor="#000000" selColor="#000000" selBackgroundColor="#00BFFF"/>
      <itemData name="Normal Text" defStyleNum="dsNormal"
		color="#FFFFFF" backgroundColor="#000000" selColor="#000000" selBackgroundColor="#FFFFFF"/>
      <itemData name="Operator"    defStyleNum="dsOthers"
		color="#00CD66" backgroundColor="#000000" selColor="#000000" selBackgroundColor="#00CD66"/>
      <itemData name="Punctuation" defStyleNum="dsOthers"
		color="#3CB371" backgroundColor="#000000" selColor="#000000" selBackgroundColor="#3CB371"/>
      <itemData name="Real"        defStyleNum="dsFloat"
		color="#FF0000" backgroundColor="#000000" selColor="#000000" selBackgroundColor="#FF0000"/>
      <itemData name="String"      defStyleNum="dsString"
		color="#FFFF00" backgroundColor="#000000" selColor="#000000" selBackgroundColor="#FFFF00"/>
      <itemData name="Web68Cmd"    defStyleNum="dsNormal"
		color="#98FB98" backgroundColor="#000000" selColor="#000000" selBackgroundColor="#98FB98"/>
    </itemDatas>
  </highlighting>
  <general>
    <comments>
      <comment name="multiLine" start="COMMENT" end="COMMENT" />
    </comments>
    <keywords casesensitive="true" />
  </general>
</language>

Reply to: