-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 #18537 from jketema/elifdef
C++: Support `#elifdef`, `#elifndef`, and MSVC's `#import`
- Loading branch information
Showing
16 changed files
with
10,188 additions
and
332 deletions.
There are no files selected for viewing
2,432 changes: 2,432 additions & 0 deletions
2,432
cpp/downgrades/59cb96ca699929b63941e81905f9b8de7eed59a6/old.dbscheme
Large diffs are not rendered by default.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
cpp/downgrades/59cb96ca699929b63941e81905f9b8de7eed59a6/preprocdirects.ql
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,21 @@ | ||
class PreprocessorDirective extends @preprocdirect { | ||
string toString() { none() } | ||
} | ||
|
||
class Location extends @location_default { | ||
string toString() { none() } | ||
} | ||
|
||
bindingset[kind] | ||
int getKind(int kind) { | ||
if kind = 14 | ||
then result = 6 // Represent MSFT #import as #include | ||
else | ||
if kind = 15 or kind = 6 | ||
then result = 3 // Represent #elifdef and #elifndef as #elif | ||
else result = kind | ||
} | ||
|
||
from PreprocessorDirective ppd, int kind, Location l | ||
where preprocdirects(ppd, kind, l) | ||
select ppd, getKind(kind), l |
Oops, something went wrong.