Backtick Hickup

Eric Astor eastor1 at swarthmore.edu
Mon Aug 20 19:12:29 EDT 2007


Jacob Rus wrote:

> John MacFarlane wrote:

>>

>> There's no way of knowing whether the initial two *'s should start

>> strong emphasis unless you scan forward.

>

> I really don't see why it can't recognize *** as a unique token, and

> figure out how to do the right thing by just adding a few more rules.

> This doesn't seem like an insoluble problem to me.

>

> -Jacob


Well, ANTLR, in particular, allows the arbitrary lookahead that would
"scan forward", and thus fix the problem - so it's clearly possible to
fix that way, while still keeping a formal grammar. Recognizing *** as a
unique token would be fairly kludgy, and probably lead to still more
edge cases/complexities in the parser.

Realistically, the lexer should just recognize '*' as a token, and
resolve the complexities in the parser - and I think that might make the
whole point moot anyhow.

- Eric


More information about the Markdown-Discuss mailing list