mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
refactor the if if
This commit is contained in:
parent
d3858f7465
commit
73fde17017
@ -365,10 +365,14 @@ fn parse_options<'a>(
|
|||||||
|
|
||||||
'blk: {
|
'blk: {
|
||||||
for (symbol, option) in OPTIONS {
|
for (symbol, option) in OPTIONS {
|
||||||
let expect =
|
let kw_matched =
|
||||||
!is_global_asm || ast::InlineAsmOptions::GLOBAL_OPTIONS.contains(option);
|
if !is_global_asm || ast::InlineAsmOptions::GLOBAL_OPTIONS.contains(option) {
|
||||||
|
p.eat_keyword(symbol)
|
||||||
|
} else {
|
||||||
|
p.eat_keyword_noexpect(symbol)
|
||||||
|
};
|
||||||
|
|
||||||
if if expect { p.eat_keyword(symbol) } else { p.eat_keyword_noexpect(symbol) } {
|
if kw_matched {
|
||||||
try_set_option(p, args, is_global_asm, symbol, option);
|
try_set_option(p, args, is_global_asm, symbol, option);
|
||||||
break 'blk;
|
break 'blk;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user