syntax tweak

This commit is contained in:
Bobby Lucero 2024-09-28 23:43:50 -04:00
parent f02815b1aa
commit 6e19d50a5a
3 changed files with 25 additions and 2 deletions

View File

@ -4,6 +4,28 @@ test #this is a test
print("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 9 . 42 .12 9.1.1 80. 80.0123
@ -13,3 +35,4 @@ print("test")

View File

@ -15,7 +15,7 @@ EditorState::EditorState(pkpy::VM *vm, Graphics *graphics) : m_vm(vm), m_graphic
Token a(TokenType::Keyword, "Test"); 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_baseBackgroundColor = 56;
m_baseTextColor = 63; m_baseTextColor = 63;

View File

@ -117,7 +117,7 @@ bool PythonTokenizer::isPunctuation(char c) {
} }
bool PythonTokenizer::isOperator(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) { std::string PythonTokenizer::readNumericLiteral(const std::string &line) {