private void button11_Click(object sender, EventArgs e)
{
//scriptService.ClearCodeCache();
int rightcount = 0;
foreach (string file in listCodeFile.Items)
{
string code = System.IO.File.ReadAllText(file);
//code=code.Replace("\r", "");
CSLE.CLS_Content.Value v = null;
var token = scriptService.tokenParser.Parse(code);
try
{
var vexpr = this.scriptService.Expr_CompilerToken(token, false);
v = this.scriptService.Expr_Execute(vexpr);
}
catch
{
try
{
var vexpr = this.scriptService.Expr_CompilerToken(token, true);
v = this.scriptService.Expr_Execute(vexpr);
}
catch
{
v = null;
}
}
if (v != null)
{
Log("result=<" + v.type.Name + ">" + v.value);
rightcount++;
}
else
{
Log_Error(file);
}
}
Log("succ=(" + rightcount + "/" + listCodeFile.Items.Count + ")");
}