Program.cs 764 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Jint.Repl
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. var engine = new Engine();
  13. while (true)
  14. {
  15. Console.ForegroundColor = ConsoleColor.Green;
  16. Console.Write(" > ");
  17. var input = Console.ReadLine();
  18. if (input == "exit")
  19. {
  20. return;
  21. }
  22. var result = engine.GetValue(engine.Execute(input));
  23. Console.ForegroundColor = ConsoleColor.Magenta;
  24. Console.WriteLine("=> {0}", result);
  25. }
  26. }
  27. }
  28. }