Parser can now sort of parse object member initialization values
This commit is contained in:
parent
bd456b72e9
commit
bd42c95de0
@ -65,8 +65,20 @@ func (parser *ParsingOperation) parseInitializationValues (
|
|||||||
err = parser.nextToken()
|
err = parser.nextToken()
|
||||||
if err != nil { return }
|
if err != nil { return }
|
||||||
|
|
||||||
|
// TODO: make data sections have only one value argument and create a
|
||||||
|
// similar data structure to ObjectAttributes for arrays
|
||||||
if parser.token.Is(lexer.TokenKindDot) {
|
if parser.token.Is(lexer.TokenKindDot) {
|
||||||
// TODO: parse as object initialization
|
var attributes ObjectAttributes
|
||||||
|
attributes, err = parser.parseObjectInitializationValues (
|
||||||
|
baseIndent + 1)
|
||||||
|
|
||||||
|
values = []Argument {
|
||||||
|
Argument {
|
||||||
|
location: attributes.location,
|
||||||
|
value: &attributes,
|
||||||
|
kind: ArgumentKindObjectAttributes,
|
||||||
|
},
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
values, err = parser.parseArrayInitializationValues (
|
values, err = parser.parseArrayInitializationValues (
|
||||||
baseIndent + 1)
|
baseIndent + 1)
|
||||||