// It does not pull in all the rational number code.
// General includes.
-#include "cl_sysdep.h"
+#include "base/cl_sysdep.h"
// Specification.
#include "cln/integer_io.h"
#include "cln/input.h"
#include "cln/io.h"
-#include "cl_spushstring.h"
+#include "base/string/cl_spushstring.h"
namespace cln {
var int c;
// Skip whitespace at the beginning.
loop {
- c = freadchar(stream);
- if (c == cl_EOF) goto eof;
+ c = stream.get();
+ if (stream.eof() || stream.fail()) goto eof;
if ((c == ' ') || (c == '\t') || (c == '\n'))
continue;
else
buffer.push(c);
// Read some digits, then a letter, then a token.
loop {
- c = freadchar(stream);
- if (c == cl_EOF) goto eof;
+ c = stream.get();
+ if (stream.eof() || stream.fail()) goto eof;
buffer.push(c);
if ((c >= '0') && (c <= '9'))
continue;
}
if (!(((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z'))))
goto syntax1;
- c = freadchar(stream);
- if (c == cl_EOF) goto eof;
+ c = stream.get();
+ if (stream.eof() || stream.fail()) goto eof;
}
// Read a number token.
if (!number_char_p(c))
goto syntax1;
loop {
buffer.push(c);
- c = freadchar(stream);
- if (c == cl_EOF)
+ c = stream.get();
+ if (stream.eof() || stream.fail())
break;
if (!number_char_p(c)) {
- funreadchar(stream,c);
+ stream.putback(c);
break;
}
}