Previously, the build script was using the libuast.h header generated by cgo. But the generated header had some problems:
Unnecessary Go prologue that we don't use
Definition of basic Go types that we don't use
All arguments are named pN instead of names used in Go code
The previous solution was using sed to cut some pieces from the file generated by cgo. This approach works but is not portable.
This PR adds a Go script that generates a custom header using Go source code, the same way as cgo does. It allows using proper argument names and as a bonus, embedding (manually written) uast.h into the final libuast.h.
Previously, the build script was using the
libuast.h
header generated by cgo. But the generated header had some problems:pN
instead of names used in Go codeThe previous solution was using
sed
to cut some pieces from the file generated by cgo. This approach works but is not portable.This PR adds a Go script that generates a custom header using Go source code, the same way as cgo does. It allows using proper argument names and as a bonus, embedding (manually written)
uast.h
into the finallibuast.h
.Signed-off-by: Denys Smirnov denys@sourced.tech