Changeset d8bd2ec in mainline
- Timestamp:
- 2012-08-08T04:13:53Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0b60d2d, 20e95be
- Parents:
- a66ea217
- Location:
- uspace
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bithenge/script.c
ra66ea217 rd8bd2ec 119 119 /** The number of parameters. */ 120 120 int num_params; 121 /** @a parse_expression sets this when TOKEN_IN is used. */ 122 bool in_node_used; 121 123 } state_t; 122 124 … … 440 442 } else if (state->token == TOKEN_IN) { 441 443 next_token(state); 444 state->in_node_used = true; 442 445 bithenge_expression_t *expr; 443 446 rc = bithenge_in_node_expression(&expr); … … 882 885 if (state->token == '(') { 883 886 next_token(state); 887 state->in_node_used = false; 884 888 bithenge_expression_t *expr = parse_expression(state); 885 889 expect(state, ')'); … … 890 894 891 895 bithenge_transform_t *xform; 892 int rc = bithenge_expression_transform(&xform, expr); 896 int rc; 897 if (state->in_node_used) 898 rc = bithenge_expression_transform(&xform, expr); 899 else 900 rc = bithenge_inputless_transform(&xform, expr); 893 901 if (rc != EOK) { 894 902 error_errno(state, rc); -
uspace/dist/src/bithenge/test.bh
ra66ea217 rd8bd2ec 1 transform length = struct {2 .len <- uint8;3 };4 5 1 transform pascal_string = struct { 6 <- length; 2 <- struct { # An inner struct for testing purposes 3 .len <- uint8; 4 }; 7 5 .string <- ascii <- known_length(.len); 8 6 }; … … 16 14 17 15 transform item(little_endian, len) = struct { 18 .type <- (3 *in+1) <- u32(little_endian);16 .type <- (3 * in + 1) <- u32(little_endian); 19 17 .name <- pascal_string; 20 18 switch (.type) { … … 32 30 33 31 transform main() = struct { 34 .first_item <- item(true, 3); 35 .second_item <- item(false, 4); 32 .first_len <- (3); 33 .second_len <- (6 - 2); 34 .first_item <- item(true, .first_len); 35 .second_item <- item(false, .second_len); 36 36 };
Note:
See TracChangeset
for help on using the changeset viewer.