Skip to content

Commit

Permalink
Slightly simplify HyREPL
Browse files Browse the repository at this point in the history
  • Loading branch information
Kodiologist committed Jun 27, 2017
1 parent 2061a34 commit ae2d558
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions hy/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import hy

from hy.lex import LexException, PrematureEndOfInput, tokenize
from hy.lex import LexException, PrematureEndOfInput
from hy.lex.parser import hy_symbol_mangle
from hy.compiler import HyTypeError
from hy.importer import (hy_eval, import_buffer_to_module,
Expand Down Expand Up @@ -77,12 +77,9 @@ def runsource(self, source, filename='<input>', symbol='single'):
global SIMPLE_TRACEBACKS
try:
try:
tokens = tokenize(source)
do = import_buffer_to_hst(source)
except PrematureEndOfInput:
return True
do = HyExpression([HySymbol('do')] + tokens)
do.start_line = do.end_line = do.start_column = do.end_column = 1
do.replace(do)
except LexException as e:
if e.source is None:
e.source = source
Expand Down

0 comments on commit ae2d558

Please sign in to comment.