aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front
diff options
context:
space:
mode:
Diffstat (limited to 'src/comp/front')
-rw-r--r--src/comp/front/ast.rs2
-rw-r--r--src/comp/front/lexer.rs1
-rw-r--r--src/comp/front/parser.rs11
-rw-r--r--src/comp/front/token.rs2
4 files changed, 13 insertions, 3 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs
index b0a1a0d6..2ecd4992 100644
--- a/src/comp/front/ast.rs
+++ b/src/comp/front/ast.rs
@@ -289,7 +289,7 @@ tag expr_ {
expr_ret(option.t[@expr], ann);
expr_put(option.t[@expr], ann);
expr_be(@expr, ann);
- expr_log(@expr, ann);
+ expr_log(int, @expr, ann);
expr_check_expr(@expr, ann);
expr_port(ann);
expr_chan(@expr, ann);
diff --git a/src/comp/front/lexer.rs b/src/comp/front/lexer.rs
index 36269515..8d4c464d 100644
--- a/src/comp/front/lexer.rs
+++ b/src/comp/front/lexer.rs
@@ -152,6 +152,7 @@ fn keyword_table() -> std.map.hashmap[str, token.token] {
keywords.insert("const", token.CONST);
keywords.insert("log", token.LOG);
+ keywords.insert("log_err", token.LOG_ERR);
keywords.insert("spawn", token.SPAWN);
keywords.insert("thread", token.THREAD);
keywords.insert("yield", token.YIELD);
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs
index 2e6e7c29..2c21c957 100644
--- a/src/comp/front/parser.rs
+++ b/src/comp/front/parser.rs
@@ -810,7 +810,14 @@ impure fn parse_bottom_expr(parser p) -> @ast.expr {
p.bump();
auto e = parse_expr(p);
auto hi = e.span.hi;
- ex = ast.expr_log(e, ast.ann_none);
+ ex = ast.expr_log(1, e, ast.ann_none);
+ }
+
+ case (token.LOG_ERR) {
+ p.bump();
+ auto e = parse_expr(p);
+ auto hi = e.span.hi;
+ ex = ast.expr_log(0, e, ast.ann_none);
}
case (token.CHECK) {
@@ -1669,7 +1676,7 @@ fn stmt_ends_with_semi(@ast.stmt stmt) -> bool {
case (ast.expr_ret(_,_)) { ret true; }
case (ast.expr_put(_,_)) { ret true; }
case (ast.expr_be(_,_)) { ret true; }
- case (ast.expr_log(_,_)) { ret true; }
+ case (ast.expr_log(_,_,_)) { ret true; }
case (ast.expr_check_expr(_,_)) { ret true; }
}
}
diff --git a/src/comp/front/token.rs b/src/comp/front/token.rs
index dcfafadf..078467b5 100644
--- a/src/comp/front/token.rs
+++ b/src/comp/front/token.rs
@@ -119,6 +119,7 @@ tag token {
/* Magic runtime services */
LOG;
+ LOG_ERR;
SPAWN;
BIND;
THREAD;
@@ -291,6 +292,7 @@ fn to_str(token t) -> str {
/* Magic runtime services */
case (LOG) { ret "log"; }
+ case (LOG_ERR) { ret "log_err"; }
case (SPAWN) { ret "spawn"; }
case (BIND) { ret "bind"; }
case (THREAD) { ret "thread"; }