-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tmain: add a case for testing filter function of readtags
Signed-off-by: Masatake YAMATO <[email protected]>
- Loading branch information
Showing
6 changed files
with
108 additions
and
0 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,28 @@ | ||
# | ||
# ./ctags --fields='*' --extra='*' -o output.tags base.py | ||
# | ||
class Foo: | ||
def aq (): | ||
pass | ||
def aw (): | ||
pass | ||
def ae (): | ||
pass | ||
class A: | ||
pass | ||
class Bar (Foo): | ||
def bq (): | ||
pass | ||
def bw (): | ||
pass | ||
class B: | ||
pass | ||
|
||
class Baz (Foo): | ||
def bq (): | ||
pass | ||
def bw (): | ||
pass | ||
class C: | ||
pass | ||
|
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,27 @@ | ||
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ | ||
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ | ||
!_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 0.0.0 /bbd8fc2/ | ||
A base.py /^ class A:$/;" kind:class line:11 language:Python scope:class:Foo inherits: access:public | ||
B base.py /^ class B:$/;" kind:class line:18 language:Python scope:class:Bar inherits: access:public | ||
Bar base.py /^class Bar (Foo):$/;" kind:class line:13 language:Python inherits:Foo access:public | ||
Bar.bq base.py /^ def bq ():$/;" kind:member line:14 language:Python scope:class:Bar access:public signature:() | ||
Bar.bw base.py /^ def bw ():$/;" kind:member line:16 language:Python scope:class:Bar access:public signature:() | ||
Baz base.py /^class Baz (Foo): $/;" kind:class line:21 language:Python inherits:Foo access:public | ||
Baz.bq base.py /^ def bq ():$/;" kind:member line:22 language:Python scope:class:Baz access:public signature:() | ||
Baz.bw base.py /^ def bw ():$/;" kind:member line:24 language:Python scope:class:Baz access:public signature:() | ||
C base.py /^ class C:$/;" kind:class line:26 language:Python scope:class:Baz inherits: access:public | ||
Foo base.py /^class Foo:$/;" kind:class line:4 language:Python inherits: access:public | ||
Foo.ae base.py /^ def ae ():$/;" kind:member line:9 language:Python scope:class:Foo access:public signature:() | ||
Foo.aq base.py /^ def aq ():$/;" kind:member line:5 language:Python scope:class:Foo access:public signature:() | ||
Foo.aw base.py /^ def aw ():$/;" kind:member line:7 language:Python scope:class:Foo access:public signature:() | ||
ae base.py /^ def ae ():$/;" kind:member line:9 language:Python scope:class:Foo access:public signature:() | ||
aq base.py /^ def aq ():$/;" kind:member line:5 language:Python scope:class:Foo access:public signature:() | ||
aw base.py /^ def aw ():$/;" kind:member line:7 language:Python scope:class:Foo access:public signature:() | ||
base.py base.py 28;" kind:file line:28 language:Python | ||
bq base.py /^ def bq ():$/;" kind:member line:14 language:Python scope:class:Bar access:public signature:() | ||
bq base.py /^ def bq ():$/;" kind:member line:22 language:Python scope:class:Baz access:public signature:() | ||
bw base.py /^ def bw ():$/;" kind:member line:16 language:Python scope:class:Bar access:public signature:() | ||
bw base.py /^ def bw ():$/;" kind:member line:24 language:Python scope:class:Baz access:public signature:() |
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,29 @@ | ||
#!/bin/sh | ||
|
||
# Copyright: 2016 Masatake YAMATO | ||
# License: GPL-2 | ||
|
||
READTAGS=$4 | ||
|
||
#V="valgrind --leak-check=full -v" | ||
V= | ||
|
||
if ! [ -x "${READTAGS}" ]; then | ||
echo "no readtags" | ||
eixt 77 | ||
fi | ||
|
||
if ! ( "${READTAGS}" -h | grep -q -e -Q ); then | ||
echo "no qualifier function in readtags" | ||
exit 77 | ||
fi | ||
|
||
echo ';; (suffix? $name "q")' && | ||
${V} ${READTAGS} -e -t output.tags -Q '(suffix? $name "q")' -l && | ||
echo ';; (and (eq? $kind "member") (eq? "Baz" $scope-name))' && | ||
${V} ${READTAGS} -e -t output.tags -Q '(and (eq? $kind "member") (eq? "Baz" $scope-name))' -l && | ||
echo ';; (and (eq? $kind "member") (substr? $name "."))' && | ||
${V} ${READTAGS} -e -t output.tags -Q '(and (eq? $kind "member") (substr? $name "."))' -l && | ||
echo ';; (and (member "Foo" $inherits) (eq? $kind "class"))' && | ||
${V} ${READTAGS} -e -t output.tags -Q '(and (member "Foo" $inherits) (eq? $kind "class"))' -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,23 @@ | ||
;; (suffix? $name "q") | ||
Bar.bq base.py /^ def bq ():$/;" kind:member language:Python scope:class:Bar access:public signature:() | ||
Baz.bq base.py /^ def bq ():$/;" kind:member language:Python scope:class:Baz access:public signature:() | ||
Foo.aq base.py /^ def aq ():$/;" kind:member language:Python scope:class:Foo access:public signature:() | ||
aq base.py /^ def aq ():$/;" kind:member language:Python scope:class:Foo access:public signature:() | ||
bq base.py /^ def bq ():$/;" kind:member language:Python scope:class:Bar access:public signature:() | ||
bq base.py /^ def bq ():$/;" kind:member language:Python scope:class:Baz access:public signature:() | ||
;; (and (eq? $kind "member") (eq? "Baz" $scope-name)) | ||
Baz.bq base.py /^ def bq ():$/;" kind:member language:Python scope:class:Baz access:public signature:() | ||
Baz.bw base.py /^ def bw ():$/;" kind:member language:Python scope:class:Baz access:public signature:() | ||
bq base.py /^ def bq ():$/;" kind:member language:Python scope:class:Baz access:public signature:() | ||
bw base.py /^ def bw ():$/;" kind:member language:Python scope:class:Baz access:public signature:() | ||
;; (and (eq? $kind "member") (substr? $name ".")) | ||
Bar.bq base.py /^ def bq ():$/;" kind:member language:Python scope:class:Bar access:public signature:() | ||
Bar.bw base.py /^ def bw ():$/;" kind:member language:Python scope:class:Bar access:public signature:() | ||
Baz.bq base.py /^ def bq ():$/;" kind:member language:Python scope:class:Baz access:public signature:() | ||
Baz.bw base.py /^ def bw ():$/;" kind:member language:Python scope:class:Baz access:public signature:() | ||
Foo.ae base.py /^ def ae ():$/;" kind:member language:Python scope:class:Foo access:public signature:() | ||
Foo.aq base.py /^ def aq ():$/;" kind:member language:Python scope:class:Foo access:public signature:() | ||
Foo.aw base.py /^ def aw ():$/;" kind:member language:Python scope:class:Foo access:public signature:() | ||
;; (and (member "Foo" $inherits) (eq? $kind "class")) | ||
Bar base.py /^class Bar (Foo):$/;" kind:class language:Python inherits:Foo access:public | ||
Baz base.py /^class Baz (Foo): $/;" kind:class language:Python inherits:Foo access:public |