Improvements to source file position tracking.
Be better about tracking the full extent of expressions in the parser; this leads to more intelligible error messages when we indicate where exactly the error happened.
This commit is contained in:
@@ -275,7 +275,7 @@ Module::AddGlobalVariable(Symbol *sym, Expr *initExpr, bool isConst) {
|
||||
dynamic_cast<ConstExpr *>(initExpr);
|
||||
}
|
||||
else
|
||||
Error(sym->pos, "Initializer for global variable \"%s\" "
|
||||
Error(initExpr->pos, "Initializer for global variable \"%s\" "
|
||||
"must be a constant.", sym->name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user