Commit 978b4aa3 authored by Juergen Nickelsen's avatar Juergen Nickelsen

have a more trueish eof char (empty => False)

parent c5f22c21
......@@ -47,14 +47,14 @@ def load(name, missing_ok=False):
return T
if missing_ok:
return Nil
raise PyleFileNotFoundError(str(name), load=True)
raise PyleFileNotFoundError(str(name), load=True)
for dir in loadpath:
result = load(os.path.join(dir, name), True)
if result:
return T
if missing_ok:
return Nil
raise PyleFileNotFoundError(str(name), load=True)
raise PyleFileNotFoundError(str(name), load=True)
def is_interactive(in_port, out_port):
return in_port.isatty() and out_port and out_port.isatty()
......@@ -215,7 +215,7 @@ class Reader():
line = input()
except EOFError:
return False
line += "\n"
line += "\n"
else:
line = self.inp.readline()
self.currentLine = line
......@@ -250,11 +250,11 @@ class Reader():
continue
else:
return ch
def nextNonSpace(self):
while True:
ch = self.nextChar()
if ch == "" or not ch.isspace():
if not ch or not ch.isspace():
return ch
def nextToken(self):
if self.pushbacktoken:
......@@ -263,7 +263,7 @@ class Reader():
result = t
else:
ch = self.nextNonSpace()
if ch == "":
if not ch:
result = EOFToken()
elif ch == "(":
result = OparenToken()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment