2018-07-21 | Paul Boddie | file changeset files shortlog | Invocations in parameter lists may require temporary storage for contexts and accessors, but the storage locations must be different. Otherwise, the code will generate a sequence-point warning. Here, distinct ranges for parameters in lists are introduced, and accessors are now also stored in arrays, permitting distinct storage. |
paul@437 | 1 | from pyparser.automata import DFA, DEFAULT |
paul@437 | 2 | |
paul@437 | 3 | def test_states(): |
paul@437 | 4 | d = DFA([{"\x00": 1}, {"\x01": 0}], [False, True]) |
paul@437 | 5 | assert d.states == "\x01\xff\xff\x00" |
paul@437 | 6 | assert d.defaults == "\xff\xff" |
paul@437 | 7 | assert d.max_char == 2 |
paul@437 | 8 | |
paul@437 | 9 | d = DFA([{"\x00": 1}, {DEFAULT: 0}], [False, True]) |
paul@437 | 10 | assert d.states == "\x01\x00" |
paul@437 | 11 | assert d.defaults == "\xff\x00" |
paul@437 | 12 | assert d.max_char == 1 |