Created base for type section parsing

This commit is contained in:
Sasha Koshka 2022-08-18 17:39:19 -04:00
parent bc9beb0317
commit 5c2a7aeb07
3 changed files with 17 additions and 0 deletions

View File

@ -21,6 +21,14 @@ func (parser *ParsingOperation) parseBody () (err error) {
parser.tree.dataSections[section.name] = section
if err != nil { return }
case "type":
var section *TypeSection
section, err = parser.parseTypeSection()
if parser.tree.typeSections == nil {
parser.tree.typeSections =
make(map[string] *TypeSection)
}
parser.tree.typeSections[section.name] = section
if err != nil { return }
case "face":
case "enum":
case "func":

View File

@ -11,6 +11,7 @@ type SyntaxTree struct {
author string
requires []string
typeSections map[string] *TypeSection
dataSections map[string] *DataSection
}

8
parser/type.go Normal file
View File

@ -0,0 +1,8 @@
package parser
func (parser *ParsingOperation) parseTypeSection () (
section *TypeSection,
err error,
) {
return
}