Ver a proveniência

Allow unicode in terminal names

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.11.2
Erez Sh há 3 anos
ascendente
cometimento
8953849841
2 ficheiros alterados com 2 adições e 4 eliminações
  1. +1
    -3
      lark/load_grammar.py
  2. +1
    -1
      tests/test_nearley/nearley

+ 1
- 3
lark/load_grammar.py Ver ficheiro

@@ -333,9 +333,7 @@ class PrepareAnonTerminals(Transformer_InPlace):
term_name = _TERMINAL_NAMES[value]
except KeyError:
if is_id_continue(value) and is_id_start(value[0]) and value.upper() not in self.term_set:
with suppress(UnicodeEncodeError):
value.upper().encode('ascii') # Make sure we don't have unicode in our terminal names
term_name = value.upper()
term_name = value.upper()

if term_name in self.term_set:
term_name = None


+ 1
- 1
tests/test_nearley/nearley

@@ -1 +1 @@
Subproject commit cf8925f729bde741a3076c5856c0c0862bc7f5de
Subproject commit a46b37471db486db0f6e1ce6a2934fb238346b44

Carregando…
Cancelar
Guardar