Seems to be working at a basic level. Currently provides:

- Auto indentation of text as you type (based on the [] structure)
- Highlighting (in various colors) of flow control statements, RoutineDef/RoutineCall, variable def and read statements, UI control identifiers.

The intent is to make it easier to see the structure of ZScripts. This is a new mode without much testing; if you have problems, email me a kenneth.m.mcdonald@gmail.com.

To install, put in the following text snippet at the end of the 'modes/catalog.xml' file in your jEdit installation. It should come immeditely BEFORE the </MODES> ending statement of the file:



<MODE NAME="zscript" FILE="zscript.xml"
FILE_NAME_GLOB="*.zsc"/>



Then, copy the following text into a new file called 'zscript.xml' in the 'modes' directory. After saving both files, the next time you restart jEdit, files ending with .zsc should be automatically edited in ZScript mode



<?xml version="1.0"?>
<!DOCTYPE MODE SYSTEM "xmode.dtd">
<MODE>
<PROPS>
<PROPERTY NAME="commentStart" VALUE="/*" />
<PROPERTY NAME="commentEnd" VALUE="*/" />
<PROPERTY NAME="lineComment" VALUE="//" />

<PROPERTY NAME="wordBreakChars" VALUE=",+-=&lt;&gt;/?^&amp;*" />

<!-- Auto indent -->
<PROPERTY NAME="indentOpenBrackets" VALUE="[" />
<PROPERTY NAME="indentCloseBrackets" VALUE="]" />
<PROPERTY NAME="indentNextLine"
VALUE="\s*(((if|while)\s*\(|else\s*|else\s+if\s*\( |for\s*\(.*\))[^{;]*)" />
<!-- set this to 'true' if you want to use GNU coding style -->
<PROPERTY NAME="doubleBracketIndent" VALUE="false" />
<PROPERTY NAME="lineUpClosingBracket" VALUE="false" />

</PROPS>

<RULES>
<SPAN TYPE="COMMENT1" AT_WHITESPACE_END="TRUE">
<BEGIN>/*</BEGIN>
<END>*/</END>
</SPAN>
<EOL_SPAN TYPE="COMMENT1">//</EOL_SPAN>
<SPAN TYPE="LITERAL1">
<BEGIN>"</BEGIN>
<END>"</END>
</SPAN>

<!-- <SPAN_REGEXP HASH_CHAR="[" AT_WORD_START="FALSE" EXCLUDE_MATCH="TRUE" TYPE="FUNCTION">
<BEGIN>\[[[:space:]]*RoutineDef[[:space:]]*\,[[:space:]]*</BEGIN>
<END>[[:space:]]*?\,</END>
</SPAN_REGEXP>
-->

<SEQ_REGEXP HASH_CHAR="a" AT_WORD_START="FALSE" TYPE="LITERAL2">Alpha\ |\w|\*</SEQ_REGEXP>
<SEQ_REGEXP HASH_CHAR="c" AT_WORD_START="FALSE" TYPE="LITERAL2">Color\ |\w|\*</SEQ_REGEXP>

<SEQ_REGEXP HASH_CHAR="d" AT_WORD_START="FALSE" TYPE="LITERAL2">(Document|Draw)\ |\w|\*</SEQ_REGEXP>
<SEQ_REGEXP HASH_CHAR="e" AT_WORD_START="FALSE" TYPE="LITERAL2">Edit\ |\w|\*</SEQ_REGEXP>
<SEQ_REGEXP HASH_CHAR="L" AT_WORD_START="FALSE" TYPE="LITERAL2">(Layer|Light)\ |\w|\*</SEQ_REGEXP>
<SEQ_REGEXP HASH_CHAR="m" AT_WORD_START="FALSE" TYPE="LITERAL2">(Marker|Material|Movie)\ |\w|\*</SEQ_REGEXP>
<SEQ_REGEXP HASH_CHAR="p" AT_WORD_START="FALSE" TYPE="LITERAL2">(Picker|Preferences)\ |\w|\*</SEQ_REGEXP>
<SEQ_REGEXP HASH_CHAR="r" AT_WORD_START="FALSE" TYPE="LITERAL2">Render\ |\w|\*</SEQ_REGEXP>
<SEQ_REGEXP HASH_CHAR="s" AT_WORD_START="FALSE" TYPE="LITERAL2">(Stencil|Stroke)\ |\w|\*</SEQ_REGEXP>
<SEQ_REGEXP HASH_CHAR="t" AT_WORD_START="FALSE" TYPE="LITERAL2">(Tool|Transform|Texture)\ |\w|\*</SEQ_REGEXP>
<SEQ_REGEXP HASH_CHAR="Z" AT_WORD_START="FALSE" TYPE="LITERAL2">(ZPlugin|ZScript|Zoom)\ |\w|\*</SEQ_REGEXP>


</RULES>
<RULES IGNORE_CASE="TRUE">
<KEYWORDS>
<KEYWORD4>If</KEYWORD4>
<KEYWORD4>assert</KEYWORD4>
<KEYWORD4>exit</KEYWORD4>
<KEYWORD4>delay</KEYWORD4>
<KEYWORD4>ifreeze</KEYWORD4>
<KEYWORD4>ireset</KEYWORD4>
<KEYWORD4>loop</KEYWORD4>
<KEYWORD4>loopcontinue</KEYWORD4>
<KEYWORD4>loopexit</KEYWORD4>
<LABEL>routinedef</LABEL>
<LABEL>routinecall</LABEL>
<COMMENT4>vardef</COMMENT4>
<COMMENT4>varset</COMMENT4>
<COMMENT4>vardec</COMMENT4>
<COMMENT4>var</COMMENT4>
</KEYWORDS>
</RULES>
</MODE>