diff options
Diffstat (limited to 'babel/messages/jslexer.py')
-rw-r--r-- | babel/messages/jslexer.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/babel/messages/jslexer.py b/babel/messages/jslexer.py index d2ffbbe..0563f62 100644 --- a/babel/messages/jslexer.py +++ b/babel/messages/jslexer.py @@ -32,11 +32,13 @@ line_join_re = re.compile(r'\\' + line_re.pattern) uni_escape_re = re.compile(r'[a-fA-F0-9]{1,4}') hex_escape_re = re.compile(r'[a-fA-F0-9]{1,2}') + class Token(NamedTuple): type: str value: str lineno: int + _rules: list[tuple[str | None, re.Pattern[str]]] = [ (None, re.compile(r'\s+', re.UNICODE)), (None, re.compile(r'<!--.*')), @@ -100,7 +102,7 @@ def unquote_string(string: str) -> str: add = result.append pos = 0 - while 1: + while True: # scan for the next escape escape_pos = string.find('\\', pos) if escape_pos < 0: |