Are Delimited strings and HereDoc strings just here to suck ?

Philippe Sigaud via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Aug 11 14:10:40 PDT 2014


On Mon, Aug 11, 2014 at 10:58 PM, H. S. Teoh via Digitalmars-d-learn
<digitalmars-d-learn at puremagic.com> wrote:

> In Flex, one way you can implement heredocs is to have a separate "mode"
> where the lexer is scanning for the ending string.  So basically you
> have a sub-lexer that treats the heredoc as three tokens, one that
> defines the ending string for the heredoc (which is never returned to
> the caller), one that contains the content of the heredoc, and the
> terminating token (also never returned to the caller).

Ah, a small, specialized sub-lexer. OK, I get it.


More information about the Digitalmars-d-learn mailing list