Changeset 971d9f2 for src/tests/coroutine/fmtLines.c
- Timestamp:
- Dec 6, 2017, 8:01:23 AM (7 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/coroutine/fmtLines.c
r65197c2 r971d9f2 10 10 // Created On : Sun Sep 17 21:56:15 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Oct 1 11:57:19201713 // Update Count : 3 412 // Last Modified On : Tue Dec 5 21:56:35 2017 13 // Update Count : 38 14 14 // 15 15 … … 26 26 } 27 27 28 void ^?{}( Format & fmt ) {29 if ( fmt.g != 0 || fmt.b != 0 ) sout | endl;28 void ^?{}( Format & fmt ) with( fmt ) { 29 if ( g != 0 || b != 0 ) sout | endl; 30 30 } 31 31 32 void main( Format & fmt ) {32 void main( Format & fmt ) with( fmt ) { 33 33 for ( ;; ) { // for as many characters 34 for ( fmt.g = 0; fmt.g < 5; fmt.g += 1 ) {// groups of 5 blocks35 for ( fmt.b = 0; fmt.b < 4; fmt.b += 1 ) {// blocks of 4 characters34 for ( g = 0; g < 5; g += 1 ) { // groups of 5 blocks 35 for ( b = 0; b < 4; b += 1 ) { // blocks of 4 characters 36 36 for ( ;; ) { // for newline characters 37 37 suspend(); 38 if ( fmt.ch != '\n' ) break;// ignore newline38 if ( ch != '\n' ) break; // ignore newline 39 39 } // for 40 sout | fmt.ch;// print character40 sout | ch; // print character 41 41 } // for 42 42 sout | " "; // print block separator
Note: See TracChangeset
for help on using the changeset viewer.