partial ConnectedComponents labeler; fixes bugs in Evaluator

This commit is contained in:
Chris Forbes
2010-03-15 19:14:55 +13:00
parent f18028e309
commit 024f10cfbd
3 changed files with 42 additions and 5 deletions

View File

@@ -22,10 +22,10 @@ namespace OpenRA.FileFormats
{
switch (t[0])
{
case '+': ApplyBinop(s, (x, y) => x + y); break;
case '-': ApplyBinop(s, (x, y) => x - y); break;
case '*': ApplyBinop(s, (x, y) => x * y); break;
case '/': ApplyBinop(s, (x, y) => x / y); break;
case '+': ApplyBinop(s, (x, y) => y + x); break;
case '-': ApplyBinop(s, (x, y) => y - x); break;
case '*': ApplyBinop(s, (x, y) => y * x); break;
case '/': ApplyBinop(s, (x, y) => y / x); break;
default: s.Push(int.Parse(t)); break;
}
}
@@ -65,7 +65,7 @@ namespace OpenRA.FileFormats
}
static readonly Dictionary<string, int> Prec
= new Dictionary<string, int> { { "+", 0 }, { "-", 0 }, { "*", 1 }, { "/", 1 } };
= new Dictionary<string, int> { { "+", 0 }, { "-", 0 }, { "*", 1 }, { "/", 1 }, { "(", -1 } };
static IEnumerable<string> Tokens(string expr, string ops)
{