Parser calls ParseDataSection

This commit is contained in:
Sasha Koshka 2022-08-15 15:09:07 -04:00
parent 8b28fe5a4c
commit 614b5664fc
3 changed files with 12 additions and 2 deletions

View File

@ -9,6 +9,13 @@ func (parser *ParsingOperation) parseBody () (err error) {
switch parser.token.Value().(string) {
case "data":
var section *DataSection
section, err = parser.parseDataSection()
if err != nil { return }
if parser.tree.dataSections == nil {
parser.tree.dataSections = make(map[string] *DataSection)
}
parser.tree.dataSections[section.name] = section
case "type":
case "face":
case "enum":

View File

@ -1,6 +1,9 @@
package parser
// parseData parses a data section
func (parser *ParsingOperation) parseData () (err error) {
func (parser *ParsingOperation) parseDataSection () (
section *DataSection,
err error,
) {
return
}

View File

@ -11,7 +11,7 @@ type SyntaxTree struct {
author string
requires []string
dataSections []DataSection
dataSections map[string] *DataSection
}
// Identifier represents a chain of arguments separated by a dot.