Permalink
Browse files
Comments about input handling.
- Loading branch information...
Showing
with
4 additions
and
3 deletions.
-
+4
−3
core/reader.py
|
|
@@ -47,7 +47,7 @@ def __init__(self, ps1, arena): |
|
|
|
|
|
def _GetLine(self):
|
|
|
try:
|
|
|
ret = raw_input(self.prompt_str) + '\n'
|
|
|
ret = raw_input(self.prompt_str) + '\n' # newline required
|
|
|
except EOFError:
|
|
|
ret = None
|
|
|
self.prompt_str = _PS2
|
|
|
@@ -77,8 +77,9 @@ def _GetLine(self): |
|
|
if not line:
|
|
|
return None
|
|
|
|
|
|
# The last line should be passed to the Lexer with a '\n', even if it
|
|
|
# didn't have one.
|
|
|
# TODO: Remove this anachonism. We no longer need every line to end with a
|
|
|
# newline. See input handling comment at the top of osh/lex.py. (I tried
|
|
|
# and it made a bunch of tests fail.)
|
|
|
if not line.endswith('\n'):
|
|
|
line += '\n'
|
|
|
|
|
|
|
0 comments on commit
d1c0386