code: def state_in(self, value):
          
          value = [val for val in Traverser(value, self.groups)]
          if not value or not value[0]:
              for val in self.literals - set(value):
                  return (yield val)
          yield value[0]
docs: Parse ranges.