Change the log level to be an enum rather than an int

This allows for eliminating a match check.
This commit is contained in:
Tim Chevalier
2012-08-21 17:22:45 -07:00
parent 73ffc7e700
commit 0a5f88a240
3 changed files with 10 additions and 6 deletions

View File

@@ -309,6 +309,10 @@ enum blk_check_mode { default_blk, unchecked_blk, unsafe_blk, }
type expr = {id: node_id, callee_id: node_id, node: expr_, span: span};
// Extra node ID is only used for index, assign_op, unary, binary
#[auto_serialize]
enum log_level { error, debug, other }
// 0 = error, 1 = debug, 2 = other
#[auto_serialize]
enum alt_mode { alt_check, alt_exhaustive, }
@@ -354,7 +358,7 @@ enum expr_ {
expr_break(option<ident>),
expr_again(option<ident>),
expr_ret(option<@expr>),
expr_log(int, @expr, @expr),
expr_log(log_level, @expr, @expr),
/* just an assert */
expr_assert(@expr),