Added function section to tree
This commit is contained in:
parent
0ac71fa1c3
commit
e630ec6f04
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user