Add parser.Tree.AddDeclaration()

This commit is contained in:
Sasha Koshka 2024-02-06 15:54:21 -05:00
parent 08f1027834
commit 3e89953d07
1 changed files with 5 additions and 0 deletions

View File

@ -34,3 +34,8 @@ func (this *Tree) Parse (name string, file io.Reader) error {
if err != nil { return err }
return parser.ParseInto(this)
}
// AddDeclaration adds a top-level entity to the tree.
func (this *Tree) AddDeclaration (topLevel ...entity.TopLevel) {
this.Declarations = append(this.Declarations, topLevel...)
}