Commit b784433f by Maarten L. Hekkelman

less verbose parser

parent 8c064e7c
......@@ -221,7 +221,7 @@ class sac_parser
void warning(const std::string &msg)
{
if (cif::VERBOSE > 0)
std::cerr << "parser warning at line" << m_line_nr << ": " << msg << std::endl;
std::cerr << "parser warning at line " << m_line_nr << ": " << msg << std::endl;
}
// production methods, these are pure virtual here
......
......@@ -222,7 +222,7 @@ sac_parser::CIFToken sac_parser::get_next_token()
error("unterminated textfield");
// else if (ch == '\\')
// state = State::Esc;
else if (not is_any_print(ch))
else if (not is_any_print(ch) and cif::VERBOSE > 2)
warning("invalid character in text field '" + std::string({static_cast<char>(ch)}) + "' (" + std::to_string((int)ch) + ")");
break;
......@@ -252,8 +252,8 @@ sac_parser::CIFToken sac_parser::get_next_token()
error("unterminated quoted string");
else if (ch == quoteChar)
state = State::QuotedStringQuote;
else if (not is_any_print(ch))
warning("invalid character in quoted string: '" + std::string({static_cast<char>(ch)}) + '\'');
else if (not is_any_print(ch) and cif::VERBOSE > 2)
warning("invalid character in quoted string: '" + std::string({static_cast<char>(ch)}) + "' (" + std::to_string((int)ch) + ")");
break;
case State::QuotedStringQuote:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment