Parser calls ParseDataSection
This commit is contained in:
parent
8b28fe5a4c
commit
614b5664fc
@ -9,6 +9,13 @@ func (parser *ParsingOperation) parseBody () (err error) {
|
|||||||
|
|
||||||
switch parser.token.Value().(string) {
|
switch parser.token.Value().(string) {
|
||||||
case "data":
|
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 "type":
|
||||||
case "face":
|
case "face":
|
||||||
case "enum":
|
case "enum":
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
package parser
|
package parser
|
||||||
|
|
||||||
// parseData parses a data section
|
// parseData parses a data section
|
||||||
func (parser *ParsingOperation) parseData () (err error) {
|
func (parser *ParsingOperation) parseDataSection () (
|
||||||
|
section *DataSection,
|
||||||
|
err error,
|
||||||
|
) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ type SyntaxTree struct {
|
|||||||
author string
|
author string
|
||||||
|
|
||||||
requires []string
|
requires []string
|
||||||
dataSections []DataSection
|
dataSections map[string] *DataSection
|
||||||
}
|
}
|
||||||
|
|
||||||
// Identifier represents a chain of arguments separated by a dot.
|
// Identifier represents a chain of arguments separated by a dot.
|
||||||
|
Reference in New Issue
Block a user