diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2015-10-25 20:12:45 +0800 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2015-10-25 20:26:12 +0800 |
commit | 36e8000863322e5367dafa398b228a72502030a4 (patch) | |
tree | 130c6f67f85401148e1c2838b01fd9a4e8b74223 /kate/data/ocaml.xml | |
parent | 48c3adf7bda38f19bd5c4a1a58348ae91bc82bf8 (diff) | |
download | tdelibs-36e8000863322e5367dafa398b228a72502030a4.tar.gz tdelibs-36e8000863322e5367dafa398b228a72502030a4.zip |
Kate syntax highlighting files update - Oct 2015
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit dd1a8d0d1a40f43040555128913e55202f241270)
Diffstat (limited to 'kate/data/ocaml.xml')
-rw-r--r-- | kate/data/ocaml.xml | 671 |
1 files changed, 507 insertions, 164 deletions
diff --git a/kate/data/ocaml.xml b/kate/data/ocaml.xml index f86b2fac8..364cbdd9d 100644 --- a/kate/data/ocaml.xml +++ b/kate/data/ocaml.xml @@ -1,39 +1,48 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Kate syntax highlighting for Objective Caml version 3.07 in the standard and revised syntaxes. --> +<!-- Kate syntax highlighting for Objective Caml version 3.08 in the standard and revised syntaxes, with Ocamldoc comments. --> + <!DOCTYPE language SYSTEM "language.dtd" [ <!-- Regular expresion constants: --> -<!ENTITY LETTER "A-Za-z\0300-\0326\0330-\0366\0370-\0377"> <!-- Latin-1 letters. --> -<!ENTITY IDENT "[&LETTER;_][&LETTER;0-9_']*"> <!-- OCaml identifiers. --> -<!ENTITY MIDENT "[A-Z][&LETTER;0-9_']*"> <!-- OCaml uppercase identifiers. --> +<!ENTITY LOWER "a-z\300-\326\330-\337"> <!-- Lowercase Latin-1 letters. --> +<!ENTITY UPPER "A-Z\340-\366\370-\377"> <!-- Uppercase Latin-1 letters. --> +<!ENTITY LETTER "&LOWER;&UPPER;"> <!-- All Latin-1 letters. --> +<!ENTITY LIDENT "[&LOWER;_][&LETTER;0-9_']*"> <!-- Lowercase OCaml identifiers. --> +<!ENTITY UIDENT "`?[&UPPER;][&LETTER;0-9_']*"> <!-- Uppercase OCaml identifiers. --> +<!ENTITY IDENT "`?[&LETTER;][&LETTER;0-9_']*"> <!-- All OCaml identifiers. --> <!ENTITY ESC "(\\[ntbr'"\\]|\\[0-9]{3}|\\x[0-9A-Fa-f]{2})"> <!-- OCaml character code escapes. --> <!ENTITY DEC "[0-9][0-9_]*"> <!-- Decimal digits with underscores. --> ]> -<language name="Objective Caml" version="1.05" kateversion="2.4" section="Sources" extensions="*.ml;*.mli" mimetype="" priority="10" author="Glyn Webster (glyn@wave.co.nz)" license="LGPL"> +<language name="Objective Caml" + extensions="*.ml;*.mli" + mimetype="" + section="Sources" + version="2.01" + priority="10" + kateversion="2.4" + author="Glyn Webster (glynwebster@orcon.net.nz) and Vincent Hugot (vincent.hugot@gmail.com)" + license="LGPL" > <highlighting> - <!-- Revised Syntax keywords are highlighted as identifiers by default. --> - <!-- Change their highlighting colour to match the standard keywords --> - <!-- if you intend to use the Camlp4 Revised Syntax. --> - <list name="revised syntax keywords"> - <item> declare </item> - <item> value </item> - <item> where </item> + <list name="qtest keywords"> + <item> in </item> + <item> as </item> + <item> forall </item> </list> - <list name="keywords"> + <list name="Keywords"> <item> and </item> <item> as </item> <item> assert </item> <item> asr </item> -<!-- <item> begin </item> --> + <item> begin </item> <item> class </item> <item> closed </item> <item> constraint </item> -<!-- <item> do </item> --> -<!-- <item> done </item> --> + <item> do </item> + <item> done </item> <item> downto </item> <item> else </item> -<!-- <item> end </item> --> + <item> end </item> <item> exception </item> <item> external </item> <item> false </item> @@ -43,9 +52,8 @@ <item> functor </item> <item> if </item> <item> in </item> -<!-- <item> include </item> --> + <item> include </item> <item> inherit </item> - <item> initializer </item> <item> land </item> <item> lazy </item> <item> let </item> @@ -56,18 +64,18 @@ <item> match </item> <item> method </item> <item> mod </item> -<!-- <item> module </item> --> + <item> module </item> <item> mutable </item> <item> new </item> -<!-- <item> object </item> --> + <item> object </item> <item> of </item> -<!-- <item> open </item> --> + <item> open </item> <item> or </item> <item> parser </item> <item> private </item> <item> rec </item> -<!-- <item> sig </item> --> -<!-- <item> struct </item> --> + <item> sig </item> + <item> struct </item> <item> then </item> <item> to </item> <item> true </item> @@ -79,193 +87,528 @@ <item> while </item> <item> with </item> </list> - <list name="core types"> - <item> exn </item> - <item> lazy_t </item> - <item> format </item> - <item> unit </item> - <item> int </item> - <item> real </item> - <item> char </item> - <item> string </item> + + <!-- Revised Syntax keywords are highlighted as identifiers by default. --> + <!-- Change their highlighting colour to match the standard keywords --> + <!-- if you intend to use the Camlp4 Revised Syntax. --> + <list name="Revised Syntax Keywords"> + <item> declare </item> + <item> value </item> + <item> where </item> + </list> + + <list name="Pervasive Functions"> + <item> abs </item> + <item> abs_float </item> + <item> acos </item> + <item> asin </item> + <item> at_exit </item> + <item> atan </item> + <item> atan2 </item> + <item> bool_of_string </item> + <item> ceil </item> + <item> char_of_int </item> + <item> classify_float </item> + <item> close_in </item> + <item> close_in_noerr </item> + <item> close_out </item> + <item> close_out_noerr </item> + <item> compare </item> + <item> cos </item> + <item> cosh </item> + <item> decr </item> + <item> do_at_exit </item> + <item> epsilon_float </item> + <item> exp </item> + <item> float </item> + <item> float_of_int </item> + <item> float_of_string </item> + <item> floor </item> + <item> flush </item> + <item> flush_all </item> + <item> format_of_string </item> + <item> frexp </item> + <item> fst </item> + <item> ignore </item> + <item> in_channel_length </item> + <item> incr </item> + <item> infinity </item> + <item> input </item> + <item> input_binary_int </item> + <item> input_byte </item> + <item> input_char </item> + <item> input_line </item> + <item> input_value </item> + <item> int_of_char </item> + <item> int_of_float </item> + <item> int_of_string </item> + <item> ldexp </item> + <item> lnot </item> + <item> log </item> + <item> log10 </item> + <item> max </item> + <item> max_float </item> + <item> max_int </item> + <item> min </item> + <item> min_float </item> + <item> min_int </item> + <item> mod_float </item> + <item> modf </item> + <item> nan </item> + <item> neg_infinity </item> + <item> not </item> + <item> open_in </item> + <item> open_in_bin </item> + <item> open_in_gen </item> + <item> open_out </item> + <item> open_out_bin </item> + <item> open_out_gen </item> + <item> out_channel_length </item> + <item> output </item> + <item> output_binary_int </item> + <item> output_byte </item> + <item> output_char </item> + <item> output_string </item> + <item> output_value </item> + <item> pos_in </item> + <item> pos_out </item> + <item> pred </item> + <item> prerr_char </item> + <item> prerr_endline </item> + <item> prerr_float </item> + <item> prerr_int </item> + <item> prerr_newline </item> + <item> prerr_string </item> + <item> print_char </item> + <item> print_endline </item> + <item> print_float </item> + <item> print_int </item> + <item> print_newline </item> + <item> print_string </item> + <item> read_float </item> + <item> read_int </item> + <item> read_line </item> + <item> really_input </item> <item> ref </item> + <item> seek_in </item> + <item> seek_out </item> + <item> set_binary_mode_in </item> + <item> set_binary_mode_out </item> + <item> sin </item> + <item> sinh </item> + <item> snd </item> + <item> sqrt </item> + <item> stderr </item> + <item> stdin </item> + <item> stdout </item> + <item> string_of_bool </item> + <item> string_of_float </item> + <item> string_of_format </item> + <item> string_of_int </item> + <item> succ </item> + <item> tan </item> + <item> tanh </item> + <item> truncate </item> + <item> unsafe_really_input </item> + <item> valid_float_lexem </item> + </list> + + <!-- These pervasive functions control program flow, --> + <!-- so some people like to highlight them as keywords: --> + <list name="Flow Control Functions"> + <item> exit </item> + <item> failwith </item> + <item> invalid_arg </item> + <item> raise </item> + </list> + + <list name="Pervasive Types"> <item> array </item> <item> bool </item> + <item> char </item> + <item> exn </item> + <item> format4 </item> + <item> fpclass </item> + <item> in_channel </item> + <item> int </item> + <item> int32 </item> + <item> int64 </item> + <item> lazy_t </item> <item> list </item> + <item> nativeint </item> + <item> open_flag </item> <item> option </item> + <item> out_channel </item> + <item> real </item> + <item> ref </item> + <item> string </item> + <item> unit </item> </list> - <list name="symbols"> - <item> ? </item> - </list> - <list name="end"> - <item> end </item> - </list> - <list name="sig"> - <item> sig </item> - </list> - <list name="struct"> - <item> struct </item> - </list> - <list name="object"> - <item> object </item> - </list> - <list name="begin"> - <item> begin </item> - </list> - <list name="do"> - <item> do </item> - </list> - <list name="done"> - <item> done </item> - </list> - <list name="module_environment"> - <item> module </item> - <item> open </item> - <item> include </item> - </list> - <contexts> - <context attribute="Normal Text" lineEndContext="#stay" name="Normal"> + <list name="Pervasive Variant Tags"> + <item> FP_infinite </item> + <item> FP_nan </item> + <item> FP_normal </item> + <item> FP_subnormal </item> + <item> FP_zero </item> + <item> None </item> + <item> Open_append </item> + <item> Open_append </item> + <item> Open_binary </item> + <item> Open_binary </item> + <item> Open_creat </item> + <item> Open_creat </item> + <item> Open_excl </item> + <item> Open_excl </item> + <item> Open_nonblock </item> + <item> Open_nonblock </item> + <item> Open_rdonly </item> + <item> Open_rdonly </item> + <item> Open_text </item> + <item> Open_text </item> + <item> Open_trunc </item> + <item> Open_trunc </item> + <item> Open_wronly </item> + <item> Open_wronly </item> + <item> Some </item> + </list> - <Detect2Chars attribute="Comment" context="Multiline Comment" char="(" char1="*" beginRegion="comment" /> + <list name="Pervasive Exceptions"> + <item> Assert_failure </item> + <item> Division_by_zero </item> + <item> End_of_file </item> + <item> Exit </item> + <item> Failure </item> + <item> Invalid_argument </item> + <item> Match_failure </item> + <item> Not_found </item> + <item> Out_of_memory </item> + <item> Stack_overflow </item> + <item> Sys_blocked_io </item> + <item> Sys_error </item> + <item> Undefined_recursive_module </item> + </list> - <DetectChar attribute="Symbol" context="#stay" char="(" beginRegion="paren"/> - <DetectChar attribute="Symbol" context="#stay" char=")" endRegion="paren"/> + <list name="Standard Library Modules"> + <item> Arg </item> + <item> Array </item> + <item> ArrayLabels </item> + <item> Buffer </item> + <item> Callback </item> + <item> Char </item> + <item> Complex </item> + <item> Digest </item> + <item> Filename </item> + <item> Format </item> + <item> Gc </item> + <item> Genlex </item> + <item> Hashtbl </item> + <item> Int32 </item> + <item> Int64 </item> + <item> Lazy </item> + <item> Lexing </item> + <item> List </item> + <item> ListLabels </item> + <item> Map </item> + <item> Marshal </item> + <item> MoreLabels </item> + <item> Nativeint </item> + <item> Oo </item> + <item> Parsing </item> + <item> Printexc </item> + <item> Printf </item> + <item> Queue </item> + <item> Random </item> + <item> Scanf </item> + <item> Set </item> + <item> Sort </item> + <item> Stack </item> + <item> StdLabels </item> + <item> Stream </item> + <item> String </item> + <item> StringLabels </item> + <item> Sys </item> + <item> Weak </item> + </list> - <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="record"/> - <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="record"/> + <contexts> - <Detect2Chars attribute="Symbol" context="#stay" char="[" char1="|" beginRegion="array"/> - <Detect2Chars attribute="Symbol" context="#stay" char="|" char1="]" endRegion="array"/> - <DetectChar attribute="Symbol" context="#stay" char="[" beginRegion="list"/> - <DetectChar attribute="Symbol" context="#stay" char="]" endRegion="list"/> + <context name="Code" lineEndContext="#stay" attribute="Operator"> - <keyword attribute="Keyword" context="#stay" String="do" beginRegion="loop"/> - <keyword attribute="Keyword" context="#stay" String="done" endRegion="loop"/> - <keyword attribute="Directive" context="ModuleEnv" String="module_environment"/> - <keyword attribute="Region Marker" context="Block" String="begin" beginRegion="block"/> - <keyword attribute="Region Marker" context="Object" String="object" beginRegion="object"/> - <keyword attribute="Region Marker" context="Sig" String="sig" beginRegion="sig"/> - <keyword attribute="Region Marker" context="Struct" String="struct" beginRegion="struct"/> + <!-- ] and ]} close code samples in Ocamldoc, so --> + <!-- nested [ ] and { } brackets have to be allowed for: --> + <DetectChar char="[" context="Nested Code 1" attribute="Operator" /> + <DetectChar char="{" context="Nested Code 2" attribute="Operator" /> - <RegExpr attribute="Constructor" context="#stay" String="`\s*&IDENT;"/> - <RegExpr attribute="Module" lookAhead="true" context="ModuleEnv2" String="&MIDENT;\s*\."/> - <RegExpr attribute="Constructor" context="#stay" String="&MIDENT;"/> + <!-- Comments. --> + <!-- A (** begins a special comment with Ocamldoc documentation markup. --> + <StringDetect String="(**)" context="#stay" attribute="Comment" /> + <StringDetect String="(**" context="Ocamldoc" attribute="Comment" beginRegion="comment" /> + <RegExpr String="\(\*\$(T|Q|R|=)" context="qtest header" attribute="qtest body style" beginRegion="comment" /> + <Detect2Chars char="(" char1="*" context="Comment" attribute="Comment" beginRegion="comment" /> - <!-- Interpreter directives. --> + <!-- Interpreter directives. --> <!-- (These are lines where the first symbol is a '#' followed by an identifier. --> - <!-- Such lines could also be part of a method call split over two lines but --> + <!-- Such lines could also be part of a method call split over two lines but --> <!-- it's unlikey anyone would code like that.) --> - <RegExpr attribute="Directive" context="#stay" String="#&IDENT;.*$" firstNonSpace="true"/> + <RegExpr String="#&IDENT;.*$" context="#stay" firstNonSpace="true" attribute="Directive"/> - <!-- String, character and Camlp4 "quotation" constants. --> + <!-- String, character and Camlp4 "quotation" constants. --> <!-- Note: If you must modify the pattern for characters be precise: --> <!-- single quotes have several meanings in Ocaml. --> - <DetectChar attribute="String" context="String Constant" char=""" /> - <RegExpr attribute="Character" context="#stay" String="'(&ESC;|[^'])'" /> - <Detect2Chars attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" char="<" char1="<" /> - <RegExpr attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" String="<:&IDENT;<" /> + <DetectChar char=""" context="String" attribute="String" /> + <RegExpr String="'(&ESC;|[^'])'" context="#stay" attribute="Character" /> + <Detect2Chars char="<" char1="<" context="Camlp4 Quotation" attribute="Camlp4 Quotation" /> + <RegExpr String="<:&IDENT;<" context="Camlp4 Quotation" attribute="Camlp4 Quotation" /> - <!-- Identifiers and keywords. --> - <keyword attribute="Keyword" context="#stay" String="keywords" /> - <keyword attribute="Revised Syntax Keyword" context="#stay" String="revised syntax keywords" /> - <keyword attribute="Core Data Type" context="#stay" String="core types" /> - <RegExpr attribute="Identifier" context="#stay" String="&IDENT;" /> + <!-- Identifiers and keywords. --> + <keyword String="Keywords" context="#stay" attribute="Keyword" /> + <keyword String="Revised Syntax Keywords" context="#stay" attribute="Revised Syntax Keyword" /> + <keyword String="Flow Control Functions" context="#stay" attribute="Flow Control Functions" /> + <keyword String="Pervasive Functions" context="#stay" attribute="Pervasive Functions" /> + <keyword String="Pervasive Types" context="#stay" attribute="Pervasive Types" /> + <keyword String="Pervasive Exceptions" context="#stay" attribute="Pervasive Exceptions" /> + <keyword String="Pervasive Variant Tags" context="#stay" attribute="Pervasive Variant Tags" /> + <keyword String="Standard Library Modules" context="#stay" attribute="Standard Library Modules" /> + <RegExpr String="&LIDENT;" context="#stay" attribute="Lowercase Identifier" /> + <RegExpr String="&UIDENT;" context="#stay" attribute="Uppercase Identifier" /> <!-- Numeric constants. --> - <!-- Note that they may contain underscores. --> - <RegExpr attribute="Hexadecimal" context="#stay" String="-?0[xX][0-9A-Fa-f_]+" /> - <RegExpr attribute="Octal" context="#stay" String="-?0[oO][0-7_]+" /> - <RegExpr attribute="Binary" context="#stay" String="-?0[bB][01_]+" /> - <RegExpr attribute="Float" context="#stay" String="-?&DEC;((\.(&DEC;)?([eE][-+]?&DEC;)?)|([eE][-+]?&DEC;))" /> - <RegExpr attribute="Decimal" context="#stay" String="-?&DEC;" /> + <!-- Note that they may contain underscores. --> + <RegExpr String="-?0[xX][0-9A-Fa-f_]+" context="#stay" attribute="Hexadecimal" /> + <RegExpr String="-?0[oO][0-7_]+" context="#stay" attribute="Octal" /> + <RegExpr String="-?0[bB][01_]+" context="#stay" attribute="Binary" /> + <RegExpr String="-?&DEC;(\.&DEC;([eE][-+]?&DEC;)?|[eE][-+]?&DEC;)" context="#stay" attribute="Float" /> + <RegExpr String="-?&DEC;" context="#stay" attribute="Decimal" /> + + <IncludeRules context="Unmatched Closing Brackets" /> </context> - <context attribute="Comment" lineEndContext="#stay" name="Multiline Comment"> - <!-- Support for nested comments --> - <Detect2Chars attribute="Comment" context="#pop" char="*" char1=")" endRegion="comment" /> - <Detect2Chars attribute="Comment" context="Multiline Comment" char="(" char1="*" beginRegion="comment" /> + <context name="Nested Code 1" lineEndContext="#stay" attribute="Operator"> + <DetectChar char="]" context="#pop" attribute="Operator" /> + <IncludeRules context="Code" includeAttrib="true" /> </context> - <context attribute="String" lineEndContext="#stay" name="String Constant"> - <DetectChar attribute="String" context="#pop" char=""" /> - <RegExpr attribute="Escaped characters" context="#stay" String="&ESC;" /> - <!-- An underscore at the end of a line in a string indicates --> - <!-- that the string will continue on the next line. --> - <RegExpr attribute="Escaped characters" context="#stay" String="\\$" /> + <context name="Nested Code 2" lineEndContext="#stay" attribute="Operator"> + <DetectChar char="}" context="#pop" attribute="Operator" /> + <IncludeRules context="Code" includeAttrib="true" /> </context> - <context attribute="Normal text" lineEndContext="#stay" name="Block"> - <keyword attribute="Region Marker" context="#pop" String="end" endRegion="block"/> - <IncludeRules context="Normal"/> + <context name="String" lineEndContext="#stay" attribute="String"> + <DetectChar char=""" context="#pop" attribute="String" /> + <RegExpr String="&ESC;" context="#stay" attribute="Escaped Characters" /> + <!-- A backslash at the end of a line in a string indicates --> + <!-- that the string will continue on the next line: --> + <RegExpr String="\\$" context="#stay" attribute="Escaped Characters" /> </context> - <context attribute="Normal text" lineEndContext="#stay" name="Sig"> - <keyword attribute="Region Marker" context="#pop" String="end" endRegion="sig"/> - <IncludeRules context="Normal"/> + <context name="qtest header" lineEndContext="qtest" attribute="Operator"> + <keyword String="qtest keywords" attribute="Keyword" /> + <DetectChar char="&" context="qtest param" attribute="qtest param style" /> + <RegExpr String="&LIDENT;" context="#stay" attribute="qtest header style"/> </context> - <context attribute="Normal text" lineEndContext="#stay" name="Struct"> - <keyword attribute="Region Marker" context="#pop" String="end" endRegion="struct"/> - <IncludeRules context="Normal"/> + <context name="qtest param" lineEndContext="qtest" attribute="qtest param style"> </context> - - <context attribute="Normal text" lineEndContext="#stay" name="Object"> - <keyword attribute="Region Marker" context="#pop" String="end" endRegion="object"/> - <IncludeRules context="Normal"/> + + <context name="qtest" lineEndContext="#stay" attribute="qtest body style"> + <Detect2Chars char="*" char1=')' context="#pop" attribute="qtest body style" endRegion="comment" /> + <IncludeRules context="Code" includeAttrib="true" /> </context> - - <context attribute="Normal text" lineEndContext="#stay" name="ModuleEnv" fallthrough="true" fallthroughContext="#pop"> - <DetectSpaces attribute="Normal text" context="#stay"/> - <RegExpr attribute="Module" lookAhead="true" context="ModuleEnv2" String="&MIDENT;\s*\."/> - <RegExpr attribute="Module" context="#pop" String="&MIDENT;"/> + + <context name="Comment" lineEndContext="#stay" attribute="Comment"> + <Detect2Chars char="*" char1=")" context="#pop" attribute="Comment" endRegion="comment" /> + <!-- Support for nested comments: --> + <Detect2Chars char="(" char1="*" context="Comment" attribute="Comment" beginRegion="comment" /> + <!-- Strings in Ocaml comments must be well-formed: --> + <DetectChar char=""" context="String in Comment" attribute="String in Comment" /> </context> - - <context attribute="Normal text" lineEndContext="#stay" name="ModuleEnv2"> - <RegExpr attribute="Module" context="#stay" String="&MIDENT;"/> - <DetectSpaces attribute="Normal text" context="#stay"/> - <StringDetect attribute="Keyword" context="#pop" String="."/> + + <context name="String in Comment" lineEndContext="#stay" attribute="String in Comment"> + <DetectChar char=""" context="#pop" attribute="String in Comment" /> + <IncludeRules context="String" /> </context> - + <!-- Camlp4 Quotations. These are source code literals used by the Campl4 preprocessor. --> <!-- The only escapes allowed in a Camlp4 quotation are for the quotation start and stop symbols. --> - <context attribute="Camlp4 Quotation" lineEndContext="#stay" name="Camlp4 Quotation Constant"> - <Detect2Chars attribute="Camlp4 Quotation" context="#pop" char=">" char1=">" /> - <Detect2Chars attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" char="<" char1="<" /> - <RegExpr attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" String="<:&IDENT;<" /> - <RegExpr attribute="Escaped characters" context="#stay" String="\\(\\|>>|<<)" /> - <RegExpr attribute="Escaped characters" context="#stay" String="\\<:&IDENT;<" /> + <context name="Camlp4 Quotation" lineEndContext="#stay" attribute="Camlp4 Quotation"> + <Detect2Chars char=">" char1=">" context="#pop" attribute="Camlp4 Quotation" /> + <Detect2Chars char="<" char1="<" context="Camlp4 Quotation" attribute="Camlp4 Quotation" /> + <RegExpr String="<:&IDENT;<" context="Camlp4 Quotation" attribute="Camlp4 Quotation" /> + <RegExpr String="\\(\\|>>|<<)" context="#stay" attribute="Escaped Characters" /> + <RegExpr String="\\<:&IDENT;<" context="#stay" attribute="Escaped Characters" /> + </context> + + <!-- Ocamldoc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <context name="Ocamldoc" lineEndContext="#stay" attribute="Ocamldoc Text"> + <Detect2Chars char="*" char1=")" context="#pop" attribute="Comment" endRegion="comment" /> + + <!-- A backslash escapes markup characters: --> + <RegExpr String="\\." context="#stay" attribute="Escaped Characters" /> + + <!-- Support for nested comments and strings: --> + <StringDetect String="(**)" context="#stay" attribute="Comment" /> + <StringDetect String="(**" context="Ocamldoc" attribute="Comment" beginRegion="comment" /> + <Detect2Chars char="(" char1="*" context="Comment" attribute="Comment" beginRegion="comment" /> + + <!-- Strings in Ocaml comments must be well-formed: --> + <DetectChar char=""" context="String in Comment" attribute="String in Comment" /> + + <!-- Nested Markup: --> + <DetectChar char="[" context="Ocamldoc Code" attribute="Ocamldoc Markup" /> + <Detect2Chars char="{" char1="[" context="Ocamldoc Preformatted" attribute="Ocamldoc Markup" /> + <Detect2Chars char="{" char1="%" context="Ocamldoc LaTeX" attribute="Ocamldoc Markup" /> + <Detect2Chars char="{" char1="^" context="Nested Ocamldoc" attribute="Ocamldoc Markup" /> + <RegExpr String="[{]v(\s|$)" context="Ocamldoc Verbatim" attribute="Ocamldoc Markup" /> + <RegExpr String="[{]b(\s|$)" context="Ocamldoc Bold" attribute="Ocamldoc Markup" /> + <RegExpr String="[{]i(\s|$)" context="Ocamldoc Italic" attribute="Ocamldoc Markup" /> + <RegExpr String="[{]e(\s|$)" context="Ocamldoc Emphasised" attribute="Ocamldoc Markup" /> + <RegExpr String="[{][0-9]+(:&IDENT;)?\s" context="Ocamldoc Heading" attribute="Ocamldoc Markup" /> + <RegExpr String="[{][{]:&IDENT;[}]" context="Ocamldoc Link" attribute="Ocamldoc Markup" /> + <RegExpr String="[{]!([a-z]+:)?" context="Ocamldoc References" attribute="Ocamldoc Markup" /> + <RegExpr String="[{]&IDENT;(\s|$)" context="Nested Ocamldoc" attribute="Ocamldoc Markup" /> + + <RegExpr String="@see\s*(<[^>]*>|"[^"]*"|'[^']*')" context="#stay" attribute="Ocamldoc Markup" /> + <RegExpr String="@(param|raise)\s*" context="Ocamldoc Identifier" attribute="Ocamldoc Markup" /> + <RegExpr String="@(author|deprecated|return|since|version)" context="#stay" attribute="Ocamldoc Markup" /> + <RegExpr String="@&IDENT;" context="#stay" attribute="Ocamldoc Custom Tag" /> + + + + <!-- A dash at the start of a line is a bullet point. --> + <RegExpr String="^[ 	]*-\s" context="#stay" attribute="Ocamldoc Markup" /> + + <IncludeRules context="Unmatched Closing Brackets" /> + </context> + + <context name="Ocamldoc Code" lineEndContext="#stay" attribute="Operator"> + <DetectChar char="]" context="#pop" attribute="Ocamldoc Markup" /> + <IncludeRules context="Code" includeAttrib="true" /> + </context> + + <context name="Ocamldoc Preformatted" lineEndContext="#stay" attribute="Operator"> + <Detect2Chars char="]" char1="}" context="#pop" attribute="Ocamldoc Markup" /> + <IncludeRules context="Code" includeAttrib="true" /> + </context> + + <context name="Ocamldoc Verbatim" lineEndContext="#stay" attribute="Ocamldoc Text"> + <Detect2Chars char="v" char1="}" context="#pop" attribute="Ocamldoc Markup" /> + </context> + + <context name="Ocamldoc LaTeX" lineEndContext="#stay" attribute="Ocamldoc LaTeX"> + <Detect2Chars char="%" char1="}" context="#pop" attribute="Ocamldoc Markup" /> + <IncludeRules context="##LaTeX" /> + </context> + + <!-- A single qualified Ocaml identifier, perhaps preceeded by whitespace. } --> + <context name="Ocamldoc Identifier" lineEndContext="#stay" attribute="Mismatched Brackets"> + <RegExpr String="&IDENT;(\.&IDENT;)*" context="#pop" attribute="Identifier" /> + <Detect2Chars char="*" char1=")" context="#pop" attribute="Mismatched Brackets" /> + <DetectSpaces /> + </context> + + <context name="Nested Ocamldoc" lineEndContext="#stay" attribute="Operator"> + <DetectChar char="}" context="#pop" attribute="Ocamldoc Markup" /> + <Detect2Chars char="*" char1=")" context="#pop" attribute="Mismatched Brackets" /> + <IncludeRules context="Ocamldoc" includeAttrib="true" /> + </context> + + <context name="Ocamldoc Bold" lineEndContext="#stay" attribute="Ocamldoc Bold"> + <IncludeRules context="Nested Ocamldoc" /> + </context> + + <context name="Ocamldoc Italic" lineEndContext="#stay" attribute="Ocamldoc Italic"> + <IncludeRules context="Nested Ocamldoc" /> + </context> + + <context name="Ocamldoc Emphasised" lineEndContext="#stay" attribute="Ocamldoc Emphasised"> + <IncludeRules context="Nested Ocamldoc" /> + </context> + + <context name="Ocamldoc Heading" lineEndContext="#stay" attribute="Ocamldoc Heading"> + <IncludeRules context="Nested Ocamldoc" /> + </context> + + <context name="Ocamldoc Link" lineEndContext="#stay" attribute="Ocamldoc Link"> + <IncludeRules context="Nested Ocamldoc" /> + </context> + + <!-- A list of qualified Ocaml identifiers, seperated by whitespace and ending with a } --> + <context name="Ocamldoc References" lineEndContext="#stay" attribute="Mismatched Brackets"> + <DetectChar char="}" context="#pop" attribute="Ocamldoc Markup" /> + <Detect2Chars char="*" char1=")" context="#pop" attribute="Mismatched Brackets" /> + <RegExpr String="&IDENT;(\.&IDENT;)*" context="#stay" attribute="Ocamldoc Link" /> + <DetectSpaces context="#stay" attribute="Ocamldoc Markup" /> + </context> + + <!-- Unmatched closing brackets- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <context name="Unmatched Closing Brackets" lineEndContext="#stay" attribute="Operator"> + <Detect2Chars char="*" char1=")" context="#pop" attribute="Mismatched Brackets" /> + <Detect2Chars char="v" char1="}" context="#stay" attribute="Mismatched Brackets" /> + <Detect2Chars char="]" char1="}" context="#stay" attribute="Mismatched Brackets" /> + <Detect2Chars char="%" char1="}" context="#stay" attribute="Mismatched Brackets" /> + <DetectChar char="]" context="#stay" attribute="Mismatched Brackets" /> + <DetectChar char="}" context="#stay" attribute="Mismatched Brackets" /> </context> </contexts> <itemDatas> - <itemData name="Normal Text" defStyleNum="dsNormal"/> - <itemData name="Identifier" defStyleNum="dsNormal"/> - <itemData name="Symbol" defStyleNum="dsNormal"/> - <itemData name="Keyword" defStyleNum="dsKeyword"/> - <itemData name="Revised Syntax Keyword" defStyleNum="dsNormal"/> - <itemData name="Core Data Type" defStyleNum="dsDataType"/> - <itemData name="Decimal" defStyleNum="dsDecVal"/> - <itemData name="Hexadecimal" defStyleNum="dsBaseN"/> - <itemData name="Octal" defStyleNum="dsBaseN"/> - <itemData name="Binary" defStyleNum="dsBaseN"/> - <itemData name="Float" defStyleNum="dsFloat"/> - <itemData name="Character" defStyleNum="dsChar"/> - <itemData name="String" defStyleNum="dsString"/> - <itemData name="Escaped characters" defStyleNum="dsChar"/> - <itemData name="Comment" defStyleNum="dsComment"/> - <itemData name="Camlp4 Quotation" defStyleNum="dsString"/> - <itemData name="Directive" defStyleNum="dsOthers"/> - <itemData name="Constructor" defStyleNum="dsDataType"/> - <itemData name="Module" defStyleNum="dsNormal"/> - <itemData name="Region Marker" defStyleNum="dsKeyword"/> + <itemData name="Operator" defStyleNum="dsNormal" /> + <itemData name="Keyword" defStyleNum="dsKeyword" /> + <itemData name="Revised Syntax Keyword" defStyleNum="dsNormal" /> + <itemData name="Lowercase Identifier" defStyleNum="dsNormal" /> + <itemData name="Uppercase Identifier" defStyleNum="dsNormal" italic="true" /> + + <!-- Lowercase pervasive identifiers: --> + <itemData name="Flow Control Functions" defStyleNum="dsDataType" /> + <itemData name="Pervasive Functions" defStyleNum="dsDataType" /> + <itemData name="Pervasive Types" defStyleNum="dsDataType" /> + + <!-- Uppercase pervasive identifiers: --> + <itemData name="Pervasive Exceptions" defStyleNum="dsDataType" italic="true" /> + <itemData name="Pervasive Variant Tags" defStyleNum="dsDataType" italic="true" /> + <itemData name="Standard Library Modules" defStyleNum="dsDataType" italic="true" /> + + <itemData name="Decimal" defStyleNum="dsDecVal" /> + <itemData name="Hexadecimal" defStyleNum="dsBaseN" /> + <itemData name="Octal" defStyleNum="dsBaseN" /> + <itemData name="Binary" defStyleNum="dsBaseN" /> + <itemData name="Float" defStyleNum="dsFloat" /> + + <itemData name="Character" defStyleNum="dsChar" /> + <itemData name="String" defStyleNum="dsString" /> + <itemData name="Camlp4 Quotation" defStyleNum="dsString" /> + <itemData name="Escaped Characters" defStyleNum="dsChar" /> + + <itemData name="Directive" defStyleNum="dsOthers" /> + + <itemData name="Comment" defStyleNum="dsComment" /> + <itemData name="String in Comment" defStyleNum="dsComment" bold="true" /> + <itemData name="Mismatched Brackets" defStyleNum="dsError" /> + + <itemData name="Ocamldoc Markup" defStyleNum="dsOthers" /> + <itemData name="Ocamldoc Text" defStyleNum="dsComment" italic="false" /> + <itemData name="Ocamldoc Bold" defStyleNum="dsComment" italic="false" bold="true" /> + <itemData name="Ocamldoc Italic" defStyleNum="dsComment" italic="true" bold="false" /> + <itemData name="Ocamldoc Emphasised" defStyleNum="dsComment" italic="true" bold="true" /> + <itemData name="Ocamldoc Heading" defStyleNum="dsComment" italic="false" bold="true" underline="true" /> + <itemData name="Ocamldoc Link" defStyleNum="dsComment" italic="false" underline="true" color="#0000ff" /> + <itemData name="Ocamldoc LaTeX" defStyleNum="dsComment" italic="false" /> + <itemData name="Ocamldoc Custom Tag" defStyleNum="dsOthers" italic="true" /> + + <itemData name="qtest header style" defStyleNum="dsNormal" backgroundColor="#FFEBE0" /> + <itemData name="qtest param style" defStyleNum="dsNormal" italic="true" color="#7788FF" /> + <!-- backgroundColor="#EEEEFF" --> + <itemData name="qtest body style" defStyleNum="dsNormal" bold="true" backgroundColor="#D6FFEB" /> </itemDatas> </highlighting> <general> - <keywords casesensitive="1" /> + <keywords casesensitive="true" /> <comments> - <comment name="multiLine" start="(*" end="*)" /> + <comment name="multiLine" start="(*" end="*)" region ="comment" /> </comments> </general> </language> |