llcppsigfetch:output result
This commit is contained in:
@@ -3,6 +3,8 @@ package parse
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/goplus/llgo/c"
|
||||
"github.com/goplus/llgo/c/cjson"
|
||||
"github.com/goplus/llgo/chore/llcppg/ast"
|
||||
)
|
||||
|
||||
@@ -16,6 +18,18 @@ func NewContext() *Context {
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Context) Output() *cjson.JSON {
|
||||
root := cjson.Array()
|
||||
for path, file := range p.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
|
||||
}
|
||||
|
||||
// ProcessFiles processes the given files and adds them to the context
|
||||
func (p *Context) ProcessFiles(files []string) error {
|
||||
for _, file := range files {
|
||||
|
||||
Reference in New Issue
Block a user