Added base parse body function
This commit is contained in:
18
parser/body.go
Normal file
18
parser/body.go
Normal file
@@ -0,0 +1,18 @@
|
||||
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":
|
||||
case "type":
|
||||
case "func":
|
||||
case "face":
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
6
parser/data.go
Normal file
6
parser/data.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package parser
|
||||
|
||||
// parseData parses a data section
|
||||
func (parser *ParsingOperation) parseData () (err error) {
|
||||
|
||||
}
|
||||
@@ -12,6 +12,9 @@ func (parser *ParsingOperation) parseMeta () (err error) {
|
||||
if err != nil { return }
|
||||
|
||||
if parser.token.Is(lexer.TokenKindSeparator) {
|
||||
err = parser.nextToken(lexer.TokenKindNewline)
|
||||
if err != nil { return }
|
||||
|
||||
err = parser.nextToken()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -64,6 +64,9 @@ func (parser *ParsingOperation) parse (sourceFile *file.File) (err error) {
|
||||
err = parser.parseMeta()
|
||||
if err != nil { return }
|
||||
|
||||
err = parser.parseBody()
|
||||
if err != nil { return }
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user