From b93dc94cdbafeae93849061e5bfbcc0e4b07f411 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 13 Jul 1987 13:34:56 +0000 Subject: [PATCH] Added and corrected some comments --- lang/m2/libm2/LIST | 2 +- lang/m2/libm2/PascalIO.def | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lang/m2/libm2/LIST b/lang/m2/libm2/LIST index 17b8c69a2..622df777b 100644 --- a/lang/m2/libm2/LIST +++ b/lang/m2/libm2/LIST @@ -15,9 +15,9 @@ Conversion.mod Semaphores.mod random.mod Strings.mod -Traps.mod Arguments.c catch.c +Traps.mod LtoUset.e StrAss.c absd.c diff --git a/lang/m2/libm2/PascalIO.def b/lang/m2/libm2/PascalIO.def index 5a26b6dea..f8a1f28c0 100644 --- a/lang/m2/libm2/PascalIO.def +++ b/lang/m2/libm2/PascalIO.def @@ -52,13 +52,19 @@ DEFINITION MODULE PascalIO; (* Advances the "read pointer" by one character *) PROCEDURE Eoln(InputText: Text): BOOLEAN; - (* Returns TRUE if the next character of the InputText is a linefeed *) + (* Returns TRUE if the next character of the InputText is a linefeed. + Unlike Pascal however, it does not produce a runtime error when + called when Eof(InputText) is TRUE. + *) PROCEDURE Eof(InputText: Text): BOOLEAN; (* Returns TRUE if the end of the InputText is reached *) PROCEDURE ReadChar(InputText: Text; VAR Char: CHAR); - (* Read a character from the InputText, and leave result in "Char" *) + (* Read a character from the InputText, and leave result in "Char". + Unlike Pascal, if Eoln(InputText) is true, the newline character + is put in "Char". + *) PROCEDURE ReadLn(InputText: Text); (* Skip the rest of the current line of the InputText, @@ -74,9 +80,9 @@ DEFINITION MODULE PascalIO; PROCEDURE ReadCardinal(InputText: Text; VAR Cardinal: CARDINAL); (* Skip leading blanks, read a cardinal from the InputText, and leave the - result in "card". + result in "Cardinal". If no cardinal is read, or when overflow occurs, a runtime error results. - Input stops at the character following the integer. + Input stops at the character following the cardinal. *) PROCEDURE ReadReal(InputText: Text; VAR Real: REAL); @@ -87,7 +93,7 @@ DEFINITION MODULE PascalIO; [ E [(+|-)] digit {digit} ] If no real is read, or when overflow/underflow occurs, a runtime error results. - Input stops at the character following the integer. + Input stops at the character following the real. *) (*************************************************************************** @@ -118,8 +124,8 @@ DEFINITION MODULE PascalIO; PROCEDURE WriteBoolean(OutputText: Text; Boolean: BOOLEAN; Width: CARDINAL); (* Write boolean "Boolean" to the OutputText, using at least "Width" places, blank-padding to the left if needed. - Equivalent to WriteString(" TRUE", Width), or - WriteString("FALSE", Width) + Equivalent to WriteString(OutputText, " TRUE", Width), or + WriteString(OutputText, "FALSE", Width) *) PROCEDURE WriteString(OutputText: Text; -- 2.34.1