From 76b849fbaa276566fa8838d745c0e5fbd2f138bc Mon Sep 17 00:00:00 2001 From: Ralitsa Dardjonova Date: Wed, 7 Nov 2018 16:01:18 +0200 Subject: First homework - highlighter for python (#17) * Initial commit * Fix some typos modified: README * Delete index.html --- homework/81350/py2html/Token.h | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 homework/81350/py2html/Token.h (limited to 'homework/81350/py2html/Token.h') diff --git a/homework/81350/py2html/Token.h b/homework/81350/py2html/Token.h new file mode 100644 index 0000000..97dda8d --- /dev/null +++ b/homework/81350/py2html/Token.h @@ -0,0 +1,52 @@ +#pragma once +#include +#include + +typedef std::string IPLString ; + + enum TokenType{ + False, + None, + True, + And, + As, + Assert, + Break, + Class, + Continue, + Def, + Del, + Elif, + Else, + Except, + Finally, + For, + From, + Global, + If, + Import, + In, + Is, + Lambda, + Nonlocal, + Not, + Or, + Pass, + Print, + Raise, + Return, + Try, + While, + With, + Yield + }; + +struct Token +{ + TokenType Type; + unsigned Line; + IPLString Lexeme; + double Number = 0.0; +}; + +extern std::unordered_map keywords; -- cgit v1.3.1-26-gb76a