Changeset 1ebc1a62 in mainline for uspace/app/sbi/src/stype_expr.c


Ignore:
Timestamp:
2010-03-29T20:30:29Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a95310e
Parents:
5da468e
Message:

Update SBI to rev. 157.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/sbi/src/stype_expr.c

    r5da468e r1ebc1a62  
    182182            nameref->name);
    183183
     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
    184200        switch (sym->sc) {
    185201        case sc_var:
     
    273289
    274290        if (binop->arg1->titem == NULL) {
    275                 /* XXX Make this an error when ready. */
    276291                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;
    278298        }
    279299
    280300        if (binop->arg2->titem == NULL) {
    281                 /* XXX Make this an error when ready. */
    282301                printf("Error: Second binary operand has no value.\n");
    283                 exit(1);
     302                stype_note_error(stype);
     303                *rtitem = binop->arg1->titem;
     304                return;
    284305        }
    285306
     
    292313                tdata_item_print(binop->arg2->titem);
    293314                printf("').\n");
    294                 exit(1);
     315                stype_note_error(stype);
     316                *rtitem = binop->arg1->titem;
     317                return;
    295318        }
    296319
     
    311334                tdata_item_print(titem);
    312335                printf("').\n");
    313                 exit(1);
     336                stype_note_error(stype);
     337                *rtitem = titem;
     338                break;
    314339        }
    315340
     
    334359        case tpc_nil:
    335360                printf("Unimplemented; Binary operation on nil.\n");
    336                 exit(1);
     361                stype_note_error(stype);
     362                rtpc = tpc_nil;
     363                break;
    337364        case tpc_string:
    338365                if (binop->bc != bo_plus) {
    339366                        printf("Unimplemented: Binary operation(%d) "
    340367                            "on strings.\n", binop->bc);
    341                         exit(1);
     368                        stype_note_error(stype);
    342369                }
    343370                rtpc = tpc_string;
     
    345372        case tpc_resource:
    346373                printf("Error: Cannot apply operator to resource type.\n");
    347                 exit(1);
     374                stype_note_error(stype);
     375                rtpc = tpc_resource;
    348376        }
    349377
     
    425453        if (arg_ti == NULL) {
    426454                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;
    428458        }
    429459
     
    443473        case tic_tfun:
    444474                printf("Error: Using '.' operator on a function.\n");
    445                 exit(1);
     475                stype_note_error(stype);
     476                *rtitem = stype_recovery_titem(stype);
    446477                break;
    447478        }
     
    459490        tdata_item_print(arg_ti);
    460491        printf("'.\n");
    461         exit(1);
     492        stype_note_error(stype);
     493        *rtitem = stype_recovery_titem(stype);
    462494}
    463495
     
    488520                printf("' has no member named '%s'.\n",
    489521                    strtab_get_str(access->member_name->sid));
    490                 exit(1);
     522                *rtitem = stype_recovery_titem(stype);
     523                return;
    491524        }
    492525
     
    500533                printf("Error: Accessing object member which is nested "
    501534                    "CSI.\n");
    502                 exit(1);
     535                stype_note_error(stype);
     536                *rtitem = stype_recovery_titem(stype);
     537                break;
    503538        case sc_fun:
    504539                fun = symbol_to_fun(member_sym);
     
    536571        tdata_item_print(arg_ti);
    537572        printf("'.\n");
    538         exit(1);
     573        stype_note_error(stype);
     574        *rtitem = stype_recovery_titem(stype);
    539575}
    540576
     
    550586        tdata_item_print(arg_ti);
    551587        printf("'.\n");
    552         exit(1);
     588        stype_note_error(stype);
     589        *rtitem = stype_recovery_titem(stype);
    553590}
    554591
     
    639676                symbol_print_fqn(fun_to_symbol(fun));
    640677                printf("'.\n");
    641                 exit(1);
     678                stype_note_error(stype);
    642679        }
    643680
     
    646683                symbol_print_fqn(fun_to_symbol(fun));
    647684                printf("'.\n");
    648                 exit(1);
     685                stype_note_error(stype);
    649686        }
    650687
     
    696733        case tic_tfun:
    697734                printf("Error: Indexing a function.\n");
    698                 exit(1);
     735                stype_note_error(stype);
     736                *rtitem = stype_recovery_titem(stype);
    699737                break;
    700738        }
     
    724762        tdata_item_print(base_ti);
    725763        printf("'.\n");
    726         exit(1);
     764        stype_note_error(stype);
     765        *rtitem = stype_recovery_titem(stype);
    727766}
    728767
     
    756795                tdata_item_print(base_ti);
    757796                printf("' which does not have an indexer.\n");
    758                 exit(1);
     797                stype_note_error(stype);
     798                *rtitem = stype_recovery_titem(stype);
     799                return;
    759800        }
    760801
     
    791832
    792833                        printf("Error: Array index is not an integer.\n");
    793                         exit(1);
     834                        stype_note_error(stype);
    794835                }
    795836
     
    800841                printf("Error: Using %d indices with array of rank %d.\n",
    801842                    arg_count, base_ti->u.tarray->rank);
    802                 exit(1);
     843                stype_note_error(stype);
    803844        }
    804845
     
    817858        tdata_item_print(base_ti);
    818859        printf("'.\n");
    819         exit(1);
     860        stype_note_error(stype);
     861        *rtitem = stype_recovery_titem(stype);
    820862}
    821863
     
    857899                tdata_item_print(as_op->arg->titem);
    858900                printf("'.\n");
    859                 exit(1);
     901                stype_note_error(stype);
    860902        }
    861903
Note: See TracChangeset for help on using the changeset viewer.