emit warnings for unused vars
This commit is contained in:
@@ -158,6 +158,7 @@ function analyze(src, filename) {
|
||||
var line = null
|
||||
var col = null
|
||||
var has_errors = _ast.errors != null && length(_ast.errors) > 0
|
||||
var folded = null
|
||||
if (has_errors) {
|
||||
while (_i < length(_ast.errors)) {
|
||||
e = _ast.errors[_i]
|
||||
@@ -176,7 +177,17 @@ function analyze(src, filename) {
|
||||
}
|
||||
disrupt
|
||||
}
|
||||
return fold_mod(_ast)
|
||||
folded = fold_mod(_ast)
|
||||
if (!_no_warn && folded._diagnostics != null && length(folded._diagnostics) > 0) {
|
||||
_i = 0
|
||||
while (_i < length(folded._diagnostics)) {
|
||||
e = folded._diagnostics[_i]
|
||||
os.print(`${filename}:${text(e.line)}:${text(e.col)}: ${e.severity}: ${e.message}\n`)
|
||||
_i = _i + 1
|
||||
}
|
||||
}
|
||||
folded._diagnostics = null
|
||||
return folded
|
||||
}
|
||||
|
||||
// Lazy-loaded verify_ir module (loaded on first use)
|
||||
|
||||
Reference in New Issue
Block a user