[DGD] Latest errors

Shentino shentino at gmail.com
Mon Apr 16 14:22:53 CEST 2012


On Mon, Apr 16, 2012 at 4:41 AM, Felix A. Croes <felix at dworkin.nl> wrote:
> Shentino <shentino at gmail.com> wrote:
>> I meant allowing the parse_string kfun to accept either CR, CRLF, or
>> LF as line separators in the grammar argument.
>
> It would not be as bad as hacking DGD to translate CRLF into LF in
> read_file().

Yes, this was such a big bogey on my "breaking stuff" radar I figured
there had to be a misunderstanding.  Messing with literal data read
from a file is an obvious no-no, ditto for raw data fed into the
parser to be tokenized and parsed.

Grammars themselves however are collections of rules with their own
syntax.  My assumption was that CR's could just be added to the
collection of whitespace characters that separate one rule from
another.

> But handling CRLF "automagically" never works completely
> right, not even on Windows, where you cannot distinguish between
> "Foo\r\n" as text and as a binary string.  In my view, DGD should be
> able to make the distinction; I especially object to breaking this on
> other platforms for the sake of misguided Windows compatibility.
>
> Better to accept the discipline of using LF for line endings even on
> Windows.

Definitely a safe default.

> Regards,
> Felix Croes
> ___________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd



More information about the DGD mailing list