Data section initialization values are now skimmed over
This commit is contained in:
@@ -13,6 +13,7 @@ type ParsingOperation struct {
|
||||
token lexer.Token
|
||||
tokens []lexer.Token
|
||||
tokenIndex int
|
||||
skimming bool
|
||||
|
||||
tree SyntaxTree
|
||||
}
|
||||
@@ -42,6 +43,7 @@ func Fetch (modulePath string, skim bool) (tree SyntaxTree, err error) {
|
||||
// miss, so parse the module.
|
||||
parser := ParsingOperation {
|
||||
modulePath: modulePath,
|
||||
skimming: skim,
|
||||
tree: SyntaxTree {
|
||||
sections: make(map[string] Section),
|
||||
},
|
||||
@@ -155,13 +157,18 @@ func (parser *ParsingOperation) previousToken () {
|
||||
// equal to or greater than the specified indent.
|
||||
func (parser *ParsingOperation) skipIndentLevel (indent int) (err error) {
|
||||
for {
|
||||
if parser.token.Is(lexer.TokenKindNewline) {
|
||||
err = parser.nextToken()
|
||||
if err != nil { return }
|
||||
|
||||
if !parser.token.Is(lexer.TokenKindIndent) ||
|
||||
parser.token.Value().(int) < indent {
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
err = parser.nextToken()
|
||||
if err != nil { return }
|
||||
|
||||
if parser.token.Is(lexer.TokenKindIndent) &&
|
||||
parser.token.Value().(int) < indent {
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user