rustc_ast: Harmonize delimiter naming with proc_macro::Delimiter
This commit is contained in:
parent
0e7915d11f
commit
2733ec1be3
41 changed files with 433 additions and 426 deletions
|
@ -1,6 +1,6 @@
|
|||
use rustc_ast as ast;
|
||||
use rustc_ast::ptr::P;
|
||||
use rustc_ast::token;
|
||||
use rustc_ast::token::{self, Delimiter};
|
||||
use rustc_ast::tokenstream::TokenStream;
|
||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||
use rustc_errors::{Applicability, PResult};
|
||||
|
@ -395,9 +395,9 @@ fn parse_options<'a>(
|
|||
) -> PResult<'a, ()> {
|
||||
let span_start = p.prev_token.span;
|
||||
|
||||
p.expect(&token::OpenDelim(token::DelimToken::Paren))?;
|
||||
p.expect(&token::OpenDelim(Delimiter::Parenthesis))?;
|
||||
|
||||
while !p.eat(&token::CloseDelim(token::DelimToken::Paren)) {
|
||||
while !p.eat(&token::CloseDelim(Delimiter::Parenthesis)) {
|
||||
if !is_global_asm && p.eat_keyword(sym::pure) {
|
||||
try_set_option(p, args, sym::pure, ast::InlineAsmOptions::PURE);
|
||||
} else if !is_global_asm && p.eat_keyword(sym::nomem) {
|
||||
|
@ -421,7 +421,7 @@ fn parse_options<'a>(
|
|||
}
|
||||
|
||||
// Allow trailing commas
|
||||
if p.eat(&token::CloseDelim(token::DelimToken::Paren)) {
|
||||
if p.eat(&token::CloseDelim(Delimiter::Parenthesis)) {
|
||||
break;
|
||||
}
|
||||
p.expect(&token::Comma)?;
|
||||
|
@ -436,9 +436,9 @@ fn parse_options<'a>(
|
|||
fn parse_clobber_abi<'a>(p: &mut Parser<'a>, args: &mut AsmArgs) -> PResult<'a, ()> {
|
||||
let span_start = p.prev_token.span;
|
||||
|
||||
p.expect(&token::OpenDelim(token::DelimToken::Paren))?;
|
||||
p.expect(&token::OpenDelim(Delimiter::Parenthesis))?;
|
||||
|
||||
if p.eat(&token::CloseDelim(token::DelimToken::Paren)) {
|
||||
if p.eat(&token::CloseDelim(Delimiter::Parenthesis)) {
|
||||
let err = p.sess.span_diagnostic.struct_span_err(
|
||||
p.token.span,
|
||||
"at least one abi must be provided as an argument to `clobber_abi`",
|
||||
|
@ -454,7 +454,7 @@ fn parse_clobber_abi<'a>(p: &mut Parser<'a>, args: &mut AsmArgs) -> PResult<'a,
|
|||
}
|
||||
Err(opt_lit) => {
|
||||
// If the non-string literal is a closing paren then it's the end of the list and is fine
|
||||
if p.eat(&token::CloseDelim(token::DelimToken::Paren)) {
|
||||
if p.eat(&token::CloseDelim(Delimiter::Parenthesis)) {
|
||||
break;
|
||||
}
|
||||
let span = opt_lit.map_or(p.token.span, |lit| lit.span);
|
||||
|
@ -466,7 +466,7 @@ fn parse_clobber_abi<'a>(p: &mut Parser<'a>, args: &mut AsmArgs) -> PResult<'a,
|
|||
};
|
||||
|
||||
// Allow trailing commas
|
||||
if p.eat(&token::CloseDelim(token::DelimToken::Paren)) {
|
||||
if p.eat(&token::CloseDelim(Delimiter::Parenthesis)) {
|
||||
break;
|
||||
}
|
||||
p.expect(&token::Comma)?;
|
||||
|
@ -501,7 +501,7 @@ fn parse_reg<'a>(
|
|||
p: &mut Parser<'a>,
|
||||
explicit_reg: &mut bool,
|
||||
) -> PResult<'a, ast::InlineAsmRegOrRegClass> {
|
||||
p.expect(&token::OpenDelim(token::DelimToken::Paren))?;
|
||||
p.expect(&token::OpenDelim(Delimiter::Parenthesis))?;
|
||||
let result = match p.token.uninterpolate().kind {
|
||||
token::Ident(name, false) => ast::InlineAsmRegOrRegClass::RegClass(name),
|
||||
token::Literal(token::Lit { kind: token::LitKind::Str, symbol, suffix: _ }) => {
|
||||
|
@ -515,7 +515,7 @@ fn parse_reg<'a>(
|
|||
}
|
||||
};
|
||||
p.bump();
|
||||
p.expect(&token::CloseDelim(token::DelimToken::Paren))?;
|
||||
p.expect(&token::CloseDelim(Delimiter::Parenthesis))?;
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue