Modulo and assign shortcuts

This commit is contained in:
KikooDX 2020-05-08 10:44:32 +02:00
parent 883f3b426c
commit 30c2d0e6d4
1 changed files with 13 additions and 3 deletions

View File

@ -21,18 +21,28 @@ reserved = {
'Or': 'OR',
}
literals = "+-*/(){}[]=,"
literals = '+-*/%(){}[]=,'
# List of token names
tokens = [
'STRING',
'NUMBER',
'EQUAL',
'ISEQUAL',
'PLUSASSIGN',
'MINUSASSIGN',
'TIMESASSIGN',
'DIVASSIGN',
'MODASSIGN',
'NEWLINE',
'ID',
] + list(reserved.values())
# common regex
t_EQUAL = r'=='
t_ISEQUAL = r'=='
t_PLUSASSIGN = r'\+='
t_MINUSASSIGN = r'\-='
t_TIMESASSIGN = r'\*='
t_DIVASSIGN = r'\/='
t_MODASSIGN = r'\%='
# Comments
t_ignore_COMMENT = r'\//.*'