<Comment>% ConTeXt test file for Kate's syntax highlighting and code folding</Comment><br/>
<Normal Text></Normal Text><br/>
<Normal Text></Normal Text><br/>
<Comment>%% Comments</Comment><br/>
<Comment>%   This is a comment</Comment><br/>
<Macro>\%</Macro><Normal Text>  Not a comment</Normal Text><br/>
<Macro>\\</Macro><Comment>% This is a comment</Comment><br/>
<Normal Text></Normal Text><br/>
<Comment>% Titles should be bold</Comment><br/>
<Section>\subject</Section><Brace>{</Brace><Normal Text>Subject</Normal Text><Brace>}</Brace><br/>
<Section>\subsubject</Section><Brace>{</Brace><Normal Text>Sub-subject</Normal Text><Brace>}</Brace><br/>
<Section>\subsubsubject</Section><Brace>{</Brace><Normal Text>Sub-sub-subject</Normal Text><Brace>}</Brace><br/>
<Section>\subsubsubsubject</Section><Brace>{</Brace><Normal Text>Sub-sub-sub-subject</Normal Text><Brace>}</Brace><br/>
<Section>\subsubsubsubsubject</Section><Brace>{</Brace><Normal Text>Sub-sub-sub-sub-subject</Normal Text><Brace>}</Brace><br/>
<Section>\section</Section><Brace>{</Brace><Normal Text>Section</Normal Text><Brace>}</Brace><br/>
<Section>\subsection</Section><Brace>{</Brace><Normal Text>Sub-section</Normal Text><Brace>}</Brace><br/>
<Section>\subsubsection</Section><Brace>{</Brace><Normal Text>Sub-sub-section</Normal Text><Brace>}</Brace><br/>
<Section>\subsubsubsection</Section><Brace>{</Brace><Normal Text>Sub-sub-sub-section</Normal Text><Brace>}</Brace><br/>
<Section>\subsubsubsubsection</Section><Brace>{</Brace><Normal Text>Sub-sub-sub-sub-section</Normal Text><Brace>}</Brace><br/>
<Normal Text></Normal Text><br/>
<Comment>%% Start/stop blocks</Comment><br/>
<Block>\startsection</Block><br/>
<Normal Text>Can be nested</Normal Text><br/>
<Block>\startitemize</Block><br/>
<Macro>\item</Macro><Normal Text> normal</Normal Text><br/>
<Block>\stopitemize</Block><br/>
<Normal Text>normal</Normal Text><br/>
<Block>\stopsection</Block><br/>
<Comment>% \startblock \stopblock should be comments</Comment><br/>
<Normal Text></Normal Text><br/>
<Normal Text></Normal Text><br/>
<Comment>%% Commands</Comment><br/>
<Macro>\def</Macro><Block>\startstuff</Block><Brace>{</Brace><Normal Text>Custom environment start</Normal Text><Brace>}</Brace><br/>
<Macro>\def</Macro><Block>\stopstuff</Block><Brace>{</Brace><Normal Text>Custom environment stop</Normal Text><Brace>}</Brace><br/>
<Block>\startstuff</Block><Normal Text> should not be normal command colour (it is an error to miss </Normal Text><Block>\stopstuff</Block><Normal Text>)</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Macro>\def\sayHello</Macro><Brace>{</Brace><Normal Text>Héllò Wø®łÐ</Normal Text><Brace>}</Brace><br/>
<Comment>% This prints Héllò Wø®łÐ@@@ , If it were \sayHelloAAA it would be</Comment><br/>
<Comment>% an error, so the @ is not in the macro</Comment><br/>
<Macro>\sayHello</Macro><Normal Text>@@@</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Macro>\def\testUnderscores</Macro><Brace>{</Brace><Normal Text>Text_With_Underscores</Normal Text><Brace>}</Brace><br/>
<Comment>% This prints Text_With_Underscores_ note the final underscore and no error</Comment><br/>
<Macro>\testUnderscores</Macro><Normal Text>_</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Macro>\def\€</Macro><Brace>{</Brace><Normal Text>Macro with sign</Normal Text><Brace>}</Brace><br/>
<Comment>% This is a single macro</Comment><br/>
<Macro>\€</Macro><Normal Text> </Normal Text><Comment>% This prints Macro with sign</Comment><br/>
<Macro>\€</Macro><Normal Text>A </Normal Text><Comment>% This prints Macro with signA   (not an error)</Comment><br/>
<Normal Text></Normal Text><br/>
<Macro>\setupindenting</Macro><Normal Text>[yes, big]</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Normal Text></Normal Text><br/>
<Comment>%% Inline math</Comment><br/>
<Block>$</Block><Math>equations are green, </Math><Macro>\commands</Macro><Math> somewhat darker</Math><br/>
<Math>it can also run over multiple lines</Math><br/>
<Comment>% Comment</Comment><br/>
<Block>$</Block><br/>
<Normal Text>normal</Normal Text><br/>
<Block>\mathematics</Block><Brace>{</Brace><Math>equations are green, </Math><Macro>\commands</Macro><Math> somewhat darker</Math><br/>
<Math>it can also run over multiple lines</Math><br/>
<Macro>\mathematics</Macro><Brace>{</Brace><Math>nested math should be green</Math><Brace>}</Brace><Math> this should still be green</Math><br/>
<Comment>% Comment</Comment><br/>
<Brace>}</Brace><br/>
<Normal Text>normal</Normal Text><br/>
<Block>\math</Block><Brace>{</Brace><Math>equations are green, </Math><Macro>\commands</Macro><Math> somewhat darker</Math><br/>
<Math>it can also run over multiple lines</Math><br/>
<Macro>\math</Macro><Brace>{</Brace><Math>nested math should be green</Math><Brace>}</Brace><Math> this should still be green</Math><br/>
<Comment>% Comment</Comment><br/>
<Brace>}</Brace><br/>
<Normal Text>normal</Normal Text><br/>
<Block>\m</Block><Brace>{</Brace><Math>equations are green, </Math><Macro>\commands</Macro><Math> somewhat darker</Math><br/>
<Math>it can also run over multiple lines</Math><br/>
<Macro>\m</Macro><Brace>{</Brace><Math>nested math should be green</Math><Brace>}</Brace><Math> this should still be green</Math><br/>
<Comment>% Comment</Comment><br/>
<Brace>}</Brace><br/>
<Normal Text>normal</Normal Text><br/>
<Block>\mathematics</Block><Math> t</Math><Normal Text>he first character should be green </Normal Text><Brace>{}</Brace><br/>
<Block>\math</Block><Math>        t</Math><Normal Text>he first character should be green </Normal Text><Brace>{}</Brace><br/>
<Block>\m</Block><Math>           t</Math><Normal Text>he first character should be green </Normal Text><Brace>{}</Brace><br/>
<Block>\formula</Block><Math>     t</Math><Normal Text>he first character should be green </Normal Text><Brace>{}</Brace><br/>
<Normal Text>normal</Normal Text><br/>
<Comment>% $should$ \mathematics{still} \math{be} \m{commented}</Comment><br/>
<Normal Text></Normal Text><br/>
<Comment>% The underscore after sum should be blue, not macro color</Comment><br/>
<Normal Text>Math macro with underscores </Normal Text><Block>\m</Block><Math> </Math><Brace>{</Brace><Math> v = </Math><Macro>\sum</Macro><Brace>_</Brace><Math>0</Math><Brace>^</Brace><Math>1</Math><Brace>{</Brace><Math> </Math><Macro>\sqrt</Macro><Brace>{</Brace><Math>2</Math><Brace>}</Brace><Math> </Math><Brace>}</Brace><Math>! </Math><Brace>}</Brace><br/>
<Normal Text></Normal Text><br/>
<Comment>%% Display math</Comment><br/>
<Block>$$</Block><br/>
<Math>equations are green, </Math><Macro>\commands</Macro><Math> somewhat darker</Math><br/>
<Math>it can also run over multiple lines</Math><br/>
<Comment>% Comment</Comment><br/>
<Block>$$</Block><br/>
<Normal Text>normal</Normal Text><br/>
<Block>\startformula</Block><br/>
<Math>equations are green, </Math><Macro>\commands</Macro><Math> somewhat darker</Math><br/>
<Math>it can also run over multiple lines</Math><br/>
<Comment>% Comment</Comment><br/>
<Math></Math><br/>
<Math>Nested formulae should not work</Math><br/>
<Math>The following should be red:</Math><br/>
<Error>\startformula</Error><br/>
<Math>Should still be math colour</Math><br/>
<Block>\stopformula</Block><br/>
<Normal Text>normal</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Comment>% This is a regular macro, not math macro</Comment><br/>
<Macro>\def\mathematicsMacroShouldNotMatchThis</Macro><Brace>{</Brace><Normal Text>Not Math</Normal Text><Brace>}</Brace><br/>
<Normal Text></Normal Text><br/>
<Comment>%% Verbatim</Comment><br/>
<Block>\starttyping</Block><br/>
<Verbatim>All text in here should be verbatim colour</Verbatim><br/>
<Verbatim>% This should not be a comment</Verbatim><br/>
<Verbatim>&@@#^%&^#$</Verbatim><br/>
<Verbatim></Verbatim><br/>
<Verbatim>Nested typing should be displayed in verbatim colour</Verbatim><br/>
<Verbatim>\starttyping</Verbatim><br/>
<Verbatim>\stoptyping</Verbatim><br/>
<Verbatim>should still be verbatim colour</Verbatim><br/>
<Verbatim>% This should not be a comment</Verbatim><br/>
<Block>\stoptyping</Block><br/>
<Normal Text></Normal Text><br/>
<Normal Text>normal</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Normal Text></Normal Text><br/>
<Comment>%% Tables</Comment><br/>
<Block>\starttabulate</Block><Normal Text>[|c|c|c|]</Normal Text><br/>
<Macro>\FL</Macro><br/>
<Macro>\NC</Macro><Normal Text> header1 </Normal Text><Macro>\NC</Macro><Normal Text> header2 </Normal Text><Macro>\NC</Macro><Normal Text> header3 </Normal Text><Macro>\NR</Macro><br/>
<Macro>\ML</Macro><br/>
<Macro>\NC</Macro><Normal Text> value1 </Normal Text><Macro>\NC</Macro><Normal Text> value2 </Normal Text><Macro>\NC</Macro><Normal Text> value3 </Normal Text><Macro>\NR</Macro><br/>
<Macro>\NC</Macro><Normal Text> value4 </Normal Text><Macro>\NC</Macro><Normal Text> value5 </Normal Text><Macro>\NC</Macro><Normal Text> value6 </Normal Text><Macro>\NR</Macro><br/>
<Macro>\BL</Macro><br/>
<Block>\stoptabulate</Block><br/>
<Normal Text></Normal Text><br/>
<Normal Text>Commands for TABLE environment (</Normal Text><Block>\bTABLE</Block><Normal Text> and </Normal Text><Block>\eTABLE</Block><Normal Text>, </Normal Text><Block>\bTD</Block><Normal Text> and </Normal Text><Block>\eTD</Block><Normal Text>, etc.) should emulate start/stop blocks</Normal Text><br/>
<Block>\bTABLE</Block><Normal Text>[split=yes]</Normal Text><br/>
<Normal Text>  </Normal Text><Block>\bTR</Block><Normal Text> </Normal Text><Block>\bTD</Block><Normal Text> value1 </Normal Text><Block>\eTD</Block><Normal Text> </Normal Text><Block>\bTD</Block><Normal Text> value2 </Normal Text><Block>\eTD</Block><Normal Text> </Normal Text><Block>\bTD</Block><Normal Text> value3 </Normal Text><Block>\eTD</Block><Normal Text> </Normal Text><Block>\eTR</Block><br/>
<Normal Text>  </Normal Text><Block>\bTR</Block><Normal Text> </Normal Text><Block>\bTD</Block><Normal Text> value4 </Normal Text><Block>\eTD</Block><Normal Text> </Normal Text><Block>\bTD</Block><Normal Text> value5 </Normal Text><Block>\eTD</Block><Normal Text> </Normal Text><Block>\bTD</Block><Normal Text> value6 </Normal Text><Block>\eTD</Block><Normal Text> </Normal Text><Block>\eTR</Block><br/>
<Block>\eTABLE</Block><br/>
<Normal Text></Normal Text><br/>
<Block>\startxtable</Block><br/>
<Normal Text>  </Normal Text><Block>\startxrow</Block><br/>
<Normal Text>    </Normal Text><Block>\startxcell</Block><Normal Text> value1 </Normal Text><Block>\stopxcell</Block><br/>
<Normal Text>    </Normal Text><Block>\startxcell</Block><Normal Text> value2 </Normal Text><Block>\stopxcell</Block><br/>
<Normal Text>  </Normal Text><Block>\stopxrow</Block><br/>
<Normal Text>  </Normal Text><Block>\startxrow</Block><br/>
<Normal Text>    </Normal Text><Block>\startxcell</Block><Normal Text> value3 </Normal Text><Block>\stopxcell</Block><br/>
<Normal Text>    </Normal Text><Block>\startxcell</Block><Normal Text> value5 </Normal Text><Block>\stopxcell</Block><br/>
<Normal Text>  </Normal Text><Block>\stopxrow</Block><br/>
<Block>\stopxtable</Block><br/>
<Normal Text></Normal Text><br/>
<Normal Text></Normal Text><br/>
<Normal Text></Normal Text><br/>
<Section>\subject</Section><Brace>{</Brace><Normal Text> Languajes directly usable in </Normal Text><Macro>\CONTEXT</Macro><Normal Text> </Normal Text><Brace>}</Brace><br/>
<Normal Text></Normal Text><br/>
<Comment>% These three sould have their own separate syntax highlighting</Comment><br/>
<Normal Text></Normal Text><br/>
<Block>\startluacode</Block><br/>
<Normal Text>    </Normal Text><Variable>context</Variable><Symbols>.</Symbols><Normal Text>chapter</Normal Text><Symbols>({</Symbols><Variable>first</Variable><Symbols>},</Symbols><Normal Text> </Normal Text><Strings>"Some title"</Strings><Symbols>)</Symbols><br/>
<Normal Text>    </Normal Text><Variable>context</Variable><Symbols>.</Symbols><Normal Text>startcolumns</Normal Text><Symbols>({</Symbols><Variable>n</Variable><Normal Text> </Normal Text><Symbols>=</Symbols><Normal Text> </Normal Text><Numbers>3</Numbers><Symbols>,</Symbols><Normal Text> </Normal Text><Variable>rule</Variable><Normal Text> </Normal Text><Symbols>=</Symbols><Normal Text> </Normal Text><Strings>"on"</Strings><Symbols>})</Symbols><br/>
<Normal Text>        </Normal Text><Normal Text>context</Normal Text><Symbols>(</Symbols><Strings>"Hello one"</Strings><Symbols>)</Symbols><br/>
<Normal Text>    </Normal Text><Variable>context</Variable><Symbols>.</Symbols><Normal Text>column</Normal Text><Symbols>()</Symbols><br/>
<Normal Text>        </Normal Text><Normal Text>context</Normal Text><Symbols>(</Symbols><Strings>"Hello two"</Strings><Symbols>)</Symbols><br/>
<Normal Text>    </Normal Text><Variable>context</Variable><Symbols>.</Symbols><Normal Text>column</Normal Text><Symbols>()</Symbols><br/>
<Normal Text>        </Normal Text><Normal Text>context</Normal Text><Symbols>(</Symbols><Strings>"Hello three"</Strings><Symbols>)</Symbols><br/>
<Normal Text>    </Normal Text><Variable>context</Variable><Symbols>.</Symbols><Normal Text>stopcolumns</Normal Text><Symbols>()</Symbols><br/>
<Block>\stopluacode</Block><br/>
<Normal Text></Normal Text><br/>
<Block>\startMPcode</Block><br/>
<Normal Text>    </Normal Text><Type>transform</Type><Normal Text> pagecoords;</Normal Text><br/>
<Normal Text>    pagecoords </Normal Text><Operator>:=</Operator><Normal Text> </Normal Text><Macro>identity</Macro><Normal Text> </Normal Text><Statement>scaled</Statement><Normal Text> </Normal Text><Decimal>10</Decimal><Normal Text>mm </Normal Text><Statement>shifted</Statement><Normal Text> (</Normal Text><Decimal>100</Decimal><Normal Text>mm,</Normal Text><Decimal>150</Decimal><Normal Text>mm);</Normal Text><br/>
<Normal Text>    </Normal Text><Macro>fill</Macro><Normal Text> ( (</Normal Text><Decimal>0</Decimal><Normal Text>,</Normal Text><Decimal>0</Decimal><Normal Text>) </Normal Text><Operator>--</Operator><Normal Text> (</Normal Text><Decimal>2</Decimal><Normal Text>,</Normal Text><Decimal>0</Decimal><Normal Text>) </Normal Text><Operator>--</Operator><Normal Text> (</Normal Text><Decimal>2</Decimal><Normal Text>,</Normal Text><Decimal>1</Decimal><Normal Text>) </Normal Text><Operator>--</Operator><Normal Text> (</Normal Text><Decimal>1</Decimal><Normal Text>,</Normal Text><Decimal>1</Decimal><Normal Text>) </Normal Text><Operator>--</Operator><Normal Text> (</Normal Text><Decimal>1</Decimal><Normal Text>,</Normal Text><Decimal>2</Decimal><Normal Text>) </Normal Text><Operator>--</Operator><Normal Text> </Normal Text><Statement>cycle</Statement><Normal Text> )</Normal Text><br/>
<Normal Text>        </Normal Text><Statement>transformed</Statement><Normal Text> pagecoords </Normal Text><Statement>withcolor</Statement><Normal Text> </Normal Text><Macro>green</Macro><Normal Text>;</Normal Text><br/>
<Normal Text>    </Normal Text><Macro>draw</Macro><Normal Text> ( (</Normal Text><Decimal>2</Decimal><Normal Text>,</Normal Text><Decimal>0</Decimal><Normal Text>) </Normal Text><Operator>..</Operator><Normal Text> (</Normal Text><Decimal>2</Decimal><Normal Text>,</Normal Text><Decimal>1</Decimal><Normal Text>) </Normal Text><Operator>..</Operator><Normal Text> (</Normal Text><Decimal>1</Decimal><Normal Text>,</Normal Text><Decimal>1</Decimal><Normal Text>) </Normal Text><Operator>..</Operator><Normal Text> (</Normal Text><Decimal>1</Decimal><Normal Text>,</Normal Text><Decimal>2</Decimal><Normal Text>) </Normal Text><Operator>..</Operator><Normal Text> (</Normal Text><Decimal>0</Decimal><Normal Text>,</Normal Text><Decimal>2</Decimal><Normal Text>) )</Normal Text><br/>
<Normal Text>        </Normal Text><Statement>transformed</Statement><Normal Text> pagecoords;</Normal Text><br/>
<Normal Text>    </Normal Text><Macro>drawarrow</Macro><Normal Text> ( (</Normal Text><Decimal>0</Decimal><Normal Text>,</Normal Text><Decimal>0</Decimal><Normal Text>) </Normal Text><Operator>--</Operator><Normal Text> (</Normal Text><Decimal>2</Decimal><Normal Text>,</Normal Text><Decimal>2</Decimal><Normal Text>) ) </Normal Text><Statement>transformed</Statement><Normal Text> pagecoords;</Normal Text><br/>
<Block>\stopMPcode</Block><br/>
<Normal Text></Normal Text><br/>
<Block>\startXML</Block><br/>
<Element Symbols><</Element Symbols><Element>context</Element><Attribute> name</Attribute><Attribute Separator>=</Attribute Separator><Value>"MathModeMacroFind"</Value><Attribute> attribute</Attribute><Attribute Separator>=</Attribute Separator><Value>"Math"</Value><Attribute> lineEndContext</Attribute><Attribute Separator>=</Attribute Separator><Value>"#stay"</Value><Element Symbols>></Element Symbols><br/>
<Other Text>    </Other Text><Element Symbols><</Element Symbols><Element>DetectChar</Element><Attribute> char</Attribute><Attribute Separator>=</Attribute Separator><Value>"{"</Value><Attribute>              attribute</Attribute><Attribute Separator>=</Attribute Separator><Value>"Brace"</Value><Attribute> context</Attribute><Attribute Separator>=</Attribute Separator><Value>"#pop!MathModeMacro"</Value><Element Symbols>/></Element Symbols><br/>
<Other Text>    </Other Text><Element Symbols><</Element Symbols><Element>RegExpr</Element><Attribute>    String</Attribute><Attribute Separator>=</Attribute Separator><Value>"</Value><EntityRef>&macro_math;</EntityRef><Value>"</Value><Attribute> attribute</Attribute><Attribute Separator>=</Attribute Separator><Value>"Macro"</Value><Attribute> context</Attribute><Attribute Separator>=</Attribute Separator><Value>"#pop"</Value><Element Symbols>/></Element Symbols><Other Text> </Other Text><Comment><!-- 1 token --></Comment><br/>
<Other Text>    </Other Text><Element Symbols><</Element Symbols><Element>RegExpr</Element><Attribute>    String</Attribute><Attribute Separator>=</Attribute Separator><Value>"[[:graph:]]"</Value><Attribute>  attribute</Attribute><Attribute Separator>=</Attribute Separator><Value>"Math"</Value><Attribute>  context</Attribute><Attribute Separator>=</Attribute Separator><Value>"#pop"</Value><Element Symbols>/></Element Symbols><Other Text> </Other Text><Comment><!-- 1 token --></Comment><br/>
<Element Symbols></</Element Symbols><Element>context</Element><Element Symbols>></Element Symbols><br/>
<Block>\stopXML</Block><br/>
<Normal Text></Normal Text><br/>
