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.
main: consider foreign languages when solving the extra specifying _e…
…xtra regex flag The original code assumed the parser specified in a regex pattern was the owner of the extra specified with the _extra regex flag in the pattern. For an example, in the option --regex-Foo=/.../{_extra=anextra}... , ctags assumed "anextra" was a specific extra of "Foo" parser. The original code didn't consider an option like --regex-Foo=/.../{_language=Bar}{_extra=anextra}... In this case, ctags should consider "anextra" as a specific extra of "Bar" parser. NOTE: the language specified with _language flag must be declared with _foreignLanguage= in --langdef-Foo. Signed-off-by: Masatake YAMATO <[email protected]>
- Loading branch information
Showing
12 changed files
with
55 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
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,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
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