From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,50e705cdf2767cc6 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Natasha Kerensikova Newsgroups: comp.lang.ada Subject: Re: Parser interface design Date: Wed, 13 Apr 2011 08:20:59 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <4d9c8c19$0$6769$9b4e6d93@newsspool3.arcor-online.net> <1ovsbvdul64pw$.1q49g3o7n296m$.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Date: Wed, 13 Apr 2011 08:20:59 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="Mda950WjNwNLAFOE7yJXQw"; logging-data="938"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19dd5KU0UfIKFi3Ey5HSZ6K" User-Agent: slrn/0.9.9p1 (FreeBSD) Cancel-Lock: sha1:AwFc7iYm13bplpXyK8ofJAhtI9I= Xref: g2news1.google.com comp.lang.ada:18781 Date: 2011-04-13T08:20:59+00:00 List-Id: Hello, On 2011-04-12, Simon Wright wrote: > "Dmitry A. Kazakov" writes: > >> On Tue, 12 Apr 2011 16:13:30 +0000 (UTC), Natasha Kerensikova wrote: >> >>> On 2011-04-08, Simon Wright wrote: >> >>>> In other words, HTML.Emphasize ("bar") would return "bar", but >>>> No_Op ("bar") would just return "bar". >>> >>> And that's exactly why disabling emphasis should be done on the parser >>> level: the callback only has the semantic information ("render bar >>> emphasized") without any knowledge of how it was obtained (the source >>> could have been "foo *bar* baz" or "foo _bar_ baz"). Therefore no >>> callback can reconstruct the intact input. >> >> That looks wrong to me. I think that obvious design is to move it to the >> renderer: >> >> HTML.Emphasize ("bar") -> "bar" >> ASCII.Emphasize ("bar") -> "*bar*" >> Plain_Text.Emphasize ("bar") -> "bar" >> Gtk_Text_Buffer.Emphasize ("bar") -> sets tags around the text slice >> ... >> >> Parser just calls On_Emphasize, the implementation of routes it to the >> renderer's Emphasize, which figures out what to do. > > Clearly you and I think similarly here. But Natasha is (as well as being > the potential implementer) the customer. I'm afraid you're both missing the issue. Dmitry's example is clearly about different kind of emphasis, while I'm talking about *disabling* emphasis. I understand that emphasis is such a mild feature that you might miss the point of why disabling it at all, so let's consider another Markdown feature: inline HTML tag. According to Markdown specification, when encountering "