Ignore:
Timestamp:
Aug 17, 2024, 3:15:21 PM (16 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
df2e00f
Parents:
afb15cf
Message:

first attempt changing end-of-file to an exception

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/coroutine/fmtLines.cfa

    rafb15cf r3ac5fd8  
    1010// Created On       : Sun Sep 17 21:56:15 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 22 13:41:16 2019
    13 // Update Count     : 58
     12// Last Modified On : Sat Aug 17 14:26:03 2024
     13// Update Count     : 60
    1414//
    1515
     
    5454        sout | nlOff;                                                                           // turn off auto newline
    5555
    56   eof: for () {                                                                                 // read until end of file
    57                 sin | fmt.ch;                                                                   // read one character
    58           if ( eof( sin ) ) break eof;                                          // eof ?
    59                 format( fmt );                                                                  // push character for formatting
    60         } // for
     56        try {
     57                for () {                                                                                // read until end of file
     58                        sin | fmt.ch;                                                           // read one character
     59                        format( fmt );                                                          // push character for formatting
     60                } // for
     61        } catch( end_of_file * ) {
     62        } // try
    6163} // main
    62 
    63 // Local Variables: //
    64 // tab-width: 4 //
    65 // compile-command: "cfa fmtLines.cfa" //
    66 // End: //
Note: See TracChangeset for help on using the changeset viewer.