Skip to content

Commit 608f0d9

Browse files
committed
parser use fn -> clang use fn
1 parent 7ac41af commit 608f0d9

File tree

4 files changed

+10
-18
lines changed

4 files changed

+10
-18
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// NOTE(zzy):temp define in current directory, need to be removed when support libclang at llpkg
2+
#include <clang-c/Index.h>
3+
#include <stdio.h>
4+
5+
extern "C" {
6+
int wrap_clang_isCursorDefinition(CXCursor *cursor) { return clang_isCursorDefinition(*cursor); }
7+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// NOTE(zzy):temp define in current directory, need to be removed when support libclang at llpkg
2-
package parser
2+
package clang
33

44
import (
55
_ "unsafe"

_xtool/internal/parser/_wrap/wrap.cpp

Lines changed: 0 additions & 15 deletions
This file was deleted.

_xtool/internal/parser/parser_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,12 +684,12 @@ func TestEmptyDeclVsForwardDecl(t *testing.T) {
684684
if cursor.Kind == clang.CursorStructDecl {
685685
sdecl := clang.GoString(cursor.String())
686686
if _, ok := decl[sdecl]; ok {
687-
isDefine := parser.IsCursorDefinition(cursor) != 0
687+
isDefine := clangutils.IsCursorDefinition(cursor) != 0
688688
if isDefine != decl[sdecl] {
689689
t.Fatalf("StructDecl %s isDefinition expect %v, got %v", sdecl, decl[sdecl], isDefine)
690690
}
691691
}
692-
fmt.Println("StructDecl Name:", clang.GoString(cursor.String()), "isDefinition:", parser.IsCursorDefinition(cursor))
692+
fmt.Println("StructDecl Name:", clang.GoString(cursor.String()), "isDefinition:", clangutils.IsCursorDefinition(cursor))
693693
}
694694
return clang.ChildVisit_Recurse
695695
})

0 commit comments

Comments
 (0)