Removed unnecessary code
This commit is contained in:
parent
51e3c1ba0e
commit
4609a814df
@ -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)
|
||||
}
|
||||
i++
|
||||
|
||||
// Function parameters
|
||||
for i < len(tokens) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user