Make sure ill-form macro handle propely
This commit is contained in:
parent
f80e1080d3
commit
b3b91046dd
@ -2,7 +2,7 @@
|
||||
//! `$ident => foo`, interpolates variables in the template, to get `fn foo() {}`
|
||||
|
||||
use syntax::SmolStr;
|
||||
use tt::Delimiter;
|
||||
use tt::{Delimiter, Subtree};
|
||||
|
||||
use super::ExpandResult;
|
||||
use crate::{
|
||||
@ -175,7 +175,10 @@ fn expand_repeat(
|
||||
counter += 1;
|
||||
if counter == limit {
|
||||
log::warn!("expand_tt in repeat pattern exceed limit => {:#?}\n{:#?}", template, ctx);
|
||||
break;
|
||||
return ExpandResult {
|
||||
value: Fragment::Tokens(Subtree::default().into()),
|
||||
err: Some(ExpandError::Other("Expand exceed limit".to_string())),
|
||||
};
|
||||
}
|
||||
|
||||
if e.is_some() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user