修复了一些bug
This commit is contained in:
@@ -79,7 +79,7 @@ namespace Convention.RScript.Runner
|
||||
if (varTypeName == "string")
|
||||
{
|
||||
varType = typeof(string);
|
||||
varDefaultValue = varInitExpression == null ? string.Empty : varInitExpression;
|
||||
varDefaultValue = varInitExpression == null ? string.Empty : varInitExpression.Trim('\"');
|
||||
}
|
||||
else if (varTypeName == "int")
|
||||
{
|
||||
|
||||
@@ -22,7 +22,14 @@ namespace Convention.RScript.Runner
|
||||
// 还原上层命名空间的变量
|
||||
foreach (var local in context.CurrentLocalSpaceVariableNames.Peek())
|
||||
{
|
||||
parser.context.Variables[local] = context.Variables[local].data;
|
||||
if (context.Variables.ContainsKey(local))
|
||||
{
|
||||
parser.context.Variables[local] = context.Variables[local].data;
|
||||
}
|
||||
else
|
||||
{
|
||||
parser.context.Variables.Remove(local);
|
||||
}
|
||||
}
|
||||
context.CurrentLocalSpaceVariableNames.Pop();
|
||||
// 弹栈
|
||||
|
||||
Reference in New Issue
Block a user