[fpc-pascal] Breaking Pascal source lines

Frederic Da Vitoria davitofrg at gmail.com
Fri Sep 6 15:35:23 CEST 2013


2013/9/6 Mark Morgan Lloyd <markMLl.fpc-pascal at telemetry.co.uk>

> I'm sure there isn't a single "right" answer to this question, but if
> transferring Pascal source to a system that enforces short lines (e.g. 78
> chars + CRLF) what's the best automatic breaking rule?
>
> One possibility is obviously to break after the rightmost space, but is it
> valid to break after e.g. . (if not followed by a digit), ^ and possibly
> others?
>
> Syntax errors are acceptable. Truncation isn't.
>

Yes.

You could also split after ] and := and ;

More tricky, you could recognize < < <> <= and <=

But your splitter must be able to know when it is inside a string (no
splitting) and outside. Which means your splitter should be able to
recognize the right quote too and split after it if suitable.

-- 
Frederic Da Vitoria
(davitof)

Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130906/90a61aa5/attachment.html>


More information about the fpc-pascal mailing list