1
Fork 0

Run rustfmt on macro_parser.rs

This commit is contained in:
Mark Mansi 2018-01-18 21:18:04 -06:00
parent 711f71cfa9
commit 5ac48ec826

View file

@ -487,7 +487,9 @@ fn inner_parse_loop(
// Need to descend into a sequence // Need to descend into a sequence
TokenTree::Sequence(sp, seq) => { TokenTree::Sequence(sp, seq) => {
// Examine the case where there are 0 matches of this sequence // Examine the case where there are 0 matches of this sequence
if seq.op == quoted::KleeneOp::ZeroOrMore || seq.op == quoted::KleeneOp::ZeroOrOne { if seq.op == quoted::KleeneOp::ZeroOrMore
|| seq.op == quoted::KleeneOp::ZeroOrOne
{
let mut new_item = item.clone(); let mut new_item = item.clone();
new_item.match_cur += seq.num_captures; new_item.match_cur += seq.num_captures;
new_item.idx += 1; new_item.idx += 1;
@ -500,9 +502,9 @@ fn inner_parse_loop(
// For ZeroOrMore and OneOrMore, we want to examine the case were there is at // For ZeroOrMore and OneOrMore, we want to examine the case were there is at
// least one match. For ZeroOrOne, we only want the case where there is exactly // least one match. For ZeroOrOne, we only want the case where there is exactly
// one match. // one match.
if (seq.op == quoted::KleeneOp::ZeroOrOne && seq.num_captures == 1) || if (seq.op == quoted::KleeneOp::ZeroOrOne && seq.num_captures == 1)
seq.op != quoted::KleeneOp::ZeroOrOne { || seq.op != quoted::KleeneOp::ZeroOrOne
{
let matches = create_matches(item.matches.len()); let matches = create_matches(item.matches.len());
cur_items.push(Box::new(MatcherPos { cur_items.push(Box::new(MatcherPos {
stack: vec![], stack: vec![],