Improved Windows support

This commit is contained in:
2024-08-13 19:34:54 +02:00
parent 7b1a293cd0
commit e818e5b907
16 changed files with 142 additions and 57 deletions

View File

@ -29,6 +29,10 @@ func (s *Scanner) queueDirectory(directory string, pkg string) {
return
}
if strings.HasSuffix(name, "_windows.q") && config.TargetOS != "windows" {
return
}
fullPath := filepath.Join(directory, name)
s.queueFile(fullPath, pkg)
})

View File

@ -249,7 +249,7 @@ func (s *Scanner) scanFile(path string, pkg string) error {
register := x64.InputRegisters[count]
uses := token.Count(function.Body, contents, token.Identifier, name)
if uses == 0 {
if uses == 0 && name != "_" {
return errors.New(&errors.UnusedVariable{Name: name}, file, tokens[0].Position)
}