llcppsigfetch:output fileset

This commit is contained in:
luoliwoshang
2024-09-19 15:35:42 +08:00
parent bf87b76adb
commit e0cb6d4531
4 changed files with 18 additions and 11 deletions

View File

@@ -6,6 +6,18 @@ import (
"github.com/goplus/llgo/chore/llcppg/ast"
)
func MarshalOutputASTFiles(files map[string]*ast.File) *cjson.JSON {
root := cjson.Array()
for path, file := range files {
f := cjson.Object()
path := cjson.String(c.AllocaCStr(path))
f.SetItem(c.Str("path"), path)
f.SetItem(c.Str("doc"), MarshalASTFile(file))
root.AddItem(f)
}
return root
}
func MarshalASTFiles(files map[string]*ast.File) *cjson.JSON {
root := cjson.Object()
for path, file := range files {