Merge pull request #728 from luoliwoshang/c/clang/tokenkind

c/clang:token kind
This commit is contained in:
xushiwei
2024-08-17 22:37:19 +08:00
committed by GitHub
2 changed files with 14 additions and 0 deletions

View File

@@ -74,6 +74,8 @@ CXString wrap_clang_Cursor_getRawCommentText(CXCursor *cursor) { return clang_Cu
void wrap_clang_getCursorExtent(CXCursor *cur, CXSourceRange *range) { *range = clang_getCursorExtent(*cur); } void wrap_clang_getCursorExtent(CXCursor *cur, CXSourceRange *range) { *range = clang_getCursorExtent(*cur); }
CXTokenKind wrap_clang_getTokenKind(CXToken *token) { return clang_getTokenKind(*token); }
void wrap_clang_tokenize(CXTranslationUnit unit, CXSourceRange *Range, CXToken **Tokens, unsigned *NumTokens) { void wrap_clang_tokenize(CXTranslationUnit unit, CXSourceRange *Range, CXToken **Tokens, unsigned *NumTokens) {
clang_tokenize(unit, *Range, Tokens, NumTokens); clang_tokenize(unit, *Range, Tokens, NumTokens);
} }

View File

@@ -1773,6 +1773,18 @@ func (c *TranslationUnit) Token(token Token) (ret String) {
return c.wrapToken(&token) return c.wrapToken(&token)
} }
/**
* Determine the kind of the given token.
*/
// llgo:link (*Token).wrapKind C.wrap_clang_getTokenKind
func (c *Token) wrapKind() (ret TokenKind) {
return
}
func (c Token) Kind() (ret TokenKind) {
return c.wrapKind()
}
/** /**
* Retrieve the file, line, column, and offset represented by * Retrieve the file, line, column, and offset represented by
* the given source location. * the given source location.