You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by agatti February 15, 2024
Hi there!
I'm using pest for the very first time and I'm not sure if I bumped into a bug or not. So, given this grammar fragment on the latest stable version (2.7.7 with "grammar-extras"):
tag = {
// stuff here
}
container = {
// stuff here
"{" ~ #tags=tag* ~ "}"
// more stuff here
}
I'd assume that calling find_tagged("tags") on a Pair<Rule::container> would return all the Pair<Rule::tag> that are between brackets. However what I see is that find_tagged returns only the last tag seen by the parser, as if there's just one available pair per tag and it gets overwritten as the parser goes through data. The grammar seems to be correct as if I remove the #tags= bit and do the inner pair iteration myself all the tags are there.
I've read the pest book and I couldn't find anything saying there are limitations on tags attached to rules that may yield more than a pair. Is this a bug, an undocumented limitation, or am I doing things wrong somewhere?
The text was updated successfully, but these errors were encountered:
Discussed in #979
Originally posted by agatti February 15, 2024
Hi there!
I'm using pest for the very first time and I'm not sure if I bumped into a bug or not. So, given this grammar fragment on the latest stable version (2.7.7 with "grammar-extras"):
I'd assume that calling
find_tagged("tags")
on aPair<Rule::container>
would return all thePair<Rule::tag>
that are between brackets. However what I see is thatfind_tagged
returns only the last tag seen by the parser, as if there's just one available pair per tag and it gets overwritten as the parser goes through data. The grammar seems to be correct as if I remove the#tags=
bit and do the inner pair iteration myself all the tags are there.I've read the pest book and I couldn't find anything saying there are limitations on tags attached to rules that may yield more than a pair. Is this a bug, an undocumented limitation, or am I doing things wrong somewhere?
The text was updated successfully, but these errors were encountered: