Warning, /graphics/digikam/core/utilities/advancedrename/README is written in an unsupported language. File is not indexed.
0001 ------------------------------------------------------------------------------
0002 1. NAMING CONVENTIONS FOR SYNTAX HIGHLIGHTING
0003 ------------------------------------------------------------------------------
0004
0005 When creating new options or modifiers for a parser, you should follow
0006 this naming convention. It is possible to completely ignore
0007 these suggestions, the basic highlighting should still work.
0008 Nevertheless it would be nice to have options and modifiers look equal.
0009
0010 -------------------------
0011
0012 1.1 Options
0013
0014 Options should be enclosed in [ ] characters:
0015
0016 [option]
0017
0018 If a renaming option takes additional parameters, they should be appended by a colon:
0019
0020 [option:parameters]
0021
0022
0023 -------------------------
0024
0025 1.2 Modifiers
0026
0027 Modifiers should be enclosed in { } characters:
0028
0029 {modifier}
0030
0031 If a modifier takes additional parameters, they should be appended by a colon:
0032
0033 {modifier:parameters}
0034
0035
0036 -------------------------
0037
0038 1.3 Textual parameters
0039
0040 If you are using strings as parameters for either options or modifiers, enclose them in
0041 double-quote characters:
0042
0043 "quoted text"
0044
0045 ------------------------------------------------------------------------------
0046 2. REGULAR EXPRESSIONS CONVENTIONS
0047 ------------------------------------------------------------------------------
0048
0049 To highlight parameters correctly in an option or modifier, whenever possible,
0050 try to enclose the whole optional parameter list with a parentheses, including the
0051 colon, to make it the first matching group in the regular expression. For example:
0052
0053 QRegExp reg("\\[date(:(.*))\\]");
0054 or
0055 QRegExp reg("\\[date(:(.*))?\\]");
0056
0057 The syntax highlighter tries to extract the first matching group and applies a
0058 different color to it.