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:
Matt Pharr
2011-11-03 16:04:01 -07:00
parent 43a2d510bf
commit 7d6f89c8d2
6 changed files with 77 additions and 58 deletions

View File

@@ -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());
}
}