Esempio n. 1
0
data::colored_string highlight_syntax(const std::string& str) {
  data::colored_string result;

  const data::command cmd(str);
  for (const data::token& t : cmd) {
    result += data::colored_string(t.value(), color_of_token(t));
  }

  return result;
}
 void operator()(const TokenType& t_)
 {
   if (const boost::optional<just::console::color> c = color_of_token(t_))
   {
     just::console::text_color(*c);
   }
   else
   {
     just::console::reset();
   }
   std::cout << t_.get_value();
 }