def scan_a_token(self):
    """
    Read the next input sequence recognised by the machine
    and return (text, action). Returns ('', None) on end of
    file.
    """
    self.start_pos = self.cur_pos
    self.start_line = self.cur_line
    self.start_col = self.cur_pos - self.cur_line_start
#		if self.trace:
#			action = self.run_machine()
#		else:
#			action = self.run_machine_inlined()
    action = self.run_machine_inlined()
    if action:
      if self.trace:
        print "Scanner: read: Performing", action, "%d:%d" % (
          self.start_pos, self.cur_pos)
      base = self.buf_start_pos
      text = self.buffer[self.start_pos - base : self.cur_pos - base]
      return (text, action)
    else:
      if self.cur_pos == self.start_pos:
        if self.cur_char == EOL:
          self.next_char()
        if not self.cur_char or self.cur_char == EOF:
          return ('', None)
      raise Errors.UnrecognizedInput(self, self.state_name)
dataset/ETHPy150Open ardekantur/pyglet/contrib/layout/layout/Plex/Scanners.py/Scanner.scan_a_token/original