Skip to content

Commit

Permalink
mini repl in console testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Banane9 committed Jun 8, 2016
1 parent c9b36d7 commit c9efb29
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion IronWren.ConsoleTesting/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;

namespace IronWren.ConsoleTesting
Expand Down Expand Up @@ -97,8 +98,21 @@ private static void Main(string[] args)
vm.Interpret("System.print(\"Vector's X is: %(vec.x)\")");
vm.Interpret("System.print(\"Vector's Y is: %(vec.y)\")");

Console.ReadLine();
Console.Clear();
Console.WriteLine("You may now write Wren code that will be interpreted!");
Console.WriteLine("Use file:[path] to interpret a file!");
Console.WriteLine();

while (true)
vm.Interpret(Console.ReadLine());
{
var input = Console.ReadLine();

if (input.StartsWith("file:"))
vm.Interpret(File.ReadAllText(input.Substring(5)));
else
vm.Interpret(input);
}
}
}

Expand Down

0 comments on commit c9efb29

Please sign in to comment.