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
I use it to parse keywords and assure the keyword does not appear just as the start of an identifier: Word("keyword")
Now it turns out this gets expanded to: Word!(pegged.peg.wrapAround!(Spacing, pegged.peg.literal!"keyword", Spacing)). This is obviously not what I intended.
Putting the call in a <- rule prevents this, but makes things cumbersome when space consumption is wanted around the keyword (which would often be the case). IMO when I explicitly pass a single parser to a parameterized rule, that thing should be passed without addition, no matter the type of rule. Space consumption may happen inside the parameterized rule, if that rule is defined to be space-consuming.
The text was updated successfully, but these errors were encountered:
In a grammar I did something like this:
I use it to parse keywords and assure the keyword does not appear just as the start of an identifier:
Word("keyword")
Now it turns out this gets expanded to:
Word!(pegged.peg.wrapAround!(Spacing, pegged.peg.literal!"keyword", Spacing))
. This is obviously not what I intended.Putting the call in a
<-
rule prevents this, but makes things cumbersome when space consumption is wanted around the keyword (which would often be the case). IMO when I explicitly pass a single parser to a parameterized rule, that thing should be passed without addition, no matter the type of rule. Space consumption may happen inside the parameterized rule, if that rule is defined to be space-consuming.The text was updated successfully, but these errors were encountered: