diff options
| author | Marijn Haverbeke <[email protected]> | 2011-04-19 10:15:26 +0200 |
|---|---|---|
| committer | Marijn Haverbeke <[email protected]> | 2011-04-19 16:57:13 +0200 |
| commit | 9bfc8bf11e15b7b9a782f1757f9a0ebe324b16e4 (patch) | |
| tree | 688d5ac52ff6cdcdeb364dfe4b418370a9aee5ab /src/boot/fe | |
| parent | Precision overrides 0-padding in #fmt (diff) | |
| download | rust-9bfc8bf11e15b7b9a782f1757f9a0ebe324b16e4.tar.xz rust-9bfc8bf11e15b7b9a782f1757f9a0ebe324b16e4.zip | |
Add log_err to rustboot
Diffstat (limited to 'src/boot/fe')
| -rw-r--r-- | src/boot/fe/ast.ml | 8 | ||||
| -rw-r--r-- | src/boot/fe/item.ml | 5 | ||||
| -rw-r--r-- | src/boot/fe/lexer.mll | 1 | ||||
| -rw-r--r-- | src/boot/fe/token.ml | 2 |
4 files changed, 16 insertions, 0 deletions
diff --git a/src/boot/fe/ast.ml b/src/boot/fe/ast.ml index 8ea03a63..f498fb0e 100644 --- a/src/boot/fe/ast.ml +++ b/src/boot/fe/ast.ml @@ -229,6 +229,7 @@ and stmt' = | STMT_join of lval | STMT_send of (lval * lval) | STMT_log of atom + | STMT_log_err of atom | STMT_note of atom | STMT_prove of (constrs) | STMT_check of (constrs * check_calls) @@ -1210,6 +1211,13 @@ and fmt_stmt_body (ff:Format.formatter) (s:stmt) : unit = fmt ff ";" end + | STMT_log_err at -> + begin + fmt ff "log_err "; + fmt_atom ff at; + fmt ff ";" + end + | STMT_spawn (dst, domain, name, fn, args) -> fmt_lval ff dst; fmt ff " = spawn "; diff --git a/src/boot/fe/item.ml b/src/boot/fe/item.ml index fce89373..5f8a0d30 100644 --- a/src/boot/fe/item.ml +++ b/src/boot/fe/item.ml @@ -186,6 +186,11 @@ and parse_stmts_including_none (ps:pstate) : Ast.stmt array = let (stmts, atom) = ctxt "stmts: log value" parse_expr_atom ps in expect ps SEMI; spans ps stmts apos (Ast.STMT_log atom) + | LOG_ERR -> + bump ps; + let (stmts, atom) = ctxt "stmts: log value" parse_expr_atom ps in + expect ps SEMI; + spans ps stmts apos (Ast.STMT_log_err atom) | BREAK -> bump ps; expect ps SEMI; diff --git a/src/boot/fe/lexer.mll b/src/boot/fe/lexer.mll index 40e13141..513818b3 100644 --- a/src/boot/fe/lexer.mll +++ b/src/boot/fe/lexer.mll @@ -117,6 +117,7 @@ ("const", CONST); ("log", LOG); + ("log_err", LOG_ERR); ("break", BREAK); ("cont", CONT); ("spawn", SPAWN); diff --git a/src/boot/fe/token.ml b/src/boot/fe/token.ml index 18da8c6d..7b4f04b2 100644 --- a/src/boot/fe/token.ml +++ b/src/boot/fe/token.ml @@ -106,6 +106,7 @@ type token = (* Magic runtime services *) | LOG + | LOG_ERR | SPAWN | BIND | THREAD @@ -269,6 +270,7 @@ let rec string_of_tok t = (* Magic runtime services *) | LOG -> "log" + | LOG_ERR -> "log_err" | SPAWN -> "spawn" | BIND -> "bind" | THREAD -> "thread" |