Changeset 1ebc1a62 in mainline for uspace/app/sbi/src/stype_expr.c
- Timestamp:
- 2010-03-29T20:30:29Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a95310e
- Parents:
- 5da468e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/sbi/src/stype_expr.c
r5da468e r1ebc1a62 182 182 nameref->name); 183 183 184 if (sym == NULL) { 185 /* Not found. */ 186 if (stype->current_csi != NULL) { 187 printf("Error: Symbol '%s' not found in '", 188 strtab_get_str(nameref->name->sid)); 189 symbol_print_fqn(csi_to_symbol(stype->current_csi)); 190 printf("'.\n"); 191 } else { 192 printf("Error: Symbol '%s' not found.\n", 193 strtab_get_str(nameref->name->sid)); 194 } 195 stype_note_error(stype); 196 *rtitem = stype_recovery_titem(stype); 197 return; 198 } 199 184 200 switch (sym->sc) { 185 201 case sc_var: … … 273 289 274 290 if (binop->arg1->titem == NULL) { 275 /* XXX Make this an error when ready. */276 291 printf("Error First binary operand has no value.\n"); 277 exit(1); 292 stype_note_error(stype); 293 if (binop->arg2->titem != NULL) 294 *rtitem = binop->arg2->titem; 295 else 296 *rtitem = stype_recovery_titem(stype); 297 return; 278 298 } 279 299 280 300 if (binop->arg2->titem == NULL) { 281 /* XXX Make this an error when ready. */282 301 printf("Error: Second binary operand has no value.\n"); 283 exit(1); 302 stype_note_error(stype); 303 *rtitem = binop->arg1->titem; 304 return; 284 305 } 285 306 … … 292 313 tdata_item_print(binop->arg2->titem); 293 314 printf("').\n"); 294 exit(1); 315 stype_note_error(stype); 316 *rtitem = binop->arg1->titem; 317 return; 295 318 } 296 319 … … 311 334 tdata_item_print(titem); 312 335 printf("').\n"); 313 exit(1); 336 stype_note_error(stype); 337 *rtitem = titem; 338 break; 314 339 } 315 340 … … 334 359 case tpc_nil: 335 360 printf("Unimplemented; Binary operation on nil.\n"); 336 exit(1); 361 stype_note_error(stype); 362 rtpc = tpc_nil; 363 break; 337 364 case tpc_string: 338 365 if (binop->bc != bo_plus) { 339 366 printf("Unimplemented: Binary operation(%d) " 340 367 "on strings.\n", binop->bc); 341 exit(1);368 stype_note_error(stype); 342 369 } 343 370 rtpc = tpc_string; … … 345 372 case tpc_resource: 346 373 printf("Error: Cannot apply operator to resource type.\n"); 347 exit(1); 374 stype_note_error(stype); 375 rtpc = tpc_resource; 348 376 } 349 377 … … 425 453 if (arg_ti == NULL) { 426 454 printf("Error: Argument of access has no value.\n"); 427 exit(1); 455 stype_note_error(stype); 456 *rtitem = stype_recovery_titem(stype); 457 return; 428 458 } 429 459 … … 443 473 case tic_tfun: 444 474 printf("Error: Using '.' operator on a function.\n"); 445 exit(1); 475 stype_note_error(stype); 476 *rtitem = stype_recovery_titem(stype); 446 477 break; 447 478 } … … 459 490 tdata_item_print(arg_ti); 460 491 printf("'.\n"); 461 exit(1); 492 stype_note_error(stype); 493 *rtitem = stype_recovery_titem(stype); 462 494 } 463 495 … … 488 520 printf("' has no member named '%s'.\n", 489 521 strtab_get_str(access->member_name->sid)); 490 exit(1); 522 *rtitem = stype_recovery_titem(stype); 523 return; 491 524 } 492 525 … … 500 533 printf("Error: Accessing object member which is nested " 501 534 "CSI.\n"); 502 exit(1); 535 stype_note_error(stype); 536 *rtitem = stype_recovery_titem(stype); 537 break; 503 538 case sc_fun: 504 539 fun = symbol_to_fun(member_sym); … … 536 571 tdata_item_print(arg_ti); 537 572 printf("'.\n"); 538 exit(1); 573 stype_note_error(stype); 574 *rtitem = stype_recovery_titem(stype); 539 575 } 540 576 … … 550 586 tdata_item_print(arg_ti); 551 587 printf("'.\n"); 552 exit(1); 588 stype_note_error(stype); 589 *rtitem = stype_recovery_titem(stype); 553 590 } 554 591 … … 639 676 symbol_print_fqn(fun_to_symbol(fun)); 640 677 printf("'.\n"); 641 exit(1);678 stype_note_error(stype); 642 679 } 643 680 … … 646 683 symbol_print_fqn(fun_to_symbol(fun)); 647 684 printf("'.\n"); 648 exit(1);685 stype_note_error(stype); 649 686 } 650 687 … … 696 733 case tic_tfun: 697 734 printf("Error: Indexing a function.\n"); 698 exit(1); 735 stype_note_error(stype); 736 *rtitem = stype_recovery_titem(stype); 699 737 break; 700 738 } … … 724 762 tdata_item_print(base_ti); 725 763 printf("'.\n"); 726 exit(1); 764 stype_note_error(stype); 765 *rtitem = stype_recovery_titem(stype); 727 766 } 728 767 … … 756 795 tdata_item_print(base_ti); 757 796 printf("' which does not have an indexer.\n"); 758 exit(1); 797 stype_note_error(stype); 798 *rtitem = stype_recovery_titem(stype); 799 return; 759 800 } 760 801 … … 791 832 792 833 printf("Error: Array index is not an integer.\n"); 793 exit(1);834 stype_note_error(stype); 794 835 } 795 836 … … 800 841 printf("Error: Using %d indices with array of rank %d.\n", 801 842 arg_count, base_ti->u.tarray->rank); 802 exit(1);843 stype_note_error(stype); 803 844 } 804 845 … … 817 858 tdata_item_print(base_ti); 818 859 printf("'.\n"); 819 exit(1); 860 stype_note_error(stype); 861 *rtitem = stype_recovery_titem(stype); 820 862 } 821 863 … … 857 899 tdata_item_print(as_op->arg->titem); 858 900 printf("'.\n"); 859 exit(1);901 stype_note_error(stype); 860 902 } 861 903
Note:
See TracChangeset
for help on using the changeset viewer.