Selaa lähdekoodia

Code review #2

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.11.2
julienmalard 3 vuotta sitten
vanhempi
commit
1b2fc2bda4
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. +2
    -1
      lark/utils.py

+ 2
- 1
lark/utils.py Näytä tiedosto

@@ -16,7 +16,7 @@ logger.setLevel(logging.CRITICAL)
def is_id_continue(x):
"""
Checks if all characters in `x` are alphanumeric characters (Unicode standard, so diactrics, Indian vowels, non-latin
numbers, etc. all pass). Synonymous with a Python `ID_CONTINUE` identifier.
numbers, etc. all pass). Synonymous with a Python `ID_CONTINUE` identifier. See PEP 3131 for details.
"""
if len(x) != 1:
return all(is_id_continue(y) for y in x)
@@ -24,6 +24,7 @@ def is_id_continue(x):


def isalpha(x):
"""See PEP 3131 for details."""
if len(x) != 1:
return all(isalpha(y) for y in x)
return unicodedata.category(x) in ['Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Mn', 'Mc', 'Pc']


Ladataan…
Peruuta
Tallenna