Tweak error messages a bit
This commit is contained in:
parent
a118f54612
commit
4da1e369cd
1 changed files with 2 additions and 2 deletions
|
@ -159,7 +159,7 @@ impl<'cx, 's, 'i> Parser<'cx, 's, 'i> {
|
||||||
self.shift(1);
|
self.shift(1);
|
||||||
cond_tts.push(tt.clone());
|
cond_tts.push(tt.clone());
|
||||||
},
|
},
|
||||||
[] => self.render.cx.span_fatal(sp, "expected body for this `if`"),
|
[] => self.render.cx.span_fatal(sp, "expected body for this $if"),
|
||||||
}}
|
}}
|
||||||
let if_cond = self.new_rust_parser(cond_tts).parse_expr();
|
let if_cond = self.new_rust_parser(cond_tts).parse_expr();
|
||||||
// Parse the (optional) else
|
// Parse the (optional) else
|
||||||
|
@ -184,7 +184,7 @@ impl<'cx, 's, 'i> Parser<'cx, 's, 'i> {
|
||||||
self.shift(1);
|
self.shift(1);
|
||||||
Some(self.block(sp, &d.tts))
|
Some(self.block(sp, &d.tts))
|
||||||
},
|
},
|
||||||
_ => self.render.cx.span_fatal(sp, "invalid syntax"),
|
_ => self.render.cx.span_fatal(sp, "expected body for this $else"),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_ => None,
|
_ => None,
|
||||||
|
|
Loading…
Add table
Reference in a new issue