self.tok = next_char next_char = '' # If a token has been found, reset the buffer if out: self.buffer = '' # If the buffer is only spaces, clear it when a word is added if self.buffer.isspace() and not next_char.isspace(): self.buffer = next_char else: self.buffer += next_char # Return the found token if out: return out # If we're here, we got nothing but EOF. raise StopIteration ########NEW FILE######## __FILENAME__ = __main__ from repl import Repl if __name__ == "__main__": repl = Repl() repl.cmdloop() ########NEW FILE########
if cout: self.tok = next_char next_char = '' # If a token has been found, reset the buffer if out: self.buffer = '' # If the buffer is only spaces, clear it when a word is added if self.buffer.isspace() and not next_char.isspace(): self.buffer = next_char else: self.buffer += next_char # Return the found token if out: return out # If we're here, we got nothing but EOF. raise StopIteration ########NEW FILE######## __FILENAME__ = __main__ from repl import Repl if __name__ == "__main__": repl = Repl() repl.cmdloop() ########NEW FILE########