ast: change file to have a list of sections
This commit is contained in:
@@ -29,7 +29,7 @@ func (p Func) Execute(f *avo.File) error {
|
||||
type FunctionPass func(*avo.Function) error
|
||||
|
||||
func (p FunctionPass) Execute(f *avo.File) error {
|
||||
for _, fn := range f.Functions {
|
||||
for _, fn := range f.Functions() {
|
||||
if err := p(fn); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -65,10 +65,11 @@ func ConstructLiveness(t *testing.T, ctx *build.Context) *avo.Function {
|
||||
t.FailNow()
|
||||
}
|
||||
|
||||
if len(f.Functions) != 1 {
|
||||
fns := f.Functions()
|
||||
if len(fns) != 1 {
|
||||
t.Fatalf("expect 1 function")
|
||||
}
|
||||
fn := f.Functions[0]
|
||||
fn := fns[0]
|
||||
|
||||
passes := []func(*avo.Function) error{
|
||||
pass.LabelTarget,
|
||||
|
||||
Reference in New Issue
Block a user