Warning, /frameworks/syntax-highlighting/autotests/input/test.mkiv 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{Subject}
0011 \subsubject{Sub-subject}
0012 \subsubsubject{Sub-sub-subject}
0013 \subsubsubsubject{Sub-sub-sub-subject}
0014 \subsubsubsubsubject{Sub-sub-sub-sub-subject}
0015 \section{Section}
0016 \subsection{Sub-section}
0017 \subsubsection{Sub-sub-section}
0018 \subsubsubsection{Sub-sub-sub-section}
0019 \subsubsubsubsection{Sub-sub-sub-sub-section}
0020 
0021 %% Start/stop blocks
0022 \startsection
0023 Can be nested
0024 \startitemize
0025 \item normal
0026 \stopitemize
0027 normal
0028 \stopsection
0029 % \startblock \stopblock should be comments
0030 
0031 
0032 %% Commands
0033 \def\startstuff{Custom environment start}
0034 \def\stopstuff{Custom environment stop}
0035 \startstuff should not be normal command colour (it is an error to miss \stopstuff)
0036 
0037 \def\sayHello{Héllò Wø®łÐ}
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{Text_With_Underscores}
0043 % This prints Text_With_Underscores_ note the final underscore and no error
0044 \testUnderscores_
0045 
0046 \def\€{Macro with sign}
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 {}
0079 \math        the first character should be green {}
0080 \m           the first character should be green {}
0081 \formula     the first character should be green {}
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 \startformula
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 \stopformula
0105 normal
0106 
0107 % This is a regular macro, not math macro
0108 \def\mathematicsMacroShouldNotMatchThis{Not Math}
0109 
0110 %% Verbatim
0111 \starttyping
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 \stoptyping
0122 
0123 normal
0124 
0125 
0126 %% Tables
0127 \starttabulate[|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 \stoptabulate
0135 
0136 Commands for TABLE environment (\bTABLE and \eTABLE, \bTD and \eTD, etc.) should emulate start/stop blocks
0137 \bTABLE[split=yes]
0138   \bTR \bTD value1 \eTD \bTD value2 \eTD \bTD value3 \eTD \eTR
0139   \bTR \bTD value4 \eTD \bTD value5 \eTD \bTD value6 \eTD \eTR
0140 \eTABLE
0141 
0142 \startxtable
0143   \startxrow
0144     \startxcell value1 \stopxcell
0145     \startxcell value2 \stopxcell
0146   \stopxrow
0147   \startxrow
0148     \startxcell value3 \stopxcell
0149     \startxcell value5 \stopxcell
0150   \stopxrow
0151 \stopxtable
0152 
0153 
0154 
0155 \subject{ Languajes directly usable in \CONTEXT }
0156 
0157 % These three sould have their own separate syntax highlighting
0158 
0159 \startluacode
0160     context.chapter({first}, "Some title")
0161     context.startcolumns({n = 3, rule = "on"})
0162         context("Hello one")
0163     context.column()
0164         context("Hello two")
0165     context.column()
0166         context("Hello three")
0167     context.stopcolumns()
0168 \stopluacode
0169 
0170 \startMPcode
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 \stopMPcode
0179 
0180 \startXML
0181 <context name="MathModeMacroFind" attribute="Math" lineEndContext="#stay">
0182     <DetectChar char="{"              attribute="Brace" context="#pop!MathModeMacro"/>
0183     <RegExpr    String="&macro_math;" attribute="Macro" context="#pop"/> <!-- 1 token -->
0184     <RegExpr    String="[[:graph:]]"  attribute="Math"  context="#pop"/> <!-- 1 token -->
0185 </context>
0186 \stopXML
0187