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
Line 
1transform with_count = struct {
2 .none <- repeat(0) { uint8 };
3 .one <- repeat(1) { uint8 };
4 .count <- uint8;
5 if (true) { # test whether .count is still accessible
6 .many <- repeat(.count) { uint8 };
7 }
8};
9
10transform without_count = struct {
11 .until_error <- repeat { uint8 <- zero_terminated };
12 .until_end <- repeat { uint8 };
13};
14
15transform do_while = do {
16 struct {
17 .valid <- nonzero_boolean <- uint8;
18 .val <- uint8;
19 }
20} while (.valid);
21
22transform main = struct {
23 .with_count <- with_count;
24 .without_count <- without_count <- known_length(9);
25 .do_while <- do_while;
26 .do_while_item <- (.do_while[1]);
27};
Note: See TracBrowser for help on using the repository browser.