Changeset 0caaaa00 in mainline
- Timestamp:
- 2012-08-03T21:03:27Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e3f2765
- Parents:
- ee7cc3c
- Location:
- uspace
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bithenge/script.c
ree7cc3c r0caaaa00 62 62 TOKEN_FALSE, 63 63 TOKEN_IF, 64 TOKEN_REPEAT, 64 65 TOKEN_STRUCT, 65 66 TOKEN_SWITCH, … … 218 219 } else if (!str_cmp(value, "if")) { 219 220 state->token = TOKEN_IF; 221 free(value); 222 } else if (!str_cmp(value, "repeat")) { 223 state->token = TOKEN_REPEAT; 220 224 free(value); 221 225 } else if (!str_cmp(value, "struct")) { … … 654 658 } 655 659 660 static bithenge_transform_t *parse_repeat(state_t *state) 661 { 662 expect(state, TOKEN_REPEAT); 663 expect(state, '('); 664 bithenge_expression_t *expr = parse_expression(state); 665 expect(state, ')'); 666 expect(state, '{'); 667 bithenge_transform_t *xform = parse_transform(state); 668 expect(state, '}'); 669 670 if (state->error != EOK) { 671 bithenge_expression_dec_ref(expr); 672 bithenge_transform_dec_ref(xform); 673 return NULL; 674 } 675 676 bithenge_transform_t *repeat_xform; 677 int rc = bithenge_repeat_transform(&repeat_xform, xform, expr); 678 if (rc != EOK) { 679 error_errno(state, rc); 680 return NULL; 681 } 682 return repeat_xform; 683 } 684 656 685 /* The TOKEN_STRUCT and '{' must already have been skipped. */ 657 686 static bithenge_transform_t *parse_struct(state_t *state) … … 712 741 } else if (state->token == TOKEN_IF) { 713 742 return parse_if(state, false); 743 } else if (state->token == TOKEN_REPEAT) { 744 return parse_repeat(state); 714 745 } else if (state->token == TOKEN_STRUCT) { 715 746 next_token(state); -
uspace/app/bithenge/sequence.c
ree7cc3c r0caaaa00 695 695 node->xform = self->xform; 696 696 node->count = count; 697 node->prefix = prefix; 697 698 *out = repeat_as_node(node); 698 699 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.