diff options
Diffstat (limited to 'gcc/m2/gm2-libs-iso/TextIO.mod')
-rw-r--r-- | gcc/m2/gm2-libs-iso/TextIO.mod | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/gcc/m2/gm2-libs-iso/TextIO.mod b/gcc/m2/gm2-libs-iso/TextIO.mod index 75998300bed..a6ca17edecb 100644 --- a/gcc/m2/gm2-libs-iso/TextIO.mod +++ b/gcc/m2/gm2-libs-iso/TextIO.mod @@ -31,28 +31,13 @@ IMPORT IOChan, IOConsts, CharClass, ASCII ; FROM SYSTEM IMPORT ADR ; FROM FIO IMPORT FlushOutErr ; FROM libc IMPORT printf ; +FROM TextUtil IMPORT SkipSpaces, EofOrEoln, CharAvailable ; CONST DebugState = FALSE ; - (* The following procedures do not read past line marks *) - -PROCEDURE CharAvailable (cid: IOChan.ChanId) : BOOLEAN ; -BEGIN - RETURN( (IOChan.ReadResult (cid) = IOConsts.notKnown) OR - (IOChan.ReadResult (cid) = IOConsts.allRight) ) -END CharAvailable ; - - -PROCEDURE EofOrEoln (cid: IOChan.ChanId) : BOOLEAN ; -BEGIN - RETURN( (IOChan.ReadResult (cid) = IOConsts.endOfLine) OR - (IOChan.ReadResult (cid) = IOConsts.endOfInput) ) -END EofOrEoln ; - - (* DumpState *) @@ -176,27 +161,6 @@ BEGIN END ReadString ; -(* - SkipSpaces - skips any spaces. -*) - -PROCEDURE SkipSpaces (cid: IOChan.ChanId) ; -VAR - ch : CHAR ; - res: IOConsts.ReadResults ; -BEGIN - WHILE CharAvailable (cid) DO - IOChan.Look(cid, ch, res) ; - IF (res=IOConsts.allRight) AND CharClass.IsWhiteSpace (ch) - THEN - IOChan.Skip (cid) - ELSE - RETURN - END - END -END SkipSpaces ; - - PROCEDURE ReadToken (cid: IOChan.ChanId; VAR s: ARRAY OF CHAR); (* Skips leading spaces, and then removes characters from the input stream cid before the next space or line mark, |