Strona działa najlepiej z włączonym JavaScript.
Strona główna
Odkrywaj
Pomoc
Zaloguj się
jmg
/
gitmirror
Obserwuj
1
Polub
0
Forkuj
0
Kod
Zgłoszenia
0
Oczekujące zmiany
0
Wydania
39
Wiki
Aktywność
Przeglądaj źródła
interpreter: default behavior changed to return the values instead of discarding them, added test showcasing the behavior
tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.6.0
Ramon Klass
6 lat temu
rodzic
4c89d69d97
commit
1854b81ebc
2 zmienionych plików
z
9 dodań
i
1 usunięć
Widok podzielony
Opcje porównania
Pokaż statystyki
Ściągnij plik aktualizacji
Ściągnij plik porównania
+1
-1
lark/tree.py
+8
-0
tests/test_trees.py
+ 1
- 1
lark/tree.py
Wyświetl plik
@@ -195,7 +195,7 @@ class Interpreter(object):
return self.__default__
def __default__(self, tree):
self.visit_children(tree)
return
self.visit_children(tree)
class Transformer_NoRecurse(Transformer):
+ 8
- 0
tests/test_trees.py
Wyświetl plik
@@ -49,6 +49,14 @@ class TestTrees(TestCase):
self.assertEqual(Interp2().visit(t), list('BCde'))
class Interp3(Interpreter):
def b(self, tree):
return 'B'
def c(self, tree):
return 'C'
self.assertEqual(Interp3().visit(t), list('BCd'))
Napisz
Podgląd
Ładowanie…
Anuluj
Zapisz