Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "format-3: update (merge the master branch)" #1745

Merged
merged 1 commit into from
Apr 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Tmain/input-encoding-option.d/tags-expected.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
!_TAG_FILE_ENCODING UTF-8 //
!_TAG_FILE_FORMAT 3 /extended format with meta character escaping/
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
!_TAG_PROGRAM_AUTHOR Universal Ctags Team //
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
!_TAG_PROGRAM_URL https://ctags.io/ /official site/
Expand Down
1 change: 1 addition & 0 deletions Tmain/list-pseudo-tags.d/stdout-expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ TAG_FILE_FORMAT on the version of tags file format
TAG_FILE_SORTED on how tags are sorted
TAG_KIND_DESCRIPTION off the letters, names and descriptions of kinds in a parser
TAG_KIND_SEPARATOR off the separators used in kinds
TAG_OUTPUT_MODE on the output mode: u-ctags or e-ctags
TAG_PROGRAM_AUTHOR on the author of this ctags implementation
TAG_PROGRAM_NAME on the name of this ctags implementation
TAG_PROGRAM_URL on the official site URL of this ctags implementation
Expand Down
3 changes: 2 additions & 1 deletion Tmain/output-encoding-option.d/tags-expected.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
!_TAG_FILE_ENCODING cp932 //
!_TAG_FILE_FORMAT 3 /extended format with meta character escaping/
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
!_TAG_PROGRAM_AUTHOR Universal Ctags Team //
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
!_TAG_PROGRAM_URL https://ctags.io/ /official site/
Expand Down
2 changes: 1 addition & 1 deletion Tmain/output-format-option.d/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ CTAGS=$1

. ../utils.sh

run_with_format ctags
run_with_format u-ctags
run_with_format etags
run_with_format xref
2 changes: 1 addition & 1 deletion Tmain/output-format-option.d/stdout-expected.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ctags
# u-ctags
main input.c /^main(void)$/;" f typeref:typename:int
# etags

Expand Down
4 changes: 2 additions & 2 deletions Tmain/output-input-field-with-no-escape.d/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ if ! ( echo '#define foo' > 'a\b.c' ) 2> /dev/null; then
fi

echo '# u-ctags'
${CTAGS} --options=NONE --pseudo-tags=TAG_FILE_FORMAT --extras=+p --format=3 -o - 'a\b.c'
${CTAGS} --options=NONE --pseudo-tags=TAG_OUTPUT_MODE --extras=+p --output-format=u-ctags -o - 'a\b.c'

echo '# e-ctags'
${CTAGS} --options=NONE --pseudo-tags=TAG_FILE_FORMAT --extras=+p --format=2 -o - 'a\b.c'
${CTAGS} --options=NONE --pseudo-tags=TAG_OUTPUT_MODE --extras=+p --output-format=e-ctags -o - 'a\b.c'

rm 'a\b.c'
4 changes: 2 additions & 2 deletions Tmain/output-input-field-with-no-escape.d/stdout-expected.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# u-ctags
!_TAG_FILE_FORMAT 3 /extended format with meta character escaping/
!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
foo a\\b.c /^#define foo$/;" d file:
# e-ctags
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_OUTPUT_MODE e-ctags /u-ctags or e-ctags/
foo a\b.c /^#define foo$/;" d file:
6 changes: 4 additions & 2 deletions Tmain/ptag-kind-desc.d/stdout-expected.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# BUILTIN
!_TAG_FILE_FORMAT 3 /extended format with meta character escaping/
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_KIND_DESCRIPTION!Sh a,alias /aliases/
!_TAG_KIND_DESCRIPTION!Sh f,function /functions/
!_TAG_KIND_DESCRIPTION!Sh h,heredoc /label for here document/
!_TAG_KIND_DESCRIPTION!Sh s,script /script files/
!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
!_TAG_PROGRAM_AUTHOR Universal Ctags Team //
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
!_TAG_PROGRAM_URL https://ctags.io/ /official site/
# REGEX
!_TAG_FILE_FORMAT 3 /extended format with meta character escaping/
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_KIND_DESCRIPTION!foo k,kind /kinds/
!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
!_TAG_PROGRAM_AUTHOR Universal Ctags Team //
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
!_TAG_PROGRAM_URL https://ctags.io/ /official site/
3 changes: 2 additions & 1 deletion Tmain/tags-pseudo-tags.d/stdout-expected.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
!_TAG_FILE_FORMAT 3 /extended format with meta character escaping/
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_KIND_SEPARATOR!PHP :: /*a/
!_TAG_KIND_SEPARATOR!PHP :: /*c/
Expand All @@ -19,6 +19,7 @@
!_TAG_KIND_SEPARATOR!PHP \\ /nn/
!_TAG_KIND_SEPARATOR!PHP \\ /nt/
!_TAG_KIND_SEPARATOR!PHP \\ /nv/
!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
!_TAG_PROGRAM_AUTHOR Universal Ctags Team //
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
!_TAG_PROGRAM_URL https://ctags.io/ /official site/
6 changes: 3 additions & 3 deletions Tmain/xref-ptag-in-list-extras.d/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ CTAGS=$1
O=/tmp/ctags-tmain-$$

echo '#' tags regular file
"${CTAGS}" --options=NONE --output-format=ctags -o $O --list-extras | grep pseudo
"${CTAGS}" --options=NONE --output-format=u-ctags -o $O --list-extras | grep pseudo

echo '#' tags -
"${CTAGS}" --options=NONE --output-format=ctags -o - --list-extras | grep pseudo
"${CTAGS}" --options=NONE --output-format=u-ctags -o - --list-extras | grep pseudo

echo '#' tags NOTHING
"${CTAGS}" --options=NONE --output-format=ctags --list-extras | grep pseudo
"${CTAGS}" --options=NONE --output-format=u-ctags --list-extras | grep pseudo

echo '#' xref regular file
"${CTAGS}" --options=NONE --output-format=xref -o $O --list-extras | grep pseudo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
--extras=+q
--format=2
--extras=+qp
--output-format=e-ctags
--pseudo-tags=TAG_OUTPUT_MODE

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
!_TAG_OUTPUT_MODE e-ctags /u-ctags or e-ctags/
__construct input.php /^ public function __construct() {$/;" f class:foo\bar
bar input.php /^class bar {$/;" c namespace:foo
foo input.php /^namespace foo;$/;" n
Expand Down
5 changes: 2 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ AH_VERBATIM([DEFAULT_FILE_FORMAT], [
/* Define this as desired.
* 1: Original ctags format
* 2: Extended ctags format with extension flags in EX-style comment.
* 3: Use backslash for escaping meta characters like tab
*/
#define DEFAULT_FILE_FORMAT 3
#define DEFAULT_FILE_FORMAT 2
])
AH_TEMPLATE([CASE_INSENSITIVE_FILENAMES],
[Define this label if your system uses case-insensitive file names])
Expand Down Expand Up @@ -170,7 +169,7 @@ AC_ARG_ENABLE(etags,
AC_ARG_ENABLE(extended-format,
[AS_HELP_STRING([--disable-extended-format],
[disable extension flags; use original ctags file format only])],
AC_DEFINE(DEFAULT_FILE_FORMAT, 1), AC_DEFINE(DEFAULT_FILE_FORMAT, 3))
AC_DEFINE(DEFAULT_FILE_FORMAT, 1), AC_DEFINE(DEFAULT_FILE_FORMAT, 2))

AC_ARG_ENABLE(external-sort,
[AS_HELP_STRING([--disable-external-sort],
Expand Down
8 changes: 4 additions & 4 deletions docs/format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,10 @@ Compatible output and weakness

.. NOT REVIEWED YET

Default behavior (``--format=3`` option) has the
exceptions. In other hand, with ``--format=2`` option
Default behavior (``--output-format=u-ctags`` option) has the
exceptions. In other hand, with ``--output-format=e-ctags`` option
ctags has no exception; Universal-ctags command may use the same file
format as Exuberant-ctags. However, ``--format=2`` throws
format as Exuberant-ctags. However, ``--output-format=e-ctags`` throws
away a tag entry which name includes a space or a tab
character. ``TAG_FILE_FORMAT`` pseudo tag tells which format is
character. ``TAG_OUTPUT_MODE`` pseudo tag tells which format is
used when ctags generating tags file.
26 changes: 9 additions & 17 deletions docs/news.rst
Original file line number Diff line number Diff line change
Expand Up @@ -921,23 +921,6 @@ Changes to the tags file format
---------------------------------------------------------------------



version 3 format for handling meta characters in tag entry
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. REVIEWED

To allow recording names including tab characters and other control
characters in a tag file, version 3 of the file format extends version
2 with extra escape sequences.

You can use ``--format=2`` to keep compatibility with the output of
Exuberant-ctags; however, this version of the format cannot record
names which include tab characters.

See also :ref:`Compatible output and weakness <compat-output>`.


Truncating the pattern for long input lines
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To prevent generating overly large tags files, a pattern field is
Expand Down Expand Up @@ -1227,6 +1210,15 @@ The third line means `\\` is used when for combining a namespace item
Of course, ctags uses the more specific line when choosing a
separator; the third line has higher priority than the first.

``TAG_OUTPUT_MODE``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. NOT REVIEWED YET

This pseudo tag represents output mode: u-ctags or e-ctags.

See also :ref:`Compatible output and weakness <compat-output>`.

.. _parser-own-fields:

Parser own fields
Expand Down
1 change: 0 additions & 1 deletion main/entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
*/
#define WHOLE_FILE -1L
#define includeExtensionFlags() (Option.tagFileFormat > 1)
#define escapeMetacharacters() (Option.tagFileFormat > 2)

/*
* DATA DECLARATIONS
Expand Down
Loading