forked from universal-ctags/ctags
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dsl: allow to specify a default value in $ and & operators
$ and & return #f if a specified field is not found in a tag. With this change, you can make the operators return a value other than #f in the situation. You can write ($ field default-value) as a shorthand of (or ($ field) default-value) . Signed-off-by: Masatake YAMATO <[email protected]>
- Loading branch information
Showing
8 changed files
with
112 additions
and
6 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 @@ | ||
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,15 @@ | ||
/* ctags -o output.tags --fields-C=+'{properties}' input.c */ | ||
static int a(void) | ||
{ | ||
return 0; | ||
} | ||
|
||
inline int b(void) | ||
{ | ||
return 0; | ||
} | ||
|
||
int c(void) | ||
{ | ||
return 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,40 @@ | ||
!_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 properties /properties (static, inline, mutable,...)/ | ||
!_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 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_PATTERN_LENGTH_LIMIT 96 /0 for no limit/ | ||
!_TAG_PROC_CWD /home/yamato/var/ctags-github/Tmain/readtags-default-field-val.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/ | ||
a input.c /^static int a(void)$/;" f typeref:typename:int file: properties:static | ||
b input.c /^inline int b(void)$/;" f typeref:typename:int properties:inline | ||
c input.c /^int c(void)$/;" f typeref:typename:int |
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 -Q ); then | ||
skip "no qualifier function in readtags" | ||
fi | ||
|
||
# ?a | ||
# 97 | ||
# (format "%c" 96) | ||
# => ` | ||
"${READTAGS}" -t output.tags -S '(<> ($ "properties" "`") (& "properties" "`"))' -F '(list $name " " ($ "properties" "noprop") #t)' -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,3 @@ | ||
c noprop | ||
b inline | ||
a static |
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
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