Open sineptic opened 1 month ago
This may mean that your parser is trying to infinitely recurse (stacker allocates more memory for the stack for deep recursion), can you provide the code for it?
Yes, I agree. This looks like left recursion.
I implement #653 and write this:
// ...
recursive(|x| {
x.then_with(move |ctx: Context| {
take_until(just::<_, _, Simple<char>>('`').repeated().at_least(1)).map(
move |(chars, ticks)| match ticks.len() {
n if n == backticks => Context::Ok(
[ctx.clone().into_intermediate_state().unwrap(), chars]
.concat(),
ticks,
),
_ => Context::IntermediateState(
[
ctx.clone().into_intermediate_state().unwrap(),
chars,
ticks,
]
.concat(),
),
},
)
})
})
.map(|x| match x {
Context::Ok(a, b) => (a, b),
Context::IntermediateState(_) => unreachable!(),
})
// ...
And have Infinite recursion. How can I avoid this?
I presume that you're using 0.9.
I don't see anything here that would result in infinite recursion (to be clear, do you mean infinite recursion or infinite iteration?) by itself, the problem must be elsewhere.
When i run my parser(application). There is this error
and it freezes.
When I try to
RUST_BACKTRACE=1
it run smth but, and print onlymemory allocation of {different count} bytes failed
and then run, but don't print.I can build without problem.