Hello all, I've began writing the parsing section of the spec, and I though I'd let you know about where I'm heading with all this. Basically, parsing is defined as three consecutive passes: parsing document elements, parsing block elements and parsing span elements. Each pass is going to contain a set of rules the parser should attempt to match while parsing the input. Rules are expressed in English, but are highly structured so that it should be pretty straightforward to convert to a formal grammar if the grammar is powerful enough to express them. I'm not saying too much here; elaborate explanations are better in the spec than in this volatile email. If you're interested, take a look and tell me what you think: <http://michelf.com/specs/markdown-extra/#parsing> Michel Fortin michel.fortin at michelf.com http://michelf.com/
On Thu, May 8, 2008 at 8:59 PM, Michel Fortin <michel.fortin at michelf.com> wrote:> Basically, parsing is defined as three consecutive passes: parsing document > elements, parsing block elements and parsing span elements.Looks good so far. The most delicate part is still to come (defining indentation for lists, and (X)(HT)ML fragments in the text flow). -- Andrea Censi PhD student, Control & Dynamical Systems, Caltech http://www.cds.caltech.edu/~andrea/ "Life is too important to be taken seriously" (Oscar Wilde)
I agree. This is starting to look very good and I think this is the right approach. I am eagerly waiting for the really hard parts, though. - yuri> > Basically, parsing is defined as three consecutive passes: parsing document > > elements, parsing block elements and parsing span elements. > > Looks good so far. > > The most delicate part is still to come (defining indentation for > lists, and (X)(HT)ML fragments in the text flow).-- http://sputnik.freewisdom.org/
Michel, I think there's a problem with:> refname > > A run of one or more characters, excluding any newline and U+005D > Closing Square Bracket.This doesn't allow refnames with embedded brackets. But PHP Markdown allows [[hi]](/url) as a valid link. Also, PHP Markdown currently allows embedded newlines, which are excluded by your definition: [hi there](/url) Of course, embedded *blank* lines should be excluded. John +++ Michel Fortin [May 08 08 23:59 ]:> Hello all, > > I've began writing the parsing section of the spec, and I though I'd let > you know about where I'm heading with all this. > > Basically, parsing is defined as three consecutive passes: parsing > document elements, parsing block elements and parsing span elements. > Each pass is going to contain a set of rules the parser should attempt > to match while parsing the input. Rules are expressed in English, but > are highly structured so that it should be pretty straightforward to > convert to a formal grammar if the grammar is powerful enough to express > them. > > I'm not saying too much here; elaborate explanations are better in the > spec than in this volatile email. If you're interested, take a look and > tell me what you think: > <http://michelf.com/specs/markdown-extra/#parsing> > > > Michel Fortin > michel.fortin at michelf.com > http://michelf.com/ > > > _______________________________________________ > Markdown-Discuss mailing list > Markdown-Discuss at six.pairlist.net > http://six.pairlist.net/mailman/listinfo/markdown-discuss >
I've clarified and changed a few things about some parsing rules and started defining new rules for the block elements pass. Of notice is the "flat code block" in the block elements pass, which is is going to be part of the next version of PHP Markdown Extra. Michel Fortin michel.fortin at michelf.com http://michelf.com/
Michel Fortin wrote:> I've began writing the parsing section of the spec, and I though I'd let > you know about where I'm heading with all this.You should write it in something closer to a BNF-like format. The current version is about 10x more verbose than necessary, and it makes reading the spec considerably more difficult.