diff options
Diffstat (limited to 'src/lib/netlist/plib/ptokenizer.cpp')
-rw-r--r-- | src/lib/netlist/plib/ptokenizer.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/netlist/plib/ptokenizer.cpp b/src/lib/netlist/plib/ptokenizer.cpp index a29b3342333..46af36d2bf9 100644 --- a/src/lib/netlist/plib/ptokenizer.cpp +++ b/src/lib/netlist/plib/ptokenizer.cpp @@ -151,7 +151,8 @@ namespace plib { { if (ret.is_type(token_type::token_type::ENDOFFILE)) return ret; - else if (m_support_line_markers && ret.is_type(token_type::LINEMARKER)) + + if (m_support_line_markers && ret.is_type(token_type::LINEMARKER)) { bool benter(false); bool bexit(false); @@ -215,7 +216,8 @@ namespace plib { } if (m_support_line_markers && c == '#') return token_t(token_type::LINEMARKER, "#"); - else if (m_number_chars_start.find(c) != pstring::npos) + + if (m_number_chars_start.find(c) != pstring::npos) { // read number while we receive number or identifier chars // treat it as an identifier when there are identifier chars in it @@ -243,10 +245,9 @@ namespace plib { } ungetc(c); auto id = m_tokens.find(tokstr); - if (id != m_tokens.end()) - return token_t(id->second, tokstr); - else - return token_t(token_type::IDENTIFIER, tokstr); + return (id != m_tokens.end()) ? + token_t(id->second, tokstr) + : token_t(token_type::IDENTIFIER, tokstr); } else if (c == m_string) { @@ -277,10 +278,9 @@ namespace plib { } ungetc(c); auto id = m_tokens.find(tokstr); - if (id != m_tokens.end()) - return token_t(id->second, tokstr); - else - return token_t(token_type::UNKNOWN, tokstr); + return (id != m_tokens.end()) ? + token_t(id->second, tokstr) + : token_t(token_type::UNKNOWN, tokstr); } } @@ -292,7 +292,7 @@ namespace plib { pstring e = plib::pfmt("{1}:{2}:0: error: {3}\n") (m_source_location.back().file_name(), m_source_location.back().line(), errs()); m_source_location.pop_back(); - while (m_source_location.size() > 0) + while (!m_source_location.empty()) { if (m_source_location.size() == 1) trail = trail_first; |