Commit 72fd03a6 by Maarten L. Hekkelman

formatting, fix in is_unquoted test

parent 61f464ae
...@@ -147,7 +147,6 @@ class condition ...@@ -147,7 +147,6 @@ class condition
} }
private: private:
void optimise(condition_impl *&impl); void optimise(condition_impl *&impl);
condition_impl *m_impl; condition_impl *m_impl;
...@@ -195,9 +194,7 @@ namespace detail ...@@ -195,9 +194,7 @@ namespace detail
bool test(row_handle r) const override bool test(row_handle r) const override
{ {
return m_single_hit.has_value() ? return m_single_hit.has_value() ? *m_single_hit == r : r[m_item_ix].compare(m_value, m_icase) == 0;
*m_single_hit == r :
r[m_item_ix].compare(m_value, m_icase) == 0;
} }
void str(std::ostream &os) const override void str(std::ostream &os) const override
......
...@@ -94,7 +94,10 @@ class sac_parser ...@@ -94,7 +94,10 @@ class sac_parser
static bool is_unquoted_string(std::string_view text) static bool is_unquoted_string(std::string_view text)
{ {
bool result = true; bool result = is_ordinary(text.front());
if (result)
{
for (auto ch : text) for (auto ch : text)
{ {
if (is_non_blank(ch)) if (is_non_blank(ch))
...@@ -102,6 +105,7 @@ class sac_parser ...@@ -102,6 +105,7 @@ class sac_parser
result = false; result = false;
break; break;
} }
}
static const std::regex kReservedRx(R"(loop_|stop_|global_|data_\S+|save_\S+)", std::regex_constants::icase); static const std::regex kReservedRx(R"(loop_|stop_|global_|data_\S+|save_\S+)", std::regex_constants::icase);
......
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