1
Fork 0

auto merge of #9005 : alexcrichton/rust/rusty-log, r=brson

Also redefine all of the standard logging macros to use more rust code instead
of custom LLVM translation code. This makes them a bit easier to understand, but
also more flexibile for future types of logging.

Additionally, this commit removes the LogType language item in preparation for
changing how logging is performed.
This commit is contained in:
bors 2013-09-09 10:41:05 -07:00
commit 059cbaadfa
23 changed files with 115 additions and 195 deletions

View file

@ -26,7 +26,7 @@ use ast::{Expr, Expr_, ExprAddrOf, ExprMatch, ExprAgain};
use ast::{ExprAssign, ExprAssignOp, ExprBinary, ExprBlock};
use ast::{ExprBreak, ExprCall, ExprCast, ExprDoBody};
use ast::{ExprField, ExprFnBlock, ExprIf, ExprIndex};
use ast::{ExprLit, ExprLog, ExprLoop, ExprMac};
use ast::{ExprLit, ExprLogLevel, ExprLoop, ExprMac};
use ast::{ExprMethodCall, ExprParen, ExprPath, ExprRepeat};
use ast::{ExprRet, ExprSelf, ExprStruct, ExprTup, ExprUnary};
use ast::{ExprVec, ExprVstore, ExprVstoreMutBox};
@ -1832,13 +1832,10 @@ impl Parser {
}
}
hi = self.last_span.hi;
} else if self.eat_keyword(keywords::__Log) {
// LOG expression
} else if self.eat_keyword(keywords::__LogLevel) {
// LOG LEVEL expression
self.expect(&token::LPAREN);
let lvl = self.parse_expr();
self.expect(&token::COMMA);
let e = self.parse_expr();
ex = ExprLog(lvl, e);
ex = ExprLogLevel;
hi = self.span.hi;
self.expect(&token::RPAREN);
} else if self.eat_keyword(keywords::Return) {