2020-07-16 | Paul Boddie | raw annotate files changeset graph | Fixed int limit macros by actually using the size of the int type. For wider types such as long, which may be usable on 64-bit platforms in place of int, 1L would need to be used instead of 1 in the calculation. An abstract native integer type might be introduced here and to the native library to allow wider types if appropriate. |
1 from pyparser.automata import DFA, DEFAULT 2 from pyparser.genpytokenize import output 3 4 def test_states(): 5 states = [{"\x00": 1}, {"\x01": 0}] 6 d = DFA(states[:], [False, True]) 7 assert output('test', DFA, d, states) == """\ 8 accepts = [False, True] 9 states = [ 10 # 0 11 {'\\x00': 1}, 12 # 1 13 {'\\x01': 0}, 14 ] 15 test = automata.pyparser.automata.DFA(states, accepts) 16 """