2021-11-14 | Paul Boddie | raw annotate files changeset graph | Introduced copyable and mutable flags in the tagged region of attribute values. Such flags are set when new integer and floating point values are created, but the mutable flag is cleared when such attributes are propagated between functions in order to prevent values being replaced upon assignment to parameter names, this being a concern when value copying is introduced. | tagged-address-values |
1 from pyparser.automata import DFA, DEFAULT 2 3 def test_states(): 4 d = DFA([{"\x00": 1}, {"\x01": 0}], [False, True]) 5 assert d.states == "\x01\xff\xff\x00" 6 assert d.defaults == "\xff\xff" 7 assert d.max_char == 2 8 9 d = DFA([{"\x00": 1}, {DEFAULT: 0}], [False, True]) 10 assert d.states == "\x01\x00" 11 assert d.defaults == "\xff\x00" 12 assert d.max_char == 1