Переглянути джерело

Small fix

gm/2021-09-23T00Z/github.com--lark-parser-lark/1.0b
Erez Sh 3 роки тому
джерело
коміт
ead7a04473
2 змінених файлів з 3 додано та 3 видалено
  1. +1
    -1
      lark/exceptions.py
  2. +2
    -2
      lark/lexer.py

+ 1
- 1
lark/exceptions.py Переглянути файл

@@ -12,7 +12,7 @@ class ConfigurationError(LarkError, ValueError):
pass


def assert_config(value, options, msg='Got %r, expected one of %s'):
def assert_config(value, options: list, msg='Got %r, expected one of %s'):
if value not in options:
raise ConfigurationError(msg % (value, options))



+ 2
- 2
lark/lexer.py Переглянути файл

@@ -130,7 +130,7 @@ class Token(str):
inst = super(Token, cls).__new__(cls, value)

inst.type = type_
inst.start_pos = start_pos if start_pos is not None else pos_in_stream
inst.start_pos = start_pos
inst.value = value
inst.line = line
inst.column = column
@@ -287,7 +287,7 @@ class Scanner:
return m.group(0), type_from_index[m.lastindex]


def _regexp_has_newline(r):
def _regexp_has_newline(r: str):
r"""Expressions that may indicate newlines in a regexp:
- newlines (\n)
- escaped newline (\\n)


Завантаження…
Відмінити
Зберегти