code: def _scan(self, type):
          
          tok = self._scanner.token(self._pos, set([type]))
          if tok[2] != type:
              raise SyntaxError(tok[0], "Trying to find " + type)
          self._pos += 1
          return tok[3]
docs: Returns the matched text, and moves to the next token