ast: change file to have a list of sections
This commit is contained in:
@@ -22,8 +22,13 @@ func NewGoAsm(cfg Config) Printer {
|
||||
|
||||
func (p *goasm) Print(f *avo.File) ([]byte, error) {
|
||||
p.header()
|
||||
for _, fn := range f.Functions {
|
||||
p.function(fn)
|
||||
for _, s := range f.Sections {
|
||||
switch s := s.(type) {
|
||||
case *avo.Function:
|
||||
p.function(s)
|
||||
default:
|
||||
panic("unknown section type")
|
||||
}
|
||||
}
|
||||
return p.Result()
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ func (s *stubs) Print(f *avo.File) ([]byte, error) {
|
||||
s.Comment(s.cfg.GeneratedWarning())
|
||||
s.NL()
|
||||
s.Printf("package %s\n", s.cfg.Pkg)
|
||||
for _, fn := range f.Functions {
|
||||
for _, fn := range f.Functions() {
|
||||
s.NL()
|
||||
s.Printf("%s\n", fn.Stub())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user