diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-01-17 08:48:39 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-01-17 08:48:39 (GMT) |
commit | 70c4378dbcfdcbeef6fb3aa348f32ed862fe8eb7 (patch) | |
tree | cf47b67db3753288cfd9fa2adc45e7c5cd2f8741 /Lib | |
parent | a88854059309667092000da55d4d5a5804267e9f (diff) | |
download | cpython-70c4378dbcfdcbeef6fb3aa348f32ed862fe8eb7.zip cpython-70c4378dbcfdcbeef6fb3aa348f32ed862fe8eb7.tar.gz cpython-70c4378dbcfdcbeef6fb3aa348f32ed862fe8eb7.tar.bz2 |
Whitespace normalization.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/shlex.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/shlex.py b/Lib/shlex.py index 2d7d68a..d90a0b9 100644 --- a/Lib/shlex.py +++ b/Lib/shlex.py @@ -1,14 +1,14 @@ """A lexical analyzer class for simple shell-like syntaxes.""" -# Module and documentation by Eric S. Raymond, 21 Dec 1998 +# Module and documentation by Eric S. Raymond, 21 Dec 1998 # Input stacking and error message cleanup added by ESR, March 2000 -# push_source() and pop_source() made explicit by ESR, January 2001. +# push_source() and pop_source() made explicit by ESR, January 2001. import os.path import sys class shlex: - "A lexical analyzer class for simple shell-like syntaxes." + "A lexical analyzer class for simple shell-like syntaxes." def __init__(self, instream=None, infile=None): if instream: self.instream = instream @@ -101,7 +101,7 @@ class shlex: self.lineno = self.lineno + 1 if self.debug >= 3: print "shlex: in state", repr(self.state), \ - "I see character:", repr(nextchar) + "I see character:", repr(nextchar) if self.state is None: self.token = '' # past end of file break @@ -136,14 +136,14 @@ class shlex: if nextchar == self.state: self.state = ' ' break - elif not nextchar: # end of file + elif not nextchar: # end of file if self.debug >= 2: print "shlex: I see EOF in quotes state" # XXX what error should be raised here? raise ValueError, "No closing quotation" elif self.state == 'a': if not nextchar: - self.state = None # end of file + self.state = None # end of file break elif nextchar in self.whitespace: if self.debug >= 2: @@ -194,7 +194,7 @@ class shlex: return "\"%s\", line %d: " % (infile, lineno) -if __name__ == '__main__': +if __name__ == '__main__': if len(sys.argv) == 1: lexer = shlex() else: |