Fork us on GitHub Follow us on Facebook Follow us on Twitter

Ignore:
Timestamp:
2012-08-04T03:51:15Z (9 years ago)
Author:
Sean Bartell <wingedtachikoma@…>
Branches:
lfn, master
Children:
0ce0103
Parents:
e3f2765
Message:

Bithenge: add do{}while() transforms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/dist/src/bithenge/test-repeat.bh

    re3f2765 rc3437d9  
    77
    88transform without_count = struct {
    9         .error <- repeat { uint8 <- zero_terminated };
    10         .end <- repeat { uint8 };
     9        .until_error <- repeat { uint8 <- zero_terminated };
     10        .until_end <- repeat { uint8 };
    1111};
     12
     13transform do_while = do {
     14        struct {
     15                .valid <- nonzero_boolean <- uint8;
     16                .val <- uint8;
     17        }
     18} while (.valid);
    1219
    1320transform main = struct {
    1421        .with_count <- with_count;
    15         .without_count <- without_count;
     22        .without_count <- without_count <- known_length(9);
     23        .do_while <- do_while;
    1624};
Note: See TracChangeset for help on using the changeset viewer.