Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii authored May 25, 2022
1 parent e6b3284 commit d156be7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lark/parsers/lalr_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def deserialize(cls, data, memo, callbacks, debug=False):
inst.parser = _Parser(inst._parse_table, callbacks, debug)
return inst

def serialize(self, memo = None) -> Dict[str, Any]:
def serialize(self, memo: Any = None) -> Dict[str, Any]:
return self._parse_table.serialize(memo)

def parse_interactive(self, lexer, start):
Expand Down
2 changes: 1 addition & 1 deletion lark/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def get_regexp_width(expr: str) -> Union[Tuple[int, int], List[int]]:
_ID_START = 'Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Mn', 'Mc', 'Pc'
_ID_CONTINUE = _ID_START + ('Nd', 'Nl',)

def _test_unicode_category(s: str, categories: Union[Tuple[str, str, str, str, str, str, str, str], Tuple[str, str, str, str, str, str, str, str, str, str]]) -> bool:
def _test_unicode_category(s: str, categories: Sequence[str]) -> bool:
if len(s) != 1:
return all(_test_unicode_category(char, categories) for char in s)
return s == '_' or unicodedata.category(s) in categories
Expand Down

0 comments on commit d156be7

Please sign in to comment.