Reduced number of tokens processed

This commit is contained in:
Eduard Urbach 2024-06-23 14:46:04 +02:00
parent 4f6750dc8e
commit 31845dbc48
No known key found for this signature in database
GPG key ID: C874F672B1AF20C0
2 changed files with 9 additions and 15 deletions

View file

@ -176,12 +176,12 @@ func scanFile(path string, functions chan<- *Function) error {
for i < len(tokens) {
if tokens[i].Kind == token.BlockStart {
blockLevel++
i++
if blockLevel == 1 {
bodyStart = i
}
i++
continue
}
@ -225,7 +225,7 @@ func scanFile(path string, functions chan<- *Function) error {
Name: tokens[nameStart].Text(),
File: file,
Head: tokens[paramsStart:bodyStart],
Body: tokens[bodyStart : i+1],
Body: tokens[bodyStart:i],
Variables: map[string]*Variable{},
CPU: cpu.CPU{
General: x64.GeneralRegisters,