Changeset 58b2638
- Timestamp:
- Dec 2, 2021, 5:11:22 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 8e658241
- Parents:
- 1894e03
- Location:
- libcfa/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/Makefile.am
r1894e03 r58b2638 84 84 time.hfa \ 85 85 bits/weakso_locks.hfa \ 86 algorithms/range_iterator.hfa \ 86 87 containers/maybe.hfa \ 87 88 containers/pair.hfa \ -
libcfa/src/algorithms/range_iterator.cfa
r1894e03 r58b2638 14 14 // 15 15 16 #include "range_iterator.hfa" 16 17 18 #include <stdio.h> 17 19 18 void main(RangeParser & this) { 20 #include <fstream.hfa> 21 22 void main(RangeIter & this) { 19 23 for() { 20 24 this._start = -1; 21 25 this._stop = -1; 22 26 int start_len = -1, stop_len = -1; 23 int ret = sscanf(this.text, "%u%n-%u%n", &this._start, &start_len, & stop, &stop_len);27 int ret = sscanf(this.text, "%u%n-%u%n", &this._start, &start_len, &this._stop, &stop_len); 24 28 switch(ret) { 25 29 case 0: … … 44 48 } 45 49 this.text += stop_len; 46 for(this.com i= this._start; this.com <= this._stop; this.com++) {50 for(this.com = this._start; this.com <= this._stop; this.com++) { 47 51 suspend; 48 52 } -
libcfa/src/algorithms/range_iterator.hfa
r1894e03 r58b2638 17 17 const char * text; 18 18 int com; 19 int 19 int _start; 20 int _stop; 20 21 }; 21 22 … … 24 25 } 25 26 26 static inline bool next(RangeIter & this) { return resume(this).com > 0; }27 static inline bool moveNext(RangeIter & this) { resume(this); return this.com > 0; }
Note: See TracChangeset
for help on using the changeset viewer.