Skip to content

Commit 9ed5eae

Browse files
aykevldeadprogram
authored andcommitted
cgo: use scanner.Error in libclang
Previously it would return a `*scanner.Error`, which is not supported in the error printer of the main package. This can easily be fixed by making it a regular object (instead of a pointer).
1 parent e2c55e3 commit 9ed5eae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cgo/libclang.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ func tinygo_clang_globals_visitor(c, parent C.GoCXCursor, client_data C.CXClient
246246
}
247247
value := source[len(name):]
248248
// Try to convert this #define into a Go constant expression.
249-
expr, err := parseConst(pos+token.Pos(len(name)), p.fset, value)
250-
if err != nil {
251-
p.errors = append(p.errors, err)
249+
expr, scannerError := parseConst(pos+token.Pos(len(name)), p.fset, value)
250+
if scannerError != nil {
251+
p.errors = append(p.errors, *scannerError)
252252
}
253253
if expr != nil {
254254
// Parsing was successful.

0 commit comments

Comments
 (0)