#include #include #include #include "highlighter.h" Highlighter::Highlighter(std::vector tokens): tokens(tokens){} std::string Highlighter::highlight() { std::ostringstream result; result << ""; result << "
";
    if (!this->tokens.empty()) {
        result << "1. ";
    }
    int line_number = 2;
    for (Token token: this->tokens) { 
        if (token.getTokenType() == TokenType::NEWLINE) {
            result << "\n" << line_number++ << ". ";
        } else {
            result << "" << token.getTextValue() << "";
        }
    }
    result << "
"; return result.str(); }