Use frozenset more consistently

This commit is contained in:
Sei Lisa 2020-11-09 02:06:37 +01:00
parent d9938f1a37
commit 4fd4bf71aa
6 changed files with 23 additions and 23 deletions

View file

@ -221,19 +221,19 @@ class EInternal(Exception):
pass
class parser(object):
assignment_toks = frozenset(('=', '+=', '-=', '*=', '/=', '%='))
extassignment_toks = frozenset(('|=', '&=', '^=', '<<=', '>>='))
assignment_toks = frozenset({'=', '+=', '-=', '*=', '/=', '%='})
extassignment_toks = frozenset({'|=', '&=', '^=', '<<=', '>>='})
double_toks = frozenset(('++', '--', '+=', '-=', '*=', '/=', '%=', '==',
'!=', '>=', '<=', '&&', '||', '<<', '>>'))
extdouble_toks = frozenset(('|=', '&=', '^='))
double_toks = frozenset({'++', '--', '+=', '-=', '*=', '/=', '%=', '==',
'!=', '>=', '<=', '&&', '||', '<<', '>>'})
extdouble_toks = frozenset({'|=', '&=', '^='})
# These are hardcoded because additions or modifications imply
# important changes to the code anyway.
base_keywords = frozenset(('default', 'state', 'event', 'jump', 'return',
'if', 'else', 'for', 'do', 'while', 'print', 'TRUE', 'FALSE'))
brkcont_keywords = frozenset(('break', 'continue'))
switch_keywords = frozenset(('switch', 'case', 'break', 'default'))
base_keywords = frozenset({'default', 'state', 'event', 'jump', 'return',
'if', 'else', 'for', 'do', 'while', 'print', 'TRUE', 'FALSE'})
brkcont_keywords = frozenset({'break', 'continue'})
switch_keywords = frozenset({'switch', 'case', 'break', 'default'})
PythonType2LSLToken = {int:'INTEGER_VALUE', float:'FLOAT_VALUE',
unicode:'STRING_VALUE', Key:'KEY_VALUE', Vector:'VECTOR_VALUE',