syntax-tree-accessors #2
|
@ -102,7 +102,7 @@ func (what Type) Points () (points Type) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Values returns an iterator for the initialization values
|
// Values returns an iterator for the initialization values.
|
||||||
func (values ObjectInitializationValues) Sections () (
|
func (values ObjectInitializationValues) Sections () (
|
||||||
iterator types.Iterator[Argument],
|
iterator types.Iterator[Argument],
|
||||||
) {
|
) {
|
||||||
|
@ -110,13 +110,13 @@ func (values ObjectInitializationValues) Sections () (
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Length returns the amount of values
|
// Length returns the amount of values.
|
||||||
func (values ArrayInitializationValues) Length () (length int) {
|
func (values ArrayInitializationValues) Length () (length int) {
|
||||||
length = len(values.values)
|
length = len(values.values)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Item returns the value at index
|
// Item returns the value at index.
|
||||||
func (values ArrayInitializationValues) Value (index int) (value Argument) {
|
func (values ArrayInitializationValues) Value (index int) (value Argument) {
|
||||||
value = values.values[index]
|
value = values.values[index]
|
||||||
return
|
return
|
||||||
|
@ -141,3 +141,27 @@ func (member ObjtMember) BitWidth () (width uint64) {
|
||||||
width = member.bitWidth
|
width = member.bitWidth
|
||||||
return
|
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
|
||||||
|
}
|
||||||
|
|
Reference in New Issue
Block a user