diff --git a/textual.cc b/textual.cc index bffd56bd..39a5ae9f 100644 --- a/textual.cc +++ b/textual.cc @@ -304,6 +304,27 @@ static inline void parse_symbol(char *& p, std::string& symbol) throw parse_error(path, linenum, "Failed to parse commodity"); } +bool textual_parser_t::test(std::istream& in) const +{ + char buf[5]; + + assert(in.good()); + in.read(buf, 5); + std::cerr << "buf (" << buf[0] << ")" << std::endl; + assert(in.good()); + if (std::strncmp(buf, "