mirror of
https://github.com/samsonjs/lake.git
synced 2026-04-27 14:57:43 +00:00
print errors to stderr
This commit is contained in:
parent
23c8c5cecd
commit
4bfb171676
3 changed files with 7 additions and 7 deletions
|
|
@ -68,7 +68,7 @@ char *lake_repr(LakeVal *expr)
|
|||
break;
|
||||
|
||||
default:
|
||||
printf("error: unrecognized value, type %d, size %zu bytes", expr->type, expr->size);
|
||||
fprintf(stderr, "error: unrecognized value, type %d, size %zu bytes", expr->type, expr->size);
|
||||
s = g_strdup("");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ static void warn_trailing(Ctx *ctx)
|
|||
/* don't warn about trailing comments */
|
||||
if (ctx->i < ctx->n && peek(ctx) != ';') {
|
||||
char *trailing = ctx->s + ctx->i;
|
||||
printf("warning: ignoring %d trailing chars: %s\n", (int)(ctx->n - ctx->i), trailing);
|
||||
fprintf(stderr, "warning: ignoring %d trailing chars: %s\n", (int)(ctx->n - ctx->i), trailing);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ static LakeVal *prompt_read(LakeCtx *ctx, Env *env, char *prompt)
|
|||
char buf[n];
|
||||
if (!fgets(buf, n, stdin)) {
|
||||
if (ferror(stdin)) {
|
||||
printf("error: cannot read from stdin");
|
||||
fprintf(stderr, "error: cannot read from stdin");
|
||||
}
|
||||
if (feof(stdin)) {
|
||||
return VAL(EOF);
|
||||
|
|
|
|||
Loading…
Reference in a new issue