Changeset cdbab55 for tests/coroutine/fmtLines.c
- Timestamp:
- Aug 21, 2018, 2:24:29 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 2a6292d
- Parents:
- 2b79a70 (diff), efa8b6a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 moved
-
tests/coroutine/fmtLines.c (moved) (moved from src/tests/coroutine/fmtLines.c ) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/coroutine/fmtLines.c
r2b79a70 rcdbab55 1 // 1 // 2 2 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo 3 3 // 4 4 // The contents of this file are covered under the licence agreement in the 5 5 // file "LICENCE" distributed with Cforall. 6 // 6 // 7 7 // fmtLines.cc -- format characters into blocks of 4 and groups of 5 blocks per line 8 // 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Sun Sep 17 21:56:15 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue May 15 12:25:33201813 // Update Count : 4 214 // 12 // Last Modified On : Thu Aug 16 08:20:54 2018 13 // Update Count : 45 14 // 15 15 16 #include <fstream >17 #include <coroutine >16 #include <fstream.hfa> 17 #include <coroutine.hfa> 18 18 19 19 coroutine Format { … … 23 23 24 24 void main( Format & fmt ) with( fmt ) { 25 for ( ;; ) {// for as many characters26 for ( g = 0; g < 5; g += 1 ) {// groups of 5 blocks27 for ( b = 0; b < 4; b += 1 ) {// blocks of 4 characters28 for ( ;; ) {// for newline characters25 for () { // for as many characters 26 for ( g; 5 ) { // groups of 5 blocks 27 for ( b; 4 ) { // blocks of 4 characters 28 for () { // for newline characters 29 29 suspend(); 30 30 if ( ch != '\n' ) break; // ignore newline … … 53 53 Format fmt; 54 54 55 eof: for ( ;; ) {// read until end of file55 eof: for () { // read until end of file 56 56 sin | fmt.ch; // read one character 57 57 if ( eof( sin ) ) break eof; // eof ?
Note:
See TracChangeset
for help on using the changeset viewer.