-
Notifications
You must be signed in to change notification settings - Fork 632
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SELF INCOMPATIBILITY] CPreProcessor: fix #1514
Old behavior: When --language=C++ is specified, C preprocessor macro definitions in a source code is not captured. Because CPreProcessor parser captures the definitions and is disabled with --language=C++ option. As reported in #1514, this behavior makes use confused. $ ./ctags --list-kinds=C++ d macro definitions e enumerators (values inside an enumeration) f function definitions Though CPreProcessor parser captures macro definitions, macro kind is listed in --list-kinds=C++. A user may understand "macro kind" is part of C++ parser, and the understanding looks reasonable. New behavior: In the following condition, CPreProcessor related kind language objects are recorded even if CPreProcessor is disabled: The kinds are listed in --list-kinds output of a parser, that uses CPreProcessor parser. C and C++ meet the condition. DTS doesn't meet the condition. Close #1514. Signed-off-by: Masatake YAMATO <[email protected]>
- Loading branch information
Showing
16 changed files
with
79 additions
and
8 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
Units/parser-cpreprocessor.r/disable-cpp-client--clinet-kind.d/README
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 @@ | ||
See #1514. |
3 changes: 3 additions & 0 deletions
3
Units/parser-cpreprocessor.r/disable-cpp-client--clinet-kind.d/args.ctags
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 @@ | ||
--languages=-CPreProcessor | ||
--kinds-C=-d | ||
|
File renamed without changes.
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 |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
int | ||
main(int argc) | ||
{ | ||
return X; | ||
return X; | ||
} |
1 change: 1 addition & 0 deletions
1
Units/parser-cpreprocessor.r/disable-cpp-client--cpp-kind.d/README
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 @@ | ||
See #1514. |
3 changes: 3 additions & 0 deletions
3
Units/parser-cpreprocessor.r/disable-cpp-client--cpp-kind.d/args.ctags
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 @@ | ||
--languages=-CPreProcessor | ||
--kinds-CPreProcessor=-d | ||
|
2 changes: 2 additions & 0 deletions
2
Units/parser-cpreprocessor.r/disable-cpp-client--cpp-kind.d/expected.tags
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 @@ | ||
X input.c /^#define X /;" d file: | ||
main input.c /^main(int argc)$/;" f typeref:typename:int |
7 changes: 7 additions & 0 deletions
7
Units/parser-cpreprocessor.r/disable-cpp-client--cpp-kind.d/input.c
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 @@ | ||
#define X 1 | ||
|
||
int | ||
main(int argc) | ||
{ | ||
return 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 @@ | ||
See #1514. |
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
Units/parser-cpreprocessor.r/disable-cpp-client.d/expected.tags
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 @@ | ||
X input.c /^#define X /;" d file: | ||
main input.c /^main(int argc)$/;" 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,7 @@ | ||
#define X 1 | ||
|
||
int | ||
main(int argc) | ||
{ | ||
return 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 @@ | ||
--languages=-CPreProcessor |
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 @@ | ||
0x00 input.dts /^ phandle = <0x00>;$/;" p label:label | ||
label input.dts /^label: test {$/;" l | ||
label2 input.dts /^ label2: chosen { } ;$/;" l label:label |
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,12 @@ | ||
/dts-v1/; | ||
|
||
#include "foo.dtsi" | ||
#define bar 98 | ||
|
||
label: test { | ||
dummy { | ||
label2: chosen { } ; | ||
phandle = <0x00>; | ||
}; | ||
}; | ||
#undef bar |
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