Skip to content

Commit 1038f51

Browse files
committed
docs(man): write about {mgroup=m} of --mline-regex-<LANG> option
1 parent ad1e508 commit 1038f51

File tree

2 files changed

+40
-6
lines changed

2 files changed

+40
-6
lines changed

docs/man/ctags-optlib.7.rst

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Following options are for defining (or customizing) a parser:
3434
* ``--map-<LANG>=[+|-]<extension>|<pattern>``
3535
* ``--kinddef-<LANG>=<letter>,<name>,<description>``
3636
* ``--regex-<LANG>=/<line_pattern>/<name_pattern>/<kind-spec>/[<flags>]``
37-
* ``--mline-regex-<LANG>=/<line_pattern>/<name_pattern>/<kind-spec>/[<flags>]``
37+
* ``--mline-regex-<LANG>=/<line_pattern>/<name_pattern>/<kind-spec>/{mgroup=<N>}[<flags>]``
3838

3939
Following options are for controlling loading parser definition:
4040

@@ -117,7 +117,7 @@ Overview for defining a parser
117117

118118
Use ``--regex-<LANG>=/<line_pattern>/<name_pattern>/<kind-spec>/[<flags>]``
119119
option for a single-line regular expression. You can also use
120-
``--mline-regex-<LANG>=/<line_pattern>/<name_pattern>/<kind-spec>/[<flags>]``
120+
``--mline-regex-<LANG>=/<line_pattern>/<name_pattern>/<kind-spec>/{mgroup=<N>}[<flags>]``
121121
option for a multi-line regular expression.
122122

123123
As *<kind-spec>*, you can use the one-letter flag defined with
@@ -271,12 +271,15 @@ OPTIONS
271271
``--list-mline-regex-flags``
272272
Lists the flags that can be used in ``--mline-regex-<LANG>`` option.
273273

274-
``--mline-regex-<LANG>=/<line_pattern>/<name_pattern>/<kind-spec>/[<flags>]``
274+
``--mline-regex-<LANG>=/<line_pattern>/<name_pattern>/<kind-spec>/{mgroup=<N>}[<flags>]``
275275
Define a multi-line regular expression.
276276

277277
This option is similar to ``--regex-<LANG>`` option except the pattern is
278278
applied to the whole file’s contents, not line by line.
279279

280+
See "`FLAGS FOR ``--mline-regex-<LANG>`` OPTION`_" about ``{mgroup=<N>}``.
281+
``{mgroup=<N>}`` flag is a must.
282+
280283
``--_echo=<message>``
281284
Print *<message>* to the standard error stream. This is helpful to
282285
understand (and debug) optlib loading feature of Universal Ctags.
@@ -405,6 +408,20 @@ representation. ``--list-regex-flags`` lists all the flags.
405408
``fatal=<message>``
406409
print the given *<message>* and exit
407410

411+
FLAGS FOR ``--mline-regex-<LANG>`` OPTION
412+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
413+
414+
``mgroup=<N>``
415+
416+
decide the location of the tag extracted with
417+
``--mline-regex-<LANG>`` option.
418+
419+
*<N>* is the number of a capture group in the pattern, which is
420+
used to record the line number location of the tag. ``mgroup=<N>``
421+
flag is not an optional. You **must** add an ``mgroup=<N>`` flag,
422+
even if the *<N>* is ``0`` (meaning the start position of the
423+
whole regex pattern).
424+
408425
EXAMPLES
409426
-------------
410427

man/ctags-optlib.7.rst.in

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Following options are for defining (or customizing) a parser:
3434
* ``--map-<LANG>=[+|-]<extension>|<pattern>``
3535
* ``--kinddef-<LANG>=<letter>,<name>,<description>``
3636
* ``--regex-<LANG>=/<line_pattern>/<name_pattern>/<kind-spec>/[<flags>]``
37-
* ``--mline-regex-<LANG>=/<line_pattern>/<name_pattern>/<kind-spec>/[<flags>]``
37+
* ``--mline-regex-<LANG>=/<line_pattern>/<name_pattern>/<kind-spec>/{mgroup=<N>}[<flags>]``
3838

3939
Following options are for controlling loading parser definition:
4040

@@ -117,7 +117,7 @@ Overview for defining a parser
117117

118118
Use ``--regex-<LANG>=/<line_pattern>/<name_pattern>/<kind-spec>/[<flags>]``
119119
option for a single-line regular expression. You can also use
120-
``--mline-regex-<LANG>=/<line_pattern>/<name_pattern>/<kind-spec>/[<flags>]``
120+
``--mline-regex-<LANG>=/<line_pattern>/<name_pattern>/<kind-spec>/{mgroup=<N>}[<flags>]``
121121
option for a multi-line regular expression.
122122

123123
As *<kind-spec>*, you can use the one-letter flag defined with
@@ -271,12 +271,15 @@ OPTIONS
271271
``--list-mline-regex-flags``
272272
Lists the flags that can be used in ``--mline-regex-<LANG>`` option.
273273

274-
``--mline-regex-<LANG>=/<line_pattern>/<name_pattern>/<kind-spec>/[<flags>]``
274+
``--mline-regex-<LANG>=/<line_pattern>/<name_pattern>/<kind-spec>/{mgroup=<N>}[<flags>]``
275275
Define a multi-line regular expression.
276276

277277
This option is similar to ``--regex-<LANG>`` option except the pattern is
278278
applied to the whole file’s contents, not line by line.
279279

280+
See "`FLAGS FOR ``--mline-regex-<LANG>`` OPTION`_" about ``{mgroup=<N>}``.
281+
``{mgroup=<N>}`` flag is a must.
282+
280283
``--_echo=<message>``
281284
Print *<message>* to the standard error stream. This is helpful to
282285
understand (and debug) optlib loading feature of Universal Ctags.
@@ -405,6 +408,20 @@ representation. ``--list-regex-flags`` lists all the flags.
405408
``fatal=<message>``
406409
print the given *<message>* and exit
407410

411+
FLAGS FOR ``--mline-regex-<LANG>`` OPTION
412+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
413+
414+
``mgroup=<N>``
415+
416+
decide the location of the tag extracted with
417+
``--mline-regex-<LANG>`` option.
418+
419+
*<N>* is the number of a capture group in the pattern, which is
420+
used to record the line number location of the tag. ``mgroup=<N>``
421+
flag is not an optional. You **must** add an ``mgroup=<N>`` flag,
422+
even if the *<N>* is ``0`` (meaning the start position of the
423+
whole regex pattern).
424+
408425
EXAMPLES
409426
-------------
410427

0 commit comments

Comments
 (0)