Improved instruction parser

This commit is contained in:
Eduard Urbach 2024-06-15 14:46:44 +02:00
parent cf696a6f10
commit 57f1da10fe
No known key found for this signature in database
GPG key ID: C874F672B1AF20C0
7 changed files with 114 additions and 54 deletions

View file

@ -86,6 +86,11 @@ func scanFile(path string, functions chan<- *Function) error {
tokens := token.Tokenize(contents)
file := &File{
Tokens: tokens,
Path: path,
}
var (
i = 0
groupLevel = 0
@ -216,6 +221,7 @@ func scanFile(path string, functions chan<- *Function) error {
functions <- &Function{
Name: tokens[nameStart].Text(),
File: file,
Head: tokens[paramsStart:bodyStart],
Body: tokens[bodyStart : i+1],
Variables: map[string]*Variable{},