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