Add a b'x' byte literal of type u8.
This commit is contained in:
parent
2fd618e77a
commit
bccdba0296
16 changed files with 169 additions and 5 deletions
|
|
@ -47,6 +47,7 @@ pub fn expand_syntax_ext(cx: &mut base::ExtCtxt,
|
|||
ast::LitBool(b) => {
|
||||
accumulator.push_str(format!("{}", b).as_slice());
|
||||
}
|
||||
ast::LitByte(..) |
|
||||
ast::LitBinary(..) => {
|
||||
cx.span_err(e.span, "cannot concatenate a binary literal");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -436,6 +436,12 @@ fn mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> Gc<ast::Expr> {
|
|||
vec!(mk_binop(cx, sp, binop)));
|
||||
}
|
||||
|
||||
LIT_BYTE(i) => {
|
||||
let e_byte = cx.expr_lit(sp, ast::LitByte(i));
|
||||
|
||||
return cx.expr_call(sp, mk_token_path(cx, sp, "LIT_BYTE"), vec!(e_byte));
|
||||
}
|
||||
|
||||
LIT_CHAR(i) => {
|
||||
let e_char = cx.expr_lit(sp, ast::LitChar(i));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue