syntax-tree-accessors #2

Merged
sashakoshka merged 22 commits from syntax-tree-accessors into main 2022-09-05 08:52:09 -06:00
2 changed files with 28 additions and 4 deletions
Showing only changes of commit bc4b2bd33c - Show all commits

View File

@ -102,7 +102,7 @@ func (what Type) Points () (points Type) {
return
}
// Values returns an iterator for the initialization values
// Values returns an iterator for the initialization values.
func (values ObjectInitializationValues) Sections () (
iterator types.Iterator[Argument],
) {
@ -110,13 +110,13 @@ func (values ObjectInitializationValues) Sections () (
return
}
// Length returns the amount of values
// Length returns the amount of values.
func (values ArrayInitializationValues) Length () (length int) {
length = len(values.values)
return
}
// Item returns the value at index
// Item returns the value at index.
func (values ArrayInitializationValues) Value (index int) (value Argument) {
value = values.values[index]
return
@ -141,3 +141,27 @@ func (member ObjtMember) BitWidth () (width uint64) {
width = member.bitWidth
return
}
// Length returns the amount of members in the section.
func (section ObjtSection) Length () (length int) {
length = len(section.members)
return
}
// Item returns the member at index.
func (section ObjtSection) Item (index int) (member ObjtMember) {
member = section.members[index]
return
}
// Length returns the amount of members in the section.
func (section EnumSection) Length () (length int) {
length = len(section.members)
return
}
// Item returns the member at index.
func (section EnumSection) Item (index int) (member EnumMember) {
member = section.members[index]
return
}

View File

@ -193,7 +193,7 @@ type ObjtMember struct {
permissionable
valuable
bitWidth uint64
bitWidth uint64
}
// ObjtSection represents an object type definition.