source: mainline/uspace/dist/src/bithenge/repeat.bh

Last change on this file was 1c79996, checked in by Sean Bartell <wingedtachikoma@…>, 13 years ago

Bithenge: fix issues and expand coverage for test.sh

  • Property mode set to 100644
File size: 618 bytes
RevLine 
[e3f2765]1transform with_count = struct {
[0caaaa00]2 .none <- repeat(0) { uint8 };
3 .one <- repeat(1) { uint8 };
4 .count <- uint8;
[c12b2ae]5 if (true) { # test whether .count is still accessible
6 .many <- repeat(.count) { uint8 };
7 }
[0caaaa00]8};
[e3f2765]9
10transform without_count = struct {
[c3437d9]11 .until_error <- repeat { uint8 <- zero_terminated };
12 .until_end <- repeat { uint8 };
[e3f2765]13};
14
[c3437d9]15transform do_while = do {
16 struct {
17 .valid <- nonzero_boolean <- uint8;
18 .val <- uint8;
19 }
20} while (.valid);
21
[e3f2765]22transform main = struct {
23 .with_count <- with_count;
[c3437d9]24 .without_count <- without_count <- known_length(9);
25 .do_while <- do_while;
[1c79996]26 .do_while_item <- (.do_while[1]);
[e3f2765]27};
Note: See TracBrowser for help on using the repository browser.