Skip to content

Commit 289b1b4

Browse files
committed
Reindent code
1 parent fdadba5 commit 289b1b4

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/libsyntax/ext/tt/macro_rules.rs

+22-22
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,17 @@ fn generic_extension<'cx>(cx: &'cx ExtCtxt,
169169
let mut best_fail_msg = "internal error: ran no matchers".to_string();
170170

171171
for (i, lhs) in lhses.iter().enumerate() { // try each arm's matchers
172-
let lhs_tt = match *lhs {
173-
TokenTree::Delimited(_, ref delim) => &delim.tts[..],
174-
_ => panic!(cx.span_fatal(sp, "malformed macro lhs"))
175-
};
172+
let lhs_tt = match *lhs {
173+
TokenTree::Delimited(_, ref delim) => &delim.tts[..],
174+
_ => panic!(cx.span_fatal(sp, "malformed macro lhs"))
175+
};
176176

177-
match TokenTree::parse(cx, lhs_tt, arg) {
178-
Success(named_matches) => {
177+
match TokenTree::parse(cx, lhs_tt, arg) {
178+
Success(named_matches) => {
179179
let rhs = match rhses[i] {
180-
// ignore delimiters
181-
TokenTree::Delimited(_, ref delimed) => delimed.tts.clone(),
182-
_ => panic!(cx.span_fatal(sp, "macro rhs must be delimited")),
180+
// ignore delimiters
181+
TokenTree::Delimited(_, ref delimed) => delimed.tts.clone(),
182+
_ => panic!(cx.span_fatal(sp, "macro rhs must be delimited")),
183183
};
184184
// rhs has holes ( `$id` and `$(...)` that need filled)
185185
let trncbr = new_tt_reader(&cx.parse_sess().span_diagnostic,
@@ -199,15 +199,15 @@ fn generic_extension<'cx>(cx: &'cx ExtCtxt,
199199
site_span: sp,
200200
macro_ident: name
201201
})
202-
}
203-
Failure(sp, ref msg) => if sp.lo >= best_fail_spot.lo {
202+
}
203+
Failure(sp, ref msg) => if sp.lo >= best_fail_spot.lo {
204204
best_fail_spot = sp;
205205
best_fail_msg = (*msg).clone();
206-
},
207-
Error(err_sp, ref msg) => {
206+
},
207+
Error(err_sp, ref msg) => {
208208
panic!(cx.span_fatal(err_sp.substitute_dummy(sp), &msg[..]))
209-
}
210209
}
210+
}
211211
}
212212

213213
panic!(cx.span_fatal(best_fail_spot.substitute_dummy(sp), &best_fail_msg[..]));
@@ -310,14 +310,14 @@ fn check_lhs_nt_follows(cx: &mut ExtCtxt, lhs: &TokenTree, sp: Span) {
310310
// lhs is going to be like TokenTree::Delimited(...), where the
311311
// entire lhs is those tts. Or, it can be a "bare sequence", not wrapped in parens.
312312
match lhs {
313-
&TokenTree::Delimited(_, ref tts) => {
314-
check_matcher(cx, tts.tts.iter(), &Eof);
315-
},
316-
tt @ &TokenTree::Sequence(..) => {
317-
check_matcher(cx, Some(tt).into_iter(), &Eof);
318-
},
319-
_ => cx.span_err(sp, "Invalid macro matcher; matchers must be contained \
320-
in balanced delimiters or a repetition indicator")
313+
&TokenTree::Delimited(_, ref tts) => {
314+
check_matcher(cx, tts.tts.iter(), &Eof);
315+
},
316+
tt @ &TokenTree::Sequence(..) => {
317+
check_matcher(cx, Some(tt).into_iter(), &Eof);
318+
},
319+
_ => cx.span_err(sp, "Invalid macro matcher; matchers must be contained \
320+
in balanced delimiters or a repetition indicator")
321321
};
322322
// we don't abort on errors on rejection, the driver will do that for us
323323
// after parsing/expansion. we can report every error in every macro this way.

0 commit comments

Comments
 (0)