diff options
| author | bors <bors@rust-lang.org> | 2014-10-29 10:22:01 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-10-29 10:22:01 +0000 |
| commit | 3bc545373df4c81ba223a8bece14cbc27eb85a4d (patch) | |
| tree | 6f2bc6000e1b8b10a1a74aedc57fa9d1f0fc565b /src/libsyntax/ext/asm.rs | |
| parent | 124508dea1caf213886e5e1a02d425cac8dd0b54 (diff) | |
| parent | 665ad9c175f746b78c7eae81432b543d2e16c3c9 (diff) | |
| download | rust-3bc545373df4c81ba223a8bece14cbc27eb85a4d.tar.gz rust-3bc545373df4c81ba223a8bece14cbc27eb85a4d.zip | |
auto merge of #18365 : bjz/rust/token, r=alexcrichton
[breaking-change]
(for syntax-extensions)
- Token variant identifiers have been converted to PascalCase for consistency with Rust coding standards
- Some free-functions in `syntax::token` have been converted to methods on `syntax::token::Token`:
- `can_begin_expr` -> `Token::can_begin_expr`
- `close_delimiter_for` -> `Token::get_close_delimiter`
- `is_lit` -> `Token::is_lit`
- `is_ident` -> `Token::is_ident`
- `is_path` -> `Token::is_path`
- `is_plain_ident` -> `Token::is_plain_ident`
- `is_lifetime` -> `Token::is_lifetime`
- `is_mutability` -> `Token::is_mutability`
- `to_binop` -> `Token::to_binop`
- `is_keyword` -> `Token::is_keyword`
- `is_any_keyword` -> `Token:is_any_keyword`
- `is_strict_keyword` -> `Token::is_strict_keyword`
- `is_reserved_keyword` -> `Token::is_reserved_keyword`
- `mtwt_token_eq` -> `Token::mtwt_eq`
- `token::Ident` now takes an enum instead of a boolean for clarity
- `token::{to_string, binop_to_string}` were moved to `pprust::{token_to_string, binop_to_string}`
Diffstat (limited to 'src/libsyntax/ext/asm.rs')
| -rw-r--r-- | src/libsyntax/ext/asm.rs | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/libsyntax/ext/asm.rs b/src/libsyntax/ext/asm.rs index 702be0c0eee..2b52b7feacc 100644 --- a/src/libsyntax/ext/asm.rs +++ b/src/libsyntax/ext/asm.rs @@ -72,21 +72,21 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) asm_str_style = Some(style); } Outputs => { - while p.token != token::EOF && - p.token != token::COLON && - p.token != token::MOD_SEP { + while p.token != token::Eof && + p.token != token::Colon && + p.token != token::ModSep { if outputs.len() != 0 { - p.eat(&token::COMMA); + p.eat(&token::Comma); } let (constraint, _str_style) = p.parse_str(); let span = p.last_span; - p.expect(&token::LPAREN); + p.expect(&token::LParen); let out = p.parse_expr(); - p.expect(&token::RPAREN); + p.expect(&token::RParen); // Expands a read+write operand into two operands. // @@ -113,12 +113,12 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) } } Inputs => { - while p.token != token::EOF && - p.token != token::COLON && - p.token != token::MOD_SEP { + while p.token != token::Eof && + p.token != token::Colon && + p.token != token::ModSep { if inputs.len() != 0 { - p.eat(&token::COMMA); + p.eat(&token::Comma); } let (constraint, _str_style) = p.parse_str(); @@ -129,21 +129,21 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) cx.span_err(p.last_span, "input operand constraint contains '+'"); } - p.expect(&token::LPAREN); + p.expect(&token::LParen); let input = p.parse_expr(); - p.expect(&token::RPAREN); + p.expect(&token::RParen); inputs.push((constraint, input)); } } Clobbers => { let mut clobs = Vec::new(); - while p.token != token::EOF && - p.token != token::COLON && - p.token != token::MOD_SEP { + while p.token != token::Eof && + p.token != token::Colon && + p.token != token::ModSep { if clobs.len() != 0 { - p.eat(&token::COMMA); + p.eat(&token::Comma); } let (s, _str_style) = p.parse_str(); @@ -172,8 +172,8 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) cx.span_warn(p.last_span, "unrecognized option"); } - if p.token == token::COMMA { - p.eat(&token::COMMA); + if p.token == token::Comma { + p.eat(&token::Comma); } } StateNone => () @@ -183,17 +183,17 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) // MOD_SEP is a double colon '::' without space in between. // When encountered, the state must be advanced twice. match (&p.token, state.next(), state.next().next()) { - (&token::COLON, StateNone, _) | - (&token::MOD_SEP, _, StateNone) => { + (&token::Colon, StateNone, _) | + (&token::ModSep, _, StateNone) => { p.bump(); break 'statement; } - (&token::COLON, st, _) | - (&token::MOD_SEP, _, st) => { + (&token::Colon, st, _) | + (&token::ModSep, _, st) => { p.bump(); state = st; } - (&token::EOF, _, _) => break 'statement, + (&token::Eof, _, _) => break 'statement, _ => break } } |
