We have a recursive token parser. Previously to support # we tacked support on inside the plural parser with <|>. This worked for shallow usages, but not for nested/deep usages in which we'd recurse back around to the aforementioned token parser sans # support.
We now instead keep track of plural State. When we encounter # in that top-level token parser, we inspect what plural context we're in. If we're in one, we parse as an interpolation. If we're not, we fail/skip the parse leading to it parsing as plaintext.
In order to support State in our Parser, we now use the ParsecT type where the T stands for "transformer". The previously used Parsec type was a mere alias around this with the Identity monad instead of our State monad, hence how little code changed.
Fixes #65.
We have a recursive token parser. Previously to support
#
we tacked support on inside the plural parser with<|>
. This worked for shallow usages, but not for nested/deep usages in which we'd recurse back around to the aforementioned token parser sans#
support.We now instead keep track of plural
State
. When we encounter#
in that top-level token parser, we inspect what plural context we're in. If we're in one, we parse as an interpolation. If we're not, we fail/skip the parse leading to it parsing as plaintext.In order to support
State
in ourParser
, we now use theParsecT
type where theT
stands for "transformer". The previously usedParsec
type was a mere alias around this with theIdentity
monad instead of ourState
monad, hence how little code changed.