Skip to content

Commit

Permalink
Merge pull request universal-ctags#1755 from masatake/misc-changes
Browse files Browse the repository at this point in the history
Misc changes
  • Loading branch information
masatake authored May 19, 2018
2 parents 6418097 + d3f580e commit bf8aa43
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 18 deletions.
22 changes: 13 additions & 9 deletions docs/format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ Proposal for extended Vi tags file format

The contents of next section is a copy of FORMAT file in exuberant
ctags source code in its subversion repository at sourceforge.net.
I(Masatake YAMATO) changed only its format in the most of all
parts. I added a subsection for showing the position of universal
ctags.

We have made some modifications:

* Exceptions introduced in Universal-ctags are explained with
"EXCEPTION" marker.

* `Exceptions in Universal-ctags`_ subsction summarizes the exceptions.

.. contents:: `Table of contents`
:depth: 3
Expand Down Expand Up @@ -100,7 +104,7 @@ This restricts the format to what Vi can handle. The format is:
{tagname}
Any identifier, not containing white space..

EXCEPTION: Universal ctags violates this item of the proposal;
EXCEPTION: Universal-ctags violates this item of the proposal;
tagname may contain spaces. However, tabs are not allowed.

<Tab>
Expand Down Expand Up @@ -223,7 +227,7 @@ Use a comment after the {tagaddress} field. The format would be::
{tagname}
Any identifier, not containing white space..

EXCEPTION: Universal ctags violates this item of the proposal;
EXCEPTION: Universal-ctags violates this item of the proposal;
name may contain spaces. However, tabs are not allowed.
Conversion, for some characters including <Tab> in the "value",
explained in the last of this section is applied.
Expand Down Expand Up @@ -268,7 +272,7 @@ A tagfield has a name, a colon, and a value: "name:value".
Warning: When a tagfield value holds an MS-DOS file name, the backslashes
must be doubled!

EXCEPTION: Universal ctags introduces more conversion rules.
EXCEPTION: Universal-ctags introduces more conversion rules.

- When a value contains a "\\a", this stands for a <BEL> (0x07).
- When a value contains a "\\b", this stands for a <BS> (0x08).
Expand Down Expand Up @@ -462,17 +466,17 @@ file, and provided solely for documentation purposes::
!_TAG_PROGRAM_URL {URL} /optional comment/
!_TAG_PROGRAM_VERSION {version-id} /optional comment/

Universal ctags
Exceptions in Universal-ctags
--------------------------------

Universal ctags supports this proposal with some
Universal-ctags supports this proposal with some
exceptions.


Exceptions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#. {tagname} in tags file generated by Universal ctags may contain
#. {tagname} in tags file generated by Universal-ctags may contain
spaces and several escape sequences. Parsers for documents like Tex and
reStructuredText, or liberal languages such as JavaScript need these
exceptions. See {tagname} of Proposal section for more detail about the
Expand Down
6 changes: 6 additions & 0 deletions main/lregex.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,12 @@ static bool parseTagRegex (
error (WARNING, "%s: regexp missing final separator", regexp);
else
{
/*
* first----------V third------------V
* --regex-<LANG>=/regexp/replacement/[kind-spec/][flags]
* second----------------^ fourth---------------^
*/

char* const fourth = scanSeparators (third, false);
if (*fourth == separator)
{
Expand Down
14 changes: 7 additions & 7 deletions main/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -2146,13 +2146,13 @@ static flagDefinition PreKindDefFlagDef [] = {

static bool processLangDefineKind(const langType language,
const char *const option,
const char *const parameterx)
const char *const parameter)
{
parserObject *parser;

kindDefinition *kdef;
int letter;
const char * p = parameterx;
const char * p = parameter;
char *name;
char *description;
const char *tmp_start;
Expand Down Expand Up @@ -2246,14 +2246,14 @@ static void freeRdef (roleDefinition *rdef)

static bool processLangDefineRole(const langType language,
const char *const option,
const char *const parameterx)
const char *const parameter)
{
parserObject *parser;

kindDefinition *kdef;
roleDefinition *rdef;
int kletter;
const char * p = parameterx;
const char * p = parameter;
char *name;
char *description;
const char *tmp_start;
Expand Down Expand Up @@ -2855,10 +2855,10 @@ static void xtagDefinitionDestroy (xtagDefinition *xdef)

static bool processLangDefineExtra (const langType language,
const char *const option,
const char *const parameterx)
const char *const parameter)
{
xtagDefinition *xdef;
const char * p = parameterx;
const char * p = parameter;
const char *name_end;
const char *desc;
const char *flags;
Expand Down Expand Up @@ -2891,7 +2891,7 @@ static bool processLangDefineExtra (const langType language,
xdef = xCalloc (1, xtagDefinition);
xdef->enabled = false;
xdef->letter = NUL_XTAG_LETTER;
xdef->name = eStrndup (parameterx, name_end - parameterx);
xdef->name = eStrndup (parameter, name_end - parameter);
xdef->description = desc;
xdef->isEnabled = NULL;
DEFAULT_TRASH_BOX(xdef, xtagDefinitionDestroy);
Expand Down
2 changes: 1 addition & 1 deletion man/ctags.1.rst.in
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,7 @@ file
kind
Indicates the type, or kind, of tag. Its value is either one of the
corresponding one-letter flags described under the various
``--<LANG>-kinds`` options above, or a full name. It is permitted
``--kinds-<LANG>`` options above, or a full name. It is permitted
(and is, in fact, the default) for the key portion of this field to be
omitted. The optional behaviors are controlled with the ``--fields`` option.

Expand Down
2 changes: 1 addition & 1 deletion misc/budge
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ while [ $# -gt 0 ]; do
shift
done

CMDLINE="${CTAGS_TEST} --quiet --options=NONE -G --options=./.ctags --languages=all --options=misc/budge.ctags -R --print-language"
CMDLINE="${CTAGS_TEST} --quiet --options=NONE -G --options-maybe=./.ctags.d --languages=all --options-maybe=misc/budge.ctags -R --print-language"
ALL_FILES=$(git ls-files)

TOTAL=0
Expand Down

0 comments on commit bf8aa43

Please sign in to comment.