2021-11-14 | Paul Boddie | file changeset files shortlog | Added reserved argument count to the invocation generation code. |
paul@437 | 1 | from pyparser.automata import DFA, DEFAULT |
paul@437 | 2 | from pyparser.genpytokenize import output |
paul@437 | 3 | |
paul@437 | 4 | def test_states(): |
paul@437 | 5 | states = [{"\x00": 1}, {"\x01": 0}] |
paul@437 | 6 | d = DFA(states[:], [False, True]) |
paul@437 | 7 | assert output('test', DFA, d, states) == """\ |
paul@437 | 8 | accepts = [False, True] |
paul@437 | 9 | states = [ |
paul@437 | 10 | # 0 |
paul@437 | 11 | {'\\x00': 1}, |
paul@437 | 12 | # 1 |
paul@437 | 13 | {'\\x01': 0}, |
paul@437 | 14 | ] |
paul@437 | 15 | test = automata.pyparser.automata.DFA(states, accepts) |
paul@437 | 16 | """ |