Permalink
Browse files

Comments about input handling.

  • Loading branch information...
Andy Chu
Andy Chu committed Dec 21, 2017
1 parent 4e8b9f1 commit d1c038687af1e3720566a20ec0b223ee0cf51879
Showing with 4 additions and 3 deletions.
  1. +4 −3 core/reader.py
View
@@ -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

Please sign in to comment.