Skip to content

Commit 576534d

Browse files
Temporary time saver: avoid functions with +4 arguments
1 parent d9c063a commit 576534d

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

flushfillsrc/flushfillsrc/FlushFill.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ private IEnumerable<string> Recurse(List<ExcelFunction> functions, List<IOPair>
8282
foreach (ExcelFunction function in functions)
8383
{
8484

85-
if (!AcceptableFunction(function.Name)) continue;
85+
//if (!AcceptableFunction(function.Name)) continue;
8686
Console.WriteLine(function.Name);
8787

8888
int numberOfArguments = function.NumberOfTotalArguments;
89+
if (numberOfArguments > 4) continue; //temporary time saver
8990
foreach (string s in GetArgumentCombinations(numberOfArguments, max_depth, functions, io))
9091
{
9192
yield return function.Name + "(" + s + ")";
@@ -110,13 +111,19 @@ private bool CheckAllCases(List<IOPair> io, string s)
110111

111112
private bool CheckResults(IOPair io, string fullFormula)
112113
{
113-
dynamic eval = evaluator.Evaluate(fullFormula);
114-
if (!(eval is Int32)) //http://stackoverflow.com/a/2425170
114+
try
115115
{
116-
if (eval.ToString().Equals(io.Output))
116+
dynamic eval = evaluator.Evaluate(fullFormula);
117+
if (!(eval is Int32)) //http://stackoverflow.com/a/2425170
117118
{
118-
return true;
119+
if (eval.ToString().Equals(io.Output))
120+
{
121+
return true;
122+
}
119123
}
124+
} catch (IOException)
125+
{
126+
120127
}
121128

122129
return false;

0 commit comments

Comments
 (0)