Reworked data section so it stores single initialization argument

This commit is contained in:
Sasha Koshka
2022-08-17 00:49:49 -04:00
parent bd42c95de0
commit 0dd9368393
3 changed files with 68 additions and 44 deletions

View File

@@ -60,13 +60,20 @@ type Declaration struct {
what Type
}
// ObjectAttributes represents a list of object member initialization
// ObjectInitializationValues represents a list of object member initialization
// attributes.
type ObjectAttributes struct {
type ObjectInitializationValues struct {
location file.Location
attributes map[string] Argument
}
// ArrayInitializationValues represents a list of attributes initializing an
// array.
type ArrayInitializationValues struct {
location file.Location
values []Argument
}
// Phrase represents a function call or operator. In ARF they are the same
// syntactical concept.
type Phrase struct {
@@ -94,7 +101,10 @@ const (
// .name value
// but like, a lot of them
ArgumentKindObjectAttributes
ArgumentKindObjectInitializationValues
// value value...
ArgumentKindArrayInitializationValues
// name.name
// name.name.name
@@ -144,6 +154,6 @@ type DataSection struct {
name string
what Type
value []Argument
value Argument
permission types.Permission
}