Steve Bennett wrote:
[actually the subject was "A Modest Proposal on grammar and parsers" but I wanted to merge it with the other thread] On 11/14/07, Brion Vibber brion@wikimedia.org wrote:
While that likely would mean changing some corner-case behavior (as noted above, the existing parser doesn't always do what's desired), it would not be a different *syntax* from the human perspective.
This is a very fine, but very important line you're drawing.
I had been assuming that not supporting the "some ''text[[foo|blah ''blah]]" case would count as changing the "syntax".
But that syntax is not salient, it is not important, it is arguably broken, and changing it is not "from the human perspective" necessarily even a change.
Now you're getting it. :)
Similarly, you can embed <gallery> tags in the middle of a sentence. Is this desirable? Is this a mistake? Does this form part of the actual "syntax" we want to support?
Distinguishing inline and block-level content is not something we very consistently do at this time; indeed it'd be nice to hammer this out a bit better.
What I might expect as ideal behavior would be for a block-level item such as that to split out the surrounding blocks.
Eg this:
first <gallery/> last
might expand to something like this:
<p>first</p>
<gallery/>
<p>last</p>
But I'm not 100% sure on that behavior.
Is it ok if I change the goal of the EBNF project from:
- To produce a grammar that precisely matches the parser as it currently
behaves.
This goal would be undesirable even if it's possible. :)
- To produce a grammar that is indistinguishable from the current parser as
it is normally used.
That would be more likely to be useful and feasible, for reasonable values of indistinguishable.
In other words: let's record the syntax as it exists in people's minds (and their existing work), rather than the behavior of the actual parser.
Bingo. :)
-- brion