本文整理汇总了C#中IPersistentMap.valAt方法的典型用法代码示例。如果您正苦于以下问题:C# IPersistentMap.valAt方法的具体用法?C# IPersistentMap.valAt怎么用?C# IPersistentMap.valAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPersistentMap
的用法示例。
在下文中一共展示了IPersistentMap.valAt方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EmitMethods
private static void EmitMethods(TypeBuilder proxyTB,
List<MethodSignature> sigs,
Dictionary<string,List<MethodSignature>> overloads,
Dictionary<string,FieldBuilder> varMap,
IPersistentMap exposesMethods)
{
foreach (MethodSignature sig in sigs)
{
FieldBuilder regularFB = varMap[sig.Name];
FieldBuilder overloadFB = null;
if (overloads.ContainsKey(sig.Name))
overloadFB = varMap[OverloadName(sig)];
switch (sig.Source)
{
case "super":
EmitForwardingMethod(proxyTB, false, regularFB, overloadFB, sig,
delegate(ILGen gen)
{
gen.EmitLoadArg(0); // gen.Emit(OpCodes.Ldarg_0);
for (int i = 0; i < sig.ParamTypes.Length; i++)
gen.EmitLoadArg(i + 1); // gen.Emit(OpCodes.Ldarg, (i + 1));
gen.Emit(OpCodes.Call, sig.Method); // not gen.EmitCall(sig.Method) -- we need call versus callvirt
});
break;
case "interface":
EmitForwardingMethod(proxyTB, false, regularFB, overloadFB, sig,
delegate(ILGen gen)
{
EmitUnsupported(gen, sig.Name);
});
break;
default:
EmitForwardingMethod(proxyTB, sig.IsStatic, regularFB, overloadFB, sig,
delegate(ILGen gen)
{
EmitUnsupported(gen, sig.Name);
});
break;
}
}
if (exposesMethods != null)
{
foreach (MethodSignature sig in sigs)
{
if (sig.Source == "super")
{
Symbol name = Symbol.intern(sig.Name);
if (exposesMethods.containsKey(name))
CreateSuperCall(proxyTB, (Symbol)exposesMethods.valAt(name), sig.Method);
}
}
}
}
示例2: GetLocation
static bool GetLocation(IPersistentMap spanMap, Keyword key, out int val)
{
object oval = spanMap.valAt(key);
if (oval != null && oval is int)
{
val = (int)oval;
return true;
}
val = -1;
return false;
}
示例3: read
public static Object read(PushbackTextReader r, IPersistentMap opts)
{
return read(r, !opts.containsKey(EOF), opts.valAt(EOF), false, opts);
}
示例4: MaybeAddDebugInfo
public Expression MaybeAddDebugInfo(Expression expr, IPersistentMap spanMap)
{
if (_isDebuggable && spanMap != null & _docInfo != null)
{
int startLine;
int startCol;
int finishLine;
int finishCol;
if (Compiler.GetLocations(spanMap, out startLine, out startCol, out finishLine, out finishCol))
return AstUtils.AddDebugInfo(expr,
_docInfo,
new Microsoft.Scripting.SourceLocation(0, (int)spanMap.valAt(RT.StartLineKey), (int)spanMap.valAt(RT.StartColumnKey)),
new Microsoft.Scripting.SourceLocation(0, (int)spanMap.valAt(RT.EndLineKey), (int)spanMap.valAt(RT.EndColumnKey)));
}
return expr;
}
示例5: MaybeReflectionWarn
private static void MaybeReflectionWarn(IPersistentMap spanMap, MethodBase method, string methodName)
{
if ( method == null && RT.booleanCast(RT.WARN_ON_REFLECTION.deref()) )
RT.errPrintWriter().WriteLine(string.Format("Reflection warning, {0}:{1} - call to {2} can't be resolved.\n",
Compiler.SOURCE_PATH.deref(), spanMap != null ? (int)spanMap.valAt(RT.START_LINE_KEY, 0) : 0, methodName));
}
示例6: MaybeAddDebugInfo
internal static Expression MaybeAddDebugInfo(Expression expr, IPersistentMap spanMap, bool isDebuggable)
{
if ( isDebuggable && spanMap != null & Compiler.DocInfo() != null)
{
int startLine;
int startCol;
int finishLine;
int finishCol;
if (GetLocations(spanMap, out startLine, out startCol, out finishLine, out finishCol))
return AstUtils.AddDebugInfo(expr,
Compiler.DocInfo(),
new Microsoft.Scripting.SourceLocation(0, (int)spanMap.valAt(RT.START_LINE_KEY), (int)spanMap.valAt(RT.START_COLUMN_KEY)),
new Microsoft.Scripting.SourceLocation(0, (int)spanMap.valAt(RT.END_LINE_KEY), (int)spanMap.valAt(RT.END_COLUMN_KEY)));
}
return expr;
}