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

Tiny improvement in Earley

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.5.1
Erez Shinan 7 роки тому
джерело
коміт
a0fbecee70
1 змінених файлів з 3 додано та 4 видалено
  1. +3
    -4
      lark/parsers/earley.py

+ 3
- 4
lark/parsers/earley.py Переглянути файл

@@ -57,11 +57,10 @@ class Column:
if item.is_complete:
if item not in self.to_reduce: # Avoid infinite loop
self.to_reduce.append(item)
elif is_terminal(item.expect):
self.to_scan.append(item)
else:
if is_terminal(item.expect):
self.to_scan.append(item)
else:
self.to_predict.append(item)
self.to_predict.append(item)

def __nonzero__(self):
return bool(self.item_count)


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