diff --git a/python/syntaxTest.py b/python/syntaxTest.py index a151317..ca7c106 100644 --- a/python/syntaxTest.py +++ b/python/syntaxTest.py @@ -4,6 +4,28 @@ test #this is a test print("test") +''' +test +''' + +x is .10 + +{"False", "None", "True", "and", "as", "assert", "async", "await", "break", "class", "continue", "def", + "del", "elif", "else", "except", "finally", "for", "from", "global", "if", "import", "in", "is", "lambda", + "nonlocal", "not", "or", "pass", "raise", "return", "try", "while", "with", "yield", "self"}; + +{False, None, True, and, as, assert, async, await, break, class, continue, def, + del, elif, else, except, finally, for, from, global, if, import, in, is, lambda, + nonlocal, not, or, pass, raise, return, try, while, with, yield, self}; + +i in range(100): + print(i) + +if(x == "test"): + pass + x = 0xFF << 8 + x < 10 + x != False 9 . 42 .12 9.1.1 80. 80.0123 @@ -13,3 +35,4 @@ print("test") + diff --git a/src/States/Editor/EditorState.cpp b/src/States/Editor/EditorState.cpp index 00c2c61..3118456 100644 --- a/src/States/Editor/EditorState.cpp +++ b/src/States/Editor/EditorState.cpp @@ -15,7 +15,7 @@ EditorState::EditorState(pkpy::VM *vm, Graphics *graphics) : m_vm(vm), m_graphic Token a(TokenType::Keyword, "Test"); - std::string randomSource = Pycron::loadFileToString("../python/main.py"); + std::string randomSource = Pycron::loadFileToString("../python/syntaxTest.py"); m_baseBackgroundColor = 56; m_baseTextColor = 63; diff --git a/src/States/Editor/PythonTokenizer.cpp b/src/States/Editor/PythonTokenizer.cpp index ea4b9fb..eafe9d0 100644 --- a/src/States/Editor/PythonTokenizer.cpp +++ b/src/States/Editor/PythonTokenizer.cpp @@ -117,7 +117,7 @@ bool PythonTokenizer::isPunctuation(char c) { } bool PythonTokenizer::isOperator(char c) { - return c == '+' || c == '-' || c == '*' || c == '/' || c == '='; + return c == '+' || c == '-' || c == '*' || c == '/' || c == '=' || c == '<' || c == '>' || c == '!'; } std::string PythonTokenizer::readNumericLiteral(const std::string &line) {