Skip to content

Commit d48fd9d

Browse files
committed
At least show something instead of #f
1 parent 2e6bb05 commit d48fd9d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/reader.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,14 @@ static void lexical_error(SgPort * port, SgReadContext *ctx,
359359

360360
file = Sg_FileName(port);
361361
if (ctx->parsingLineFrom == ctx->parsingLineTo) {
362-
line = Sg_Sprintf(UC("file %S, line %d"),
363-
file,
362+
line = Sg_Sprintf(UC("%s %S, line %d"),
363+
SG_FALSEP(file) ? UC("port") : UC("file"),
364+
SG_FALSEP(file) ? port : file,
364365
ctx->parsingLineFrom);
365366
} else {
366-
line = Sg_Sprintf(UC("file %S, line %d-%d"),
367-
file,
367+
line = Sg_Sprintf(UC("%s %S, line %d-%d"),
368+
SG_FALSEP(file) ? UC("port") : UC("file"),
369+
SG_FALSEP(file) ? port : file,
368370
ctx->parsingLineFrom, ctx->parsingLineTo);
369371
}
370372
Sg_ReadError(UC("%A (%A)"), msg, line);

0 commit comments

Comments
 (0)