Handle variables
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Upsilon.Evaluator;
|
||||
using Upsilon.Parser;
|
||||
using Upsilon.Utilities;
|
||||
|
||||
namespace Yc
|
||||
{
|
||||
@@ -9,6 +10,7 @@ namespace Yc
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Upsilon REPL");
|
||||
Dictionary<string, object> variables = new Dictionary<string, object>();
|
||||
while (true)
|
||||
{
|
||||
Console.Write("» ");
|
||||
@@ -18,9 +20,10 @@ namespace Yc
|
||||
return;
|
||||
}
|
||||
|
||||
var parser = Parser.Parse(input);
|
||||
//Console.WriteLine(parser.Print());
|
||||
Console.WriteLine(parser.Evaluate());
|
||||
var parsed = new Script(input, variables);
|
||||
//Console.WriteLine(parsed.Parsed.Print());
|
||||
Console.WriteLine(parsed.Evaluate());
|
||||
variables = parsed.Variables;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user