Don't warn that ++, -- exps are unused
This commit is contained in:
@@ -42,6 +42,7 @@ class SpecialForms {
|
|||||||
k.formDocs[newName] = k.formDocs[oldName];
|
k.formDocs[newName] = k.formDocs[oldName];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var unops = ["++", "--"];
|
||||||
map["begin"] = (wholeExp:ReaderExp, args:Array<ReaderExp>, k:KissState) -> {
|
map["begin"] = (wholeExp:ReaderExp, args:Array<ReaderExp>, k:KissState) -> {
|
||||||
// Sometimes empty blocks are useful, so a checkNumArgs() seems unnecessary here for now.
|
// Sometimes empty blocks are useful, so a checkNumArgs() seems unnecessary here for now.
|
||||||
|
|
||||||
@@ -53,7 +54,7 @@ class SpecialForms {
|
|||||||
}
|
}
|
||||||
for (bodyExp in args) {
|
for (bodyExp in args) {
|
||||||
switch(bodyExp.def) {
|
switch(bodyExp.def) {
|
||||||
case Symbol(_) if (lastArg != null):
|
case Symbol(name) if (lastArg != null && !unops.contains(name.substr(0, 2)) && !unops.contains(name.substr(name.length - 2, 2))):
|
||||||
KissError.warnFromExp(bodyExp, "This looks like an unused value");
|
KissError.warnFromExp(bodyExp, "This looks like an unused value");
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user