Removed unnecessary code

This commit is contained in:
Eduard Urbach 2025-02-04 15:19:03 +01:00
parent 51e3c1ba0e
commit 4609a814df
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0

View File

@ -15,7 +15,7 @@ func (s *Scanner) scanFunction(file *fs.File, tokens token.List, i int) (int, er
var (
groupLevel = 0
blockLevel = 0
nameStart = -1
nameStart = i
paramsStart = -1
paramsEnd = -1
bodyStart = -1
@ -23,29 +23,7 @@ func (s *Scanner) scanFunction(file *fs.File, tokens token.List, i int) (int, er
typeEnd = -1
)
// Function name
for i < len(tokens) {
if tokens[i].Kind == token.Identifier {
nameStart = i
i++
break
}
if tokens[i].Kind == token.NewLine || tokens[i].Kind == token.Comment {
i++
continue
}
if tokens[i].Kind == token.Invalid {
return i, errors.New(&errors.InvalidCharacter{Character: tokens[i].Text(file.Bytes)}, file, tokens[i].Position)
}
if tokens[i].Kind == token.EOF {
return i, nil
}
return i, errors.New(errors.ExpectedFunctionName, file, tokens[i].Position)
}
// Function parameters
for i < len(tokens) {