diff options
author | Ayke van Laethem <[email protected]> | 2020-06-08 16:23:01 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2020-06-08 19:54:41 +0200 |
commit | 9ed5eae6a939541b73dfcf2786cee3188ec6b125 (patch) | |
tree | ff3bb5f1fe0c899fa6e7ea2749c88450f037146c | |
parent | e2c55e3d2657be8af55b1c80a96b8a1331c0eae3 (diff) | |
download | tinygo-9ed5eae6a939541b73dfcf2786cee3188ec6b125.tar.gz tinygo-9ed5eae6a939541b73dfcf2786cee3188ec6b125.zip |
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).
-rw-r--r-- | cgo/libclang.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cgo/libclang.go b/cgo/libclang.go index 3d7695b5e..649494f12 100644 --- a/cgo/libclang.go +++ b/cgo/libclang.go @@ -246,9 +246,9 @@ func tinygo_clang_globals_visitor(c, parent C.GoCXCursor, client_data C.CXClient } value := source[len(name):] // Try to convert this #define into a Go constant expression. - expr, err := parseConst(pos+token.Pos(len(name)), p.fset, value) - if err != nil { - p.errors = append(p.errors, err) + expr, scannerError := parseConst(pos+token.Pos(len(name)), p.fset, value) + if scannerError != nil { + p.errors = append(p.errors, *scannerError) } if expr != nil { // Parsing was successful. |