Changes in uspace/app/sbi/src/p_expr.c [074444f:23de644] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/sbi/src/p_expr.c
r074444f r23de644 56 56 static stree_expr_t *parse_primitive(parse_t *parse); 57 57 static stree_expr_t *parse_nameref(parse_t *parse); 58 static stree_expr_t *parse_lit_bool(parse_t *parse);59 static stree_expr_t *parse_lit_char(parse_t *parse);60 58 static stree_expr_t *parse_lit_int(parse_t *parse); 61 59 static stree_expr_t *parse_lit_ref(parse_t *parse); … … 496 494 expr = parse_nameref(parse); 497 495 break; 498 case lc_false:499 case lc_true:500 expr = parse_lit_bool(parse);501 break;502 case lc_lit_char:503 expr = parse_lit_char(parse);504 break;505 496 case lc_lit_int: 506 497 expr = parse_lit_int(parse); … … 540 531 } 541 532 542 /** Parse boolean literal.543 *544 * @param parse Parser object.545 */546 static stree_expr_t *parse_lit_bool(parse_t *parse)547 {548 stree_literal_t *literal;549 stree_expr_t *expr;550 bool_t value;551 552 switch (lcur_lc(parse)) {553 case lc_false: value = b_false; break;554 case lc_true: value = b_true; break;555 default: assert(b_false);556 }557 558 lskip(parse);559 560 literal = stree_literal_new(ltc_bool);561 literal->u.lit_bool.value = value;562 563 expr = stree_expr_new(ec_literal);564 expr->u.literal = literal;565 566 return expr;567 }568 569 /** Parse character literal.570 *571 * @param parse Parser object.572 */573 static stree_expr_t *parse_lit_char(parse_t *parse)574 {575 stree_literal_t *literal;576 stree_expr_t *expr;577 578 lcheck(parse, lc_lit_char);579 580 literal = stree_literal_new(ltc_char);581 bigint_clone(&lcur(parse)->u.lit_char.value,582 &literal->u.lit_char.value);583 584 lskip(parse);585 586 expr = stree_expr_new(ec_literal);587 expr->u.literal = literal;588 589 return expr;590 }591 592 533 /** Parse integer literal. 593 534 *
Note:
See TracChangeset
for help on using the changeset viewer.