Created
June 12, 2014 10:17
-
-
Save fracek/a0949adfcf0ea91bc3bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define method check-local-bindings | |
(description :: <project-library-description>) => () | |
for-library-method (#f, $compilation of m in description) | |
// Accessor methods don't have a body. Without this check, for-computations | |
// crashes. | |
if (~instance?(m, <&accessor-method>)) | |
/* | |
for-computations (c in m) | |
if (c.temporary & ~c.temporary.used? & c.temporary.named?) | |
let temporary-name = c.temporary.name; | |
let location = fragment-source-location(temporary-name); | |
if (location) | |
note(<variable-defined-but-not-used>, | |
source-location: location, | |
variable-name: temporary-name); | |
end if; | |
end if; | |
end for-computations; | |
*/ | |
format-out("HERE\n"); | |
for-temporaries (t in m) | |
format-out("%= %=\n", t.used?, t.named?); | |
if (~t.used? & t.named?) | |
let temporary-name = t.name; | |
let location = fragment-source-location(temporary-name); | |
if (location) | |
note(<variable-defined-but-not-used>, | |
source-location: location, | |
variable-name: temporary-name); | |
end if; | |
end if; | |
end for-temporaries; | |
end if; | |
end for-library-method; | |
end method; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment