Ignore:
Timestamp:
Dec 6, 2017, 8:01:23 AM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
16988e8
Parents:
65197c2
Message:

add "with" clause to test programs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/coroutine/fmtLines.c

    r65197c2 r971d9f2  
    1010// Created On       : Sun Sep 17 21:56:15 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Oct  1 11:57:19 2017
    13 // Update Count     : 34
     12// Last Modified On : Tue Dec  5 21:56:35 2017
     13// Update Count     : 38
    1414//
    1515
     
    2626}
    2727
    28 void ^?{}( Format & fmt ) {
    29         if ( fmt.g != 0 || fmt.b != 0 ) sout | endl;
     28void ^?{}( Format & fmt ) with( fmt ) {
     29        if ( g != 0 || b != 0 ) sout | endl;
    3030}
    3131
    32 void main( Format & fmt ) {
     32void main( Format & fmt ) with( fmt ) {
    3333        for ( ;; ) {                                                                            // for as many characters
    34                 for ( fmt.g = 0; fmt.g < 5; fmt.g += 1 ) {              // groups of 5 blocks
    35                         for ( fmt.b = 0; fmt.b < 4; fmt.b += 1 ) {      // blocks of 4 characters
     34                for ( g = 0; g < 5; g += 1 ) {                                  // groups of 5 blocks
     35                        for ( b = 0; b < 4; b += 1 ) {                          // blocks of 4 characters
    3636                                for ( ;; ) {                                                    // for newline characters
    3737                                        suspend();
    38                                         if ( fmt.ch != '\n' ) break;            // ignore newline
     38                                        if ( ch != '\n' ) break;                        // ignore newline
    3939                                } // for
    40                                 sout | fmt.ch;                                                  // print character
     40                                sout | ch;                                                              // print character
    4141                        } // for
    4242                        sout | "  ";                                                            // print block separator
Note: See TracChangeset for help on using the changeset viewer.