Skip to content

Commit 05ade2d

Browse files
committed
Move eval/apply commands back by the other commands
They somehow got separated.
1 parent eaad22e commit 05ade2d

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

scrapscript.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3041,31 +3041,6 @@ def test_serialize_function(self) -> None:
30413041
)
30423042

30433043

3044-
def eval_command(args: argparse.Namespace) -> None:
3045-
if args.debug:
3046-
logging.basicConfig(level=logging.DEBUG)
3047-
3048-
program = args.program_file.read()
3049-
tokens = tokenize(program)
3050-
logger.debug("Tokens: %s", tokens)
3051-
ast = parse(tokens)
3052-
logger.debug("AST: %s", ast)
3053-
result = eval_exp({}, ast)
3054-
print(result)
3055-
3056-
3057-
def apply_command(args: argparse.Namespace) -> None:
3058-
if args.debug:
3059-
logging.basicConfig(level=logging.DEBUG)
3060-
3061-
tokens = tokenize(args.program)
3062-
logger.debug("Tokens: %s", tokens)
3063-
ast = parse(tokens)
3064-
logger.debug("AST: %s", ast)
3065-
result = eval_exp({}, ast)
3066-
print(result)
3067-
3068-
30693044
def fetch(url: Object) -> Object:
30703045
if not isinstance(url, String):
30713046
raise TypeError(f"fetch expected String, but got {type(url).__name__}")
@@ -3183,6 +3158,31 @@ def runsource(self, source: str, filename: str = "<input>", symbol: str = "singl
31833158
return False
31843159

31853160

3161+
def eval_command(args: argparse.Namespace) -> None:
3162+
if args.debug:
3163+
logging.basicConfig(level=logging.DEBUG)
3164+
3165+
program = args.program_file.read()
3166+
tokens = tokenize(program)
3167+
logger.debug("Tokens: %s", tokens)
3168+
ast = parse(tokens)
3169+
logger.debug("AST: %s", ast)
3170+
result = eval_exp({}, ast)
3171+
print(result)
3172+
3173+
3174+
def apply_command(args: argparse.Namespace) -> None:
3175+
if args.debug:
3176+
logging.basicConfig(level=logging.DEBUG)
3177+
3178+
tokens = tokenize(args.program)
3179+
logger.debug("Tokens: %s", tokens)
3180+
ast = parse(tokens)
3181+
logger.debug("AST: %s", ast)
3182+
result = eval_exp({}, ast)
3183+
print(result)
3184+
3185+
31863186
def repl_command(args: argparse.Namespace) -> None:
31873187
if args.debug:
31883188
logging.basicConfig(level=logging.DEBUG)

0 commit comments

Comments
 (0)