-
Notifications
You must be signed in to change notification settings - Fork 628
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 #4059 from masatake/main--extras-and-fields-in-for…
…eign-language Main: use extras and fields in the foreign language specified in {_language=...} flag
- Loading branch information
Showing
22 changed files
with
151 additions
and
12 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
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
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,17 @@ | ||
# Copyright: 2024 Masatake YAMATO | ||
# License: GPL-2 | ||
|
||
. ../utils.sh | ||
|
||
CTAGS=$1 | ||
|
||
V= | ||
# V=valgrind | ||
|
||
${V} ${CTAGS} --quiet --options=NONE \ | ||
\ | ||
--langdef=NOSUCHLANG'{_foreignLanguage=Kconfig}' \ | ||
--_extradef-NOSUCHLANG='NOSUCHEXTRA,but this is not the part of Kconfig' \ | ||
--regex-NOSUCHLANG='/^\# (CONFIG_[^ ]+) is not set/\1/c/{_language=Kconfig}{_extra=NOSUCHEXTRA}{exclusive}' \ | ||
\ | ||
--_force-quit=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 @@ | ||
ctags: Warning: no such extra "NOSUCHEXTRA" in Kconfig |
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,17 @@ | ||
# Copyright: 2024 Masatake YAMATO | ||
# License: GPL-2 | ||
|
||
. ../utils.sh | ||
|
||
CTAGS=$1 | ||
|
||
V= | ||
# V=valgrind | ||
|
||
${V} ${CTAGS} --quiet --options=NONE \ | ||
\ | ||
--langdef=NOSUCHLANG'{_foreignLanguage=Kconfig}' \ | ||
--_fielddef-NOSUCHLANG='NOSUCHFIELD,but this is not the part of Kconfig' \ | ||
--regex-NOSUCHLANG='/^\# (CONFIG_[^ ]+) is (not set)/\1/c/{_language=Kconfig}{_field=NOSUCHFIELD:\1}{exclusive}' \ | ||
\ | ||
--_force-quit=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 @@ | ||
ctags: Warning: no such field "NOSUCHFIELD" in Kconfig |
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 @@ | ||
D:def00 | ||
d:def01 | ||
v:var0 |
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 @@ | ||
D:def10 | ||
d:def11 | ||
v:var1 |
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,17 @@ | ||
# Copyright: 2024 Masatake YAMATO | ||
# License: GPL-2 | ||
|
||
. ../utils.sh | ||
|
||
CTAGS=$1 | ||
|
||
V= | ||
# V=valgrind | ||
|
||
printf "# %s\n" --extras-X0=+'{iname}' | ||
${V} ${CTAGS} --quiet --options=NONE --options=./x0.ctags --options=./x1.ctags \ | ||
--extras-X0=+'{iname}' --fields=+'{extras}{language}' -o - input-0.x1 | ||
|
||
printf "# %s\n" --extras-X0=-'{iname}' | ||
${V} ${CTAGS} --quiet --options=NONE --options=./x0.ctags --options=./x1.ctags \ | ||
--extras-X0=-'{iname}' --fields=+'{extras}{language}' -o - input-1.x1 |
Empty file.
7 changes: 7 additions & 0 deletions
7
Tmain/parser-own-extras-for-foreign-lang.d/stdout-expected.txt
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,7 @@ | ||
# --extras-X0=+{iname} | ||
__def01__ input-0.x1 /^d:def01$/;" d language:X0 extras:iname | ||
def00 input-0.x1 /^D:def00$/;" d language:X0 | ||
var0 input-0.x1 /^v:var0$/;" v language:X1 | ||
# --extras-X0=-{iname} | ||
def10 input-1.x1 /^D:def10$/;" d language:X0 | ||
var1 input-1.x1 /^v:var1$/;" v language:X1 |
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 @@ | ||
--langdef=X0 | ||
--kinddef-X0=d,def,definitions | ||
--_extradef-X0=iname,internal name like __x__ |
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,6 @@ | ||
--langdef=X1{_foreignLanguage=X0} | ||
--map-X1=+.x1 | ||
--kinddef-X1=v,var,variables | ||
--regex-X1=/D:([a-z0-9]+)$/\1/d/{_language=X0} | ||
--regex-X1=/d:([a-z0-9]+)$/__\1__/d/{_language=X0}{_extra=iname} | ||
--regex-X1=/v:([a-z0-9]+)$/\1/v/ |
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 @@ | ||
public func foo(n, m); | ||
protected func bar(n); | ||
private func baz(n,...); | ||
X:tagme@iamowner | ||
Y:iamowner2=tagme2 |
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 @@ | ||
--langdef=knownz | ||
--kinddef-knownz=m,mark,makers | ||
|
||
--_fielddef-knownz=owner,the owner of the markers |
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 @@ | ||
# Copyright: 2024 Masatake YAMATO | ||
# License: GPL-2 | ||
|
||
. ../utils.sh | ||
|
||
CTAGS=$1 | ||
|
||
V= | ||
# V=valgrind | ||
|
||
${V} ${CTAGS} --options=NONE --options=./knownz.ctags --options=./unknownx.ctags \ | ||
--fields=+l \ | ||
--fields-unknownx=+'{protection}{signature}' \ | ||
--fields-knownz=+'{owner}' \ | ||
-o - input.unknownx |
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 @@ | ||
ctags: Notice: No options will be read from files or environment |
5 changes: 5 additions & 0 deletions
5
Tmain/parser-own-fields-for-foreign-lang.d/stdout-expected.txt
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 @@ | ||
bar input.unknownx /^protected func bar(n);$/;" f language:unknownx protection:protected signature:(n) | ||
baz input.unknownx /^private func baz(n,...);$/;" f language:unknownx protection:private signature:(n,...) | ||
foo input.unknownx /^public func foo(n, m);$/;" f language:unknownx protection:public signature:(n, m) | ||
tagme input.unknownx /^X:tagme@iamowner$/;" m language:knownz owner:iamowner | ||
tagme2 input.unknownx /^Y:iamowner2=tagme2$/;" m language:knownz owner:iamowner2 |
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,10 @@ | ||
--langdef=unknownx{_foreignLanguage=knownz} | ||
--kinddef-unknownx=f,func,functions | ||
--map-unknownx=+.unknownx | ||
|
||
--_fielddef-unknownx=protection,protections | ||
--_fielddef-unknownx=signature,signatures | ||
|
||
--regex-unknownx=/^((public|protected|private) +)?func ([^\(]+)\((.*)\)/\3/f/{_field=protection:\1}{_field=signature:(\4)} | ||
--regex-unknownx=/^X:([a-z]+)@([a-z]+)/\1/m/{_language=knownz}{_field=owner:\2} | ||
--regex-unknownx=/^Y:([a-z0-9]+)=([a-z0-9]+)/\2/m/{_field=owner:\1}{_language=knownz} |
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