Warning, /frameworks/syntax-highlighting/autotests/folding/test.mkiv.fold is written in an unsupported language. File is not indexed.
0001 % ConTeXt test file for Kate's syntax highlighting and code folding
0002
0003
0004 %% Comments
0005 % This is a comment
0006 \% Not a comment
0007 \\% This is a comment
0008
0009 % Titles should be bold
0010 \subject<beginfold id='1'>{</beginfold id='1'>Subject<endfold id='1'>}</endfold id='1'>
0011 \subsubject<beginfold id='1'>{</beginfold id='1'>Sub-subject<endfold id='1'>}</endfold id='1'>
0012 \subsubsubject<beginfold id='1'>{</beginfold id='1'>Sub-sub-subject<endfold id='1'>}</endfold id='1'>
0013 \subsubsubsubject<beginfold id='1'>{</beginfold id='1'>Sub-sub-sub-subject<endfold id='1'>}</endfold id='1'>
0014 \subsubsubsubsubject<beginfold id='1'>{</beginfold id='1'>Sub-sub-sub-sub-subject<endfold id='1'>}</endfold id='1'>
0015 \section<beginfold id='1'>{</beginfold id='1'>Section<endfold id='1'>}</endfold id='1'>
0016 \subsection<beginfold id='1'>{</beginfold id='1'>Sub-section<endfold id='1'>}</endfold id='1'>
0017 \subsubsection<beginfold id='1'>{</beginfold id='1'>Sub-sub-section<endfold id='1'>}</endfold id='1'>
0018 \subsubsubsection<beginfold id='1'>{</beginfold id='1'>Sub-sub-sub-section<endfold id='1'>}</endfold id='1'>
0019 \subsubsubsubsection<beginfold id='1'>{</beginfold id='1'>Sub-sub-sub-sub-section<endfold id='1'>}</endfold id='1'>
0020
0021 %% Start/stop blocks
0022 <beginfold id='1'>\startsection</beginfold id='1'>
0023 Can be nested
0024 <beginfold id='1'>\startitemize</beginfold id='1'>
0025 \item normal
0026 <endfold id='1'>\stopitemize</endfold id='1'>
0027 normal
0028 <endfold id='1'>\stopsection</endfold id='1'>
0029 % \startblock \stopblock should be comments
0030
0031
0032 %% Commands
0033 \def<beginfold id='1'>\startstuff</beginfold id='1'><beginfold id='1'>{</beginfold id='1'>Custom environment start<endfold id='1'>}</endfold id='1'>
0034 \def<endfold id='1'>\stopstuff</endfold id='1'><beginfold id='1'>{</beginfold id='1'>Custom environment stop<endfold id='1'>}</endfold id='1'>
0035 <beginfold id='1'>\startstuff</beginfold id='1'> should not be normal command colour (it is an error to miss <endfold id='1'>\stopstuff</endfold id='1'>)
0036
0037 \def\sayHello<beginfold id='1'>{</beginfold id='1'>Héllò Wø®łÐ<endfold id='1'>}</endfold id='1'>
0038 % This prints Héllò Wø®łÐ@@@ , If it were \sayHelloAAA it would be
0039 % an error, so the @ is not in the macro
0040 \sayHello@@@
0041
0042 \def\testUnderscores<beginfold id='1'>{</beginfold id='1'>Text_With_Underscores<endfold id='1'>}</endfold id='1'>
0043 % This prints Text_With_Underscores_ note the final underscore and no error
0044 \testUnderscores_
0045
0046 \def\€<beginfold id='1'>{</beginfold id='1'>Macro with sign<endfold id='1'>}</endfold id='1'>
0047 % This is a single macro
0048 \€ % This prints Macro with sign
0049 \€A % This prints Macro with signA (not an error)
0050
0051 \setupindenting[yes, big]
0052
0053
0054 %% Inline math
0055 $equations are green, \commands somewhat darker
0056 it can also run over multiple lines
0057 % Comment
0058 $
0059 normal
0060 \mathematics{equations are green, \commands somewhat darker
0061 it can also run over multiple lines
0062 \mathematics{nested math should be green} this should still be green
0063 % Comment
0064 }
0065 normal
0066 \math{equations are green, \commands somewhat darker
0067 it can also run over multiple lines
0068 \math{nested math should be green} this should still be green
0069 % Comment
0070 }
0071 normal
0072 \m{equations are green, \commands somewhat darker
0073 it can also run over multiple lines
0074 \m{nested math should be green} this should still be green
0075 % Comment
0076 }
0077 normal
0078 \mathematics the first character should be green <beginfold id='1'>{</beginfold id='1'><endfold id='1'>}</endfold id='1'>
0079 \math the first character should be green <beginfold id='1'>{</beginfold id='1'><endfold id='1'>}</endfold id='1'>
0080 \m the first character should be green <beginfold id='1'>{</beginfold id='1'><endfold id='1'>}</endfold id='1'>
0081 \formula the first character should be green <beginfold id='1'>{</beginfold id='1'><endfold id='1'>}</endfold id='1'>
0082 normal
0083 % $should$ \mathematics{still} \math{be} \m{commented}
0084
0085 % The underscore after sum should be blue, not macro color
0086 Math macro with underscores \m { v = \sum_0^1{ \sqrt{2} }! }
0087
0088 %% Display math
0089 $$
0090 equations are green, \commands somewhat darker
0091 it can also run over multiple lines
0092 % Comment
0093 $$
0094 normal
0095 <beginfold id='2'>\startformula</beginfold id='2'>
0096 equations are green, \commands somewhat darker
0097 it can also run over multiple lines
0098 % Comment
0099
0100 Nested formulae should not work
0101 The following should be red:
0102 \startformula
0103 Should still be math colour
0104 <endfold id='2'>\stopformula</endfold id='2'>
0105 normal
0106
0107 % This is a regular macro, not math macro
0108 \def\mathematicsMacroShouldNotMatchThis<beginfold id='1'>{</beginfold id='1'>Not Math<endfold id='1'>}</endfold id='1'>
0109
0110 %% Verbatim
0111 <beginfold id='3'>\starttyping</beginfold id='3'>
0112 All text in here should be verbatim colour
0113 % This should not be a comment
0114 &@@#^%&^#$
0115
0116 Nested typing should be displayed in verbatim colour
0117 \starttyping
0118 \stoptyping
0119 should still be verbatim colour
0120 % This should not be a comment
0121 <endfold id='3'>\stoptyping</endfold id='3'>
0122
0123 normal
0124
0125
0126 %% Tables
0127 <beginfold id='1'>\starttabulate</beginfold id='1'>[|c|c|c|]
0128 \FL
0129 \NC header1 \NC header2 \NC header3 \NR
0130 \ML
0131 \NC value1 \NC value2 \NC value3 \NR
0132 \NC value4 \NC value5 \NC value6 \NR
0133 \BL
0134 <endfold id='1'>\stoptabulate</endfold id='1'>
0135
0136 Commands for TABLE environment (<beginfold id='1'>\bTABLE</beginfold id='1'> and <endfold id='1'>\eTABLE</endfold id='1'>, <beginfold id='1'>\bTD</beginfold id='1'> and <endfold id='1'>\eTD</endfold id='1'>, etc.) should emulate start/stop blocks
0137 <beginfold id='1'>\bTABLE</beginfold id='1'>[split=yes]
0138 <beginfold id='1'>\bTR</beginfold id='1'> <beginfold id='1'>\bTD</beginfold id='1'> value1 <endfold id='1'>\eTD</endfold id='1'> <beginfold id='1'>\bTD</beginfold id='1'> value2 <endfold id='1'>\eTD</endfold id='1'> <beginfold id='1'>\bTD</beginfold id='1'> value3 <endfold id='1'>\eTD</endfold id='1'> <endfold id='1'>\eTR</endfold id='1'>
0139 <beginfold id='1'>\bTR</beginfold id='1'> <beginfold id='1'>\bTD</beginfold id='1'> value4 <endfold id='1'>\eTD</endfold id='1'> <beginfold id='1'>\bTD</beginfold id='1'> value5 <endfold id='1'>\eTD</endfold id='1'> <beginfold id='1'>\bTD</beginfold id='1'> value6 <endfold id='1'>\eTD</endfold id='1'> <endfold id='1'>\eTR</endfold id='1'>
0140 <endfold id='1'>\eTABLE</endfold id='1'>
0141
0142 <beginfold id='1'>\startxtable</beginfold id='1'>
0143 <beginfold id='1'>\startxrow</beginfold id='1'>
0144 <beginfold id='1'>\startxcell</beginfold id='1'> value1 <endfold id='1'>\stopxcell</endfold id='1'>
0145 <beginfold id='1'>\startxcell</beginfold id='1'> value2 <endfold id='1'>\stopxcell</endfold id='1'>
0146 <endfold id='1'>\stopxrow</endfold id='1'>
0147 <beginfold id='1'>\startxrow</beginfold id='1'>
0148 <beginfold id='1'>\startxcell</beginfold id='1'> value3 <endfold id='1'>\stopxcell</endfold id='1'>
0149 <beginfold id='1'>\startxcell</beginfold id='1'> value5 <endfold id='1'>\stopxcell</endfold id='1'>
0150 <endfold id='1'>\stopxrow</endfold id='1'>
0151 <endfold id='1'>\stopxtable</endfold id='1'>
0152
0153
0154
0155 \subject<beginfold id='1'>{</beginfold id='1'> Languajes directly usable in \CONTEXT <endfold id='1'>}</endfold id='1'>
0156
0157 % These three sould have their own separate syntax highlighting
0158
0159 <beginfold id='4'>\startluacode</beginfold id='4'>
0160 context.chapter(<beginfold id='5'>{</beginfold id='5'>first<endfold id='5'>}</endfold id='5'>, "Some title")
0161 context.startcolumns(<beginfold id='5'>{</beginfold id='5'>n = 3, rule = "on"<endfold id='5'>}</endfold id='5'>)
0162 context("Hello one")
0163 context.column()
0164 context("Hello two")
0165 context.column()
0166 context("Hello three")
0167 context.stopcolumns()
0168 <endfold id='4'>\stopluacode</endfold id='4'>
0169
0170 <beginfold id='6'>\startMPcode</beginfold id='6'>
0171 transform pagecoords;
0172 pagecoords := identity scaled 10mm shifted (100mm,150mm);
0173 fill ( (0,0) -- (2,0) -- (2,1) -- (1,1) -- (1,2) -- cycle )
0174 transformed pagecoords withcolor green;
0175 draw ( (2,0) .. (2,1) .. (1,1) .. (1,2) .. (0,2) )
0176 transformed pagecoords;
0177 drawarrow ( (0,0) -- (2,2) ) transformed pagecoords;
0178 <endfold id='6'>\stopMPcode</endfold id='6'>
0179
0180 <beginfold id='7'>\startXML</beginfold id='7'>
0181 <beginfold id='8'><</beginfold id='8'>context name="MathModeMacroFind" attribute="Math" lineEndContext="#stay">
0182 <beginfold id='8'><</beginfold id='8'>DetectChar char="{" attribute="Brace" context="#pop!MathModeMacro"<endfold id='8'>/></endfold id='8'>
0183 <beginfold id='8'><</beginfold id='8'>RegExpr String="¯o_math;" attribute="Macro" context="#pop"<endfold id='8'>/></endfold id='8'> <beginfold id='9'><!--</beginfold id='9'> 1 token <endfold id='9'>--></endfold id='9'>
0184 <beginfold id='8'><</beginfold id='8'>RegExpr String="[[:graph:]]" attribute="Math" context="#pop"<endfold id='8'>/></endfold id='8'> <beginfold id='9'><!--</beginfold id='9'> 1 token <endfold id='9'>--></endfold id='9'>
0185 </context<endfold id='8'>></endfold id='8'>
0186 <endfold id='7'>\stopXML</endfold id='7'>
0187