fix a bug where the js tokenizer would fail if the last character of the source was an operator
This commit is contained in:
parent
409d5da90d
commit
a7aba40790
1 changed files with 5 additions and 4 deletions
9
ox/js.py
9
ox/js.py
|
@ -125,10 +125,11 @@ def tokenize(source):
|
||||||
cursor += 1
|
cursor += 1
|
||||||
elif char in OPERATOR:
|
elif char in OPERATOR:
|
||||||
type = 'operator'
|
type = 'operator'
|
||||||
string = char + source[cursor]
|
if cursor < length:
|
||||||
while cursor < length and string in OPERATOR:
|
string = char + source[cursor]
|
||||||
cursor += 1
|
while cursor < length and string in OPERATOR:
|
||||||
string += source[cursor]
|
cursor += 1
|
||||||
|
string += source[cursor]
|
||||||
elif char in STRING:
|
elif char in STRING:
|
||||||
type = 'string'
|
type = 'string'
|
||||||
while cursor < length and source[cursor] != source[start]:
|
while cursor < length and source[cursor] != source[start]:
|
||||||
|
|
Loading…
Reference in a new issue