2018-07-12 | Paul Boddie | raw annotate files changeset graph | Support trailing data after attributes in objects, employed by float instances to store their double-precision numeric data which needs more space than single attributes on some systems. In order to initialise such instances statically, specific object types must be indicated instead of the generic __obj type. This then requires casting to __ref of direct references to objects. Added an underflow error. Added initial testing of floating point numbers. | trailing-data |
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 """