add compiler warnings
This commit is contained in:
@@ -23,7 +23,7 @@ class CompileError {
|
|||||||
return new CompileError(exps, message);
|
return new CompileError(exps, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function toString() {
|
public function toString(warning=false) {
|
||||||
var posPrefix = switch (exps.length) {
|
var posPrefix = switch (exps.length) {
|
||||||
case 1:
|
case 1:
|
||||||
exps[0].pos.toPrint();
|
exps[0].pos.toPrint();
|
||||||
@@ -34,11 +34,17 @@ class CompileError {
|
|||||||
firstPos + '-' + lastPos.substr(justLineAndColumnIdx);
|
firstPos + '-' + lastPos.substr(justLineAndColumnIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
return '\nKiss compilation failed!\n'
|
var failed = if (warning) "warning!"; else "failed!";
|
||||||
|
|
||||||
|
return '\nKiss compilation $failed\n'
|
||||||
+ posPrefix
|
+ posPrefix
|
||||||
+ ": "
|
+ ": "
|
||||||
+ message
|
+ message
|
||||||
+ "\nFrom:"
|
+ "\nFrom:"
|
||||||
+ [for (exp in exps) exp.def.toString()].toString();
|
+ [for (exp in exps) exp.def.toString()].toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function warnFromExp(exp:ReaderExp, message:String) {
|
||||||
|
Prelude.print(new CompileError([exp], message).toString(true));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user