-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding a config switch to ignore any default remappings. * Resolve the full path of outputLocation so just 'file.cs' works. * Add a traverse option so you can traverse child includes. * Fixing up CXUnsavedFile and CXTUResourceUsageEntry to use a `nulong` type. * Simplifying and improving how the operator opcode is computed.
- Loading branch information
1 parent
2790eb9
commit 6684c9c
Showing
12 changed files
with
170 additions
and
149 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
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 |
---|---|---|
@@ -1,13 +1,41 @@ | ||
using System; | ||
|
||
namespace ClangSharp.Interop | ||
{ | ||
public unsafe partial struct CXToken | ||
public unsafe partial struct CXToken : IEquatable<CXToken> | ||
{ | ||
public CXTokenKind Kind => clang.getTokenKind(this); | ||
|
||
public static bool operator ==(CXToken left, CXToken right) | ||
{ | ||
return (left.int_data[0] == right.int_data[0]) && | ||
(left.int_data[1] == right.int_data[1]) && | ||
(left.int_data[2] == right.int_data[2]) && | ||
(left.int_data[3] == right.int_data[3]) && | ||
(left.ptr_data == right.ptr_data); | ||
} | ||
|
||
public static bool operator !=(CXToken left, CXToken right) | ||
{ | ||
return (left.int_data[0] != right.int_data[0]) || | ||
(left.int_data[1] != right.int_data[1]) || | ||
(left.int_data[2] != right.int_data[2]) || | ||
(left.int_data[3] != right.int_data[3]) || | ||
(left.ptr_data != right.ptr_data); | ||
} | ||
|
||
public override bool Equals(object obj) => (obj is CXSourceRange other) && Equals(other); | ||
|
||
public bool Equals(CXToken other) => this == other; | ||
|
||
public CXSourceRange GetExtent(CXTranslationUnit translationUnit) => clang.getTokenExtent(translationUnit, this); | ||
|
||
public override int GetHashCode() => HashCode.Combine(int_data[0], int_data[1], int_data[2], int_data[3], (IntPtr)ptr_data); | ||
|
||
public CXSourceLocation GetLocation(CXTranslationUnit translationUnit) => clang.getTokenLocation(translationUnit, this); | ||
|
||
public CXString GetSpelling(CXTranslationUnit translationUnit) => clang.getTokenSpelling(translationUnit, this); | ||
|
||
public override string ToString() => ""; | ||
} | ||
} |
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
Oops, something went wrong.