@@ -99,8 +99,7 @@ private void RegisterVariableOrConst(string name, Expression expr)
99
99
public virtual Expression LookupExpression(string name, bool isLocalOnly = false)
100
100
{
101
101
// Lookup the current scope
102
- Expression p;
103
- if (scopeVariables != null && scopeVariables.TryGetValue(name, out p))
102
+ if (scopeVariables != null && scopeVariables.TryGetValue(name, out var p))
104
103
return p;
105
104
106
105
return parent != null && !isLocalOnly ? // lookup the parent scope
@@ -2181,17 +2180,16 @@ private static void ParseFunction(Scope scope, ILuaLexer code, bool isLocal)
2181
2180
{
2182
2181
var t = FetchToken(LuaToken.Identifier, code);
2183
2182
2184
- ParameterExpression funcVar = scope.LookupExpression(t.Value) as ParameterExpression;
2183
+ var funcVar = scope.LookupExpression(t.Value) as ParameterExpression;
2185
2184
Expression exprFunction;
2186
2185
if (funcVar == null)
2187
2186
{
2188
2187
exprFunction = ParseLamdaDefinition(scope, code, t.Value, false,
2189
- typeDelegate => funcVar = scope.RegisterVariable(typeDelegate, t.Value));
2188
+ typeDelegate => funcVar = scope.RegisterVariable(typeDelegate, t.Value)
2189
+ );
2190
2190
}
2191
2191
else
2192
- {
2193
2192
exprFunction = ParseLamdaDefinition(scope, code, t.Value, false, null);
2194
- }
2195
2193
2196
2194
scope.AddExpression(Expression.Assign(funcVar, exprFunction));
2197
2195
}
@@ -2211,7 +2209,7 @@ private static void ParseFunction(Scope scope, ILuaLexer code, bool isLocal)
2211
2209
memberName = FetchToken(LuaToken.Identifier, code).Value;
2212
2210
}
2213
2211
// add a method to the table. methods get a hidden parameter and will bo marked
2214
- bool lMethodMember = false;
2212
+ var isMemberMethod = false;
2215
2213
if (code.Current.Typ == LuaToken.Colon)
2216
2214
{
2217
2215
code.Next();
@@ -2220,7 +2218,7 @@ private static void ParseFunction(Scope scope, ILuaLexer code, bool isLocal)
2220
2218
assignee = ParseFunctionAddChain(scope, tCurrent, assignee, memberName);
2221
2219
// fetch the method name
2222
2220
memberName = FetchToken(LuaToken.Identifier, code).Value;
2223
- lMethodMember = true;
2221
+ isMemberMethod = true;
2224
2222
}
2225
2223
else
2226
2224
{
@@ -2239,7 +2237,7 @@ private static void ParseFunction(Scope scope, ILuaLexer code, bool isLocal)
2239
2237
}
2240
2238
2241
2239
// generate lambda
2242
- scope.AddExpression(MemberSetExpression(scope.Runtime, tCurrent, assignee, memberName, lMethodMember , ParseLamdaDefinition(scope, code, memberName, lMethodMember , null)));
2240
+ scope.AddExpression(MemberSetExpression(scope.Runtime, tCurrent, assignee, memberName, isMemberMethod , ParseLamdaDefinition(scope, code, memberName, isMemberMethod , null)));
2243
2241
}
2244
2242
} // proc ParseLamdaDefinition
2245
2243
0 commit comments