|
|
@ -226,7 +226,7 @@ class JSInterpreter:
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def _separate(expr, delim=',', max_split=None):
|
|
|
|
def _separate(expr, delim=',', max_split=None):
|
|
|
|
OP_CHARS = '+-*/%&|^=<>!,;'
|
|
|
|
OP_CHARS = '+-*/%&|^=<>!,;{}()[]:'
|
|
|
|
if not expr:
|
|
|
|
if not expr:
|
|
|
|
return
|
|
|
|
return
|
|
|
|
counters = {k: 0 for k in _MATCHING_PARENS.values()}
|
|
|
|
counters = {k: 0 for k in _MATCHING_PARENS.values()}
|
|
|
@ -243,7 +243,7 @@ class JSInterpreter:
|
|
|
|
elif in_quote == '/' and char in '[]':
|
|
|
|
elif in_quote == '/' and char in '[]':
|
|
|
|
in_regex_char_group = char == '['
|
|
|
|
in_regex_char_group = char == '['
|
|
|
|
escaping = not escaping and in_quote and char == '\\'
|
|
|
|
escaping = not escaping and in_quote and char == '\\'
|
|
|
|
after_op = not in_quote and char in OP_CHARS or (char == ' ' and after_op)
|
|
|
|
after_op = not in_quote and char in OP_CHARS or (char.isspace() and after_op)
|
|
|
|
|
|
|
|
|
|
|
|
if char != delim[pos] or any(counters.values()) or in_quote:
|
|
|
|
if char != delim[pos] or any(counters.values()) or in_quote:
|
|
|
|
pos = 0
|
|
|
|
pos = 0
|
|
|
|