This repository has been archived on 2022-08-30. You can view files and clone it, but cannot push or open issues or pull requests.
2022-08-15 02:38:57 +00:00
|
|
|
package parser
|
|
|
|
|
|
|
|
import "git.tebibyte.media/sashakoshka/arf/lexer"
|
|
|
|
|
|
|
|
// parse body parses the body of an arf file, after the metadata header.
|
|
|
|
func (parser *ParsingOperation) parseBody () (err error) {
|
|
|
|
err = parser.nextToken(lexer.TokenKindName)
|
|
|
|
if err != nil { return }
|
|
|
|
|
|
|
|
switch parser.token.Value().(string) {
|
|
|
|
case "data":
|
2022-08-15 19:09:07 +00:00
|
|
|
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
|
2022-08-15 02:38:57 +00:00
|
|
|
case "type":
|
|
|
|
case "face":
|
2022-08-15 05:47:42 +00:00
|
|
|
case "enum":
|
|
|
|
case "func":
|
2022-08-15 02:38:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|