c/clang:token kind

This commit is contained in:
luoliwoshang
2024-08-16 18:46:36 +08:00
parent 53d2d080f4
commit 67be2ba95b
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); }
CXTokenKind wrap_clang_getTokenKind(CXToken *token) { return clang_getTokenKind(*token); }
void wrap_clang_tokenize(CXTranslationUnit unit, CXSourceRange *Range, CXToken **Tokens, unsigned *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)
}
/**
* 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
* the given source location.