[Oberon] Newlines and Carriage-Returns

Andreas Pirklbauer andreas_pirklbauer at yahoo.com
Tue Jan 8 18:30:03 CET 2019

     > (a)   WHILE ~S.eot & (ch <= " ") DO .. END;
     > (b)   WHILE (ch = " ") OR (ch = TAB) OR (ch = CR) DO .. END;
     > (b) will not hang due to the fact that ch = 0X if S.eot is TRUE.
     > (b) is didactically cleaner, as it exactly states what characters are defined as "white spaces" and hence eaten away.
     > (b) is an explicit list of allowed white spaces.

On the other hand, it (b) is kept in module Texts.Scan (as it currently is), then following line will simply no longer
work in System.Tool if System.Tool is into an Oberon system in .txt format (with CR+LF as line ending):

     ORP.Compile A.Mod                       # if there is an CR + LF here, then only A.Mod is compiled, but not B.Mod
        B.Mod ~

This is one of the reasons why I use (a) and not (b).

PS: One may of course say "well, then just convert the file to Oberon format (with CR as line ending)”. Sure, one can always say that..

More information about the Oberon mailing list