From ccd71ee220093774a35708d8c1e31936b012930a Mon Sep 17 00:00:00 2001 From: Dimitar Milev Date: Sat, 3 Nov 2018 12:52:28 +0100 Subject: 81352 - homework 2 (#32) * fix(hw1): use yyextra instead global variable * hw2: extended the typescript syntax highlighter with collapsible block structures --- homework/81352/ts2html/highlighter.cpp | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 homework/81352/ts2html/highlighter.cpp (limited to 'homework/81352/ts2html/highlighter.cpp') diff --git a/homework/81352/ts2html/highlighter.cpp b/homework/81352/ts2html/highlighter.cpp deleted file mode 100644 index 6c44066..0000000 --- a/homework/81352/ts2html/highlighter.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#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(); -} -- cgit v1.3.1-26-gb76a