From 850ba03d1ff507561a3f7bc5187d05cacda41afb Mon Sep 17 00:00:00 2001 From: Kodi Arfer Date: Thu, 22 Jun 2017 16:34:01 -0700 Subject: [PATCH] Slightly simplify HyREPL --- hy/cmdline.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hy/cmdline.py b/hy/cmdline.py index 71e4b2c..a9d966c 100644 --- a/hy/cmdline.py +++ b/hy/cmdline.py @@ -15,7 +15,7 @@ import astor.codegen 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, @@ -77,12 +77,9 @@ class HyREPL(code.InteractiveConsole): 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