diff options
| author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-06-16 16:19:40 +0900 |
|---|---|---|
| committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-06-18 11:25:42 +0900 |
| commit | 8ee8c376f1fd3cbd96144b5a4e4976a629e35ac3 (patch) | |
| tree | 74a9ae6823609fedde0ef712c7eeb25f218cfb98 /ast.cc | |
| parent | 9619b36d9d833d7b3ba77b8100944cdc9cc85de0 (diff) | |
| download | platform_build_kati-8ee8c376f1fd3cbd96144b5a4e4976a629e35ac3.tar.gz platform_build_kati-8ee8c376f1fd3cbd96144b5a4e4976a629e35ac3.tar.bz2 platform_build_kati-8ee8c376f1fd3cbd96144b5a4e4976a629e35ac3.zip | |
[C++] Fix lineno handling
Diffstat (limited to 'ast.cc')
| -rw-r--r-- | ast.cc | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -9,10 +9,11 @@ AST::AST() {} AST::~AST() {} string RuleAST::DebugString() const { - return StringPrintf("RuleAST(expr=%s term=%d after_term=%s)", + return StringPrintf("RuleAST(expr=%s term=%d after_term=%s loc=%s:%d)", expr->DebugString().c_str(), term, - after_term->DebugString().c_str()); + after_term->DebugString().c_str(), + LOCF(loc())); } string AssignAST::DebugString() const { @@ -29,15 +30,15 @@ string AssignAST::DebugString() const { case AssignDirective::OVERRIDE: dirstr = "override"; break; case AssignDirective::EXPORT: dirstr = "export"; break; } - return StringPrintf("AssignAST(lhs=%s rhs=%s opstr=%s dir=%s)", + return StringPrintf("AssignAST(lhs=%s rhs=%s opstr=%s dir=%s loc=%s:%d)", lhs->DebugString().c_str(), rhs->DebugString().c_str(), - opstr, dirstr); + opstr, dirstr, LOCF(loc())); } string CommandAST::DebugString() const { - return StringPrintf("CommandAST(%s)", - expr->DebugString().c_str()); + return StringPrintf("CommandAST(%s, loc=%s:%d)", + expr->DebugString().c_str(), LOCF(loc())); } RuleAST::~RuleAST() { |
