Mark Morgan Lloyd wrote 10 lines
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.
To keep the syntax correct, you can break after every symbol, that is:
not inside identifiers,
not inside numbers (including floating point constants) not inside quoted strings
but anywhere else
I am using a Pascal pretty print program, that knows about the syntax (a little) and outputs the source in lines of 72 chars at most - this limit can be modified via parameter, IIRC.
But: at the moment it accepts only classical Pascal syntax (my extension of Stanford P4) - no FPC. So it makes not much sense to share it. But I compiled it with FPC recently, and it ran without problems on Windows.
Kind regards
Bernd