Added function section to tree

This commit is contained in:
Sasha Koshka 2022-08-25 12:02:43 -04:00
parent 0ac71fa1c3
commit e630ec6f04

View File

@ -16,6 +16,7 @@ type SyntaxTree struct {
enumSections map[string] *EnumSection
faceSections map[string] *FaceSection
dataSections map[string] *DataSection
funcSections map[string] *FuncSection
}
// Identifier represents a chain of arguments separated by a dot.
@ -229,3 +230,20 @@ type FaceSection struct {
permission types.Permission
behaviors map[string] FaceBehavior
}
// Block represents a scoped/indented block of code.
// TODO: blocks will not directly nest. nested blocks will be stored as a part
// of certain control flow statements.
type Block []Phrase
// FuncSection represents a function section.
type FuncSection struct {
location file.Location
name string
permission types.Permission
receiver *Declaration
inputs []Declaration
outputs []Declaration
root *Block
}