|
|
|
@ -143,14 +143,11 @@ Pointer read1(Pointer streamPtr, Pointer env) {
@@ -143,14 +143,11 @@ Pointer read1(Pointer streamPtr, Pointer env) {
|
|
|
|
|
Pointer read_fn(Pointer args, Pointer env) { |
|
|
|
|
Pointer streamPtr = CAR(args); |
|
|
|
|
streamPtr = streamPtr == NIL ? environment_get(env, STANDARD_INPUT) : streamPtr; |
|
|
|
|
/* Stream stream = STREAM(streamPtr); */ |
|
|
|
|
Stream stream = STREAM(streamPtr); |
|
|
|
|
Pointer result = read1(streamPtr, env); |
|
|
|
|
/* peek_char(T, stream); */ |
|
|
|
|
/* getc(stream); */ |
|
|
|
|
/* char c; */ |
|
|
|
|
/* getc(stream); */ |
|
|
|
|
/* while((c = getc(stream)) >= 0 && c == ' ') ungetc(c, stream); */ |
|
|
|
|
/* if (c != EOF) ungetc(c, stream); */ |
|
|
|
|
char c; |
|
|
|
|
while((c = getc(stream)) && isspace(c) && c != '\n'); |
|
|
|
|
if (c != '\n') ungetc(c, stream); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|