-
Notifications
You must be signed in to change notification settings - Fork 629
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4022 from masatake/readtags--minor-fix-cmd_or
readtags: mark <or> as a specfial form
- Loading branch information
Showing
10 changed files
with
100 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
How to generate output.tags:: | ||
|
||
ctags --kinds-C=+p -o output.tags input.d/foo.c input.d/bar.c input.d/decl.h | ||
|
||
This is taken from https://github.com/universal-ctags/ctags/issues/4015#issuecomment-2157023359 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
void bar(void); | ||
void bar(void) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
void foo(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
void foo(void) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
!_TAG_EXTRA_DESCRIPTION anonymous /Include tags for non-named objects like lambda/ | ||
!_TAG_EXTRA_DESCRIPTION fileScope /Include tags of file scope/ | ||
!_TAG_EXTRA_DESCRIPTION pseudo /Include pseudo tags/ | ||
!_TAG_EXTRA_DESCRIPTION subparser /Include tags generated by subparsers/ | ||
!_TAG_FIELD_DESCRIPTION epoch /the last modified time of the input file (only for F\/file kind tag)/ | ||
!_TAG_FIELD_DESCRIPTION file /File-restricted scoping/ | ||
!_TAG_FIELD_DESCRIPTION input /input file/ | ||
!_TAG_FIELD_DESCRIPTION name /tag name/ | ||
!_TAG_FIELD_DESCRIPTION pattern /pattern/ | ||
!_TAG_FIELD_DESCRIPTION typeref /Type and name of a variable or typedef/ | ||
!_TAG_FIELD_DESCRIPTION!C++ name /aliased names/ | ||
!_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!C d,macro /macro definitions/ | ||
!_TAG_KIND_DESCRIPTION!C e,enumerator /enumerators (values inside an enumeration)/ | ||
!_TAG_KIND_DESCRIPTION!C f,function /function definitions/ | ||
!_TAG_KIND_DESCRIPTION!C g,enum /enumeration names/ | ||
!_TAG_KIND_DESCRIPTION!C h,header /included header files/ | ||
!_TAG_KIND_DESCRIPTION!C m,member /struct, and union members/ | ||
!_TAG_KIND_DESCRIPTION!C p,prototype /function prototypes/ | ||
!_TAG_KIND_DESCRIPTION!C s,struct /structure names/ | ||
!_TAG_KIND_DESCRIPTION!C t,typedef /typedefs/ | ||
!_TAG_KIND_DESCRIPTION!C u,union /union names/ | ||
!_TAG_KIND_DESCRIPTION!C v,variable /variable definitions/ | ||
!_TAG_KIND_DESCRIPTION!C++ c,class /classes/ | ||
!_TAG_KIND_DESCRIPTION!C++ d,macro /macro definitions/ | ||
!_TAG_KIND_DESCRIPTION!C++ e,enumerator /enumerators (values inside an enumeration)/ | ||
!_TAG_KIND_DESCRIPTION!C++ f,function /function definitions/ | ||
!_TAG_KIND_DESCRIPTION!C++ g,enum /enumeration names/ | ||
!_TAG_KIND_DESCRIPTION!C++ h,header /included header files/ | ||
!_TAG_KIND_DESCRIPTION!C++ m,member /class, struct, and union members/ | ||
!_TAG_KIND_DESCRIPTION!C++ n,namespace /namespaces/ | ||
!_TAG_KIND_DESCRIPTION!C++ p,prototype /function prototypes/ | ||
!_TAG_KIND_DESCRIPTION!C++ s,struct /structure names/ | ||
!_TAG_KIND_DESCRIPTION!C++ t,typedef /typedefs/ | ||
!_TAG_KIND_DESCRIPTION!C++ u,union /union names/ | ||
!_TAG_KIND_DESCRIPTION!C++ v,variable /variable definitions/ | ||
!_TAG_OUTPUT_EXCMD mixed /number, pattern, mixed, or combineV2/ | ||
!_TAG_OUTPUT_FILESEP slash /slash or backslash/ | ||
!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ | ||
!_TAG_OUTPUT_VERSION 0.0 /current.age/ | ||
!_TAG_PARSER_VERSION!C 0.0 /current.age/ | ||
!_TAG_PARSER_VERSION!C++ 0.0 /current.age/ | ||
!_TAG_PATTERN_LENGTH_LIMIT 96 /0 for no limit/ | ||
!_TAG_PROC_CWD /home/yamato/var/ctags-github/Tmain/readtags-sorter-if3-sform.d/ // | ||
!_TAG_PROGRAM_AUTHOR Universal Ctags Team // | ||
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ | ||
!_TAG_PROGRAM_URL https://ctags.io/ /official site/ | ||
!_TAG_PROGRAM_VERSION 6.0.0 // | ||
!_TAG_ROLE_DESCRIPTION!C!header local /local header/ | ||
!_TAG_ROLE_DESCRIPTION!C!header system /system header/ | ||
!_TAG_ROLE_DESCRIPTION!C!macro undef /undefined/ | ||
!_TAG_ROLE_DESCRIPTION!C++!header local /local header/ | ||
!_TAG_ROLE_DESCRIPTION!C++!header system /system header/ | ||
!_TAG_ROLE_DESCRIPTION!C++!macro undef /undefined/ | ||
bar input.d/bar.c /^void bar(void) {}$/;" f typeref:typename:void | ||
bar input.d/bar.c /^void bar(void);$/;" p typeref:typename:void file: | ||
foo input.d/decl.h /^void foo(void);$/;" p typeref:typename:void | ||
foo input.d/foo.c /^void foo(void) {}$/;" f typeref:typename:void |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
# Copyright: 2024 Masatake YAMATO | ||
# License: GPL-2 | ||
|
||
READTAGS=$3 | ||
|
||
. ../utils.sh | ||
|
||
#V="valgrind --leak-check=full -v" | ||
V= | ||
|
||
if ! [ -x "${READTAGS}" ]; then | ||
skip "no readtags" | ||
fi | ||
|
||
if ! ( "${READTAGS}" -h | grep -q -e -S ); then | ||
skip "no sorter function in readtags" | ||
fi | ||
|
||
ERRLOG=/tmp/ctags-Tmain-$$ | ||
${READTAGS} -et output.tags -S ' | ||
(<or> (<> $name &name) | ||
(and (eq? $kind "p") (eq? &kind "f") 1) | ||
(and (eq? $kind "f") (eq? &kind "p") -1))' -l |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
bar input.d/bar.c /^void bar(void) {}$/;" kind:f typeref:typename:void | ||
bar input.d/bar.c /^void bar(void);$/;" kind:p file: typeref:typename:void | ||
foo input.d/foo.c /^void foo(void) {}$/;" kind:f typeref:typename:void | ||
foo input.d/decl.h /^void foo(void);$/;" kind:p typeref:typename:void |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters