本文整理汇总了C#中ArrayBuilder.ToImmutable方法的典型用法代码示例。如果您正苦于以下问题:C# ArrayBuilder.ToImmutable方法的具体用法?C# ArrayBuilder.ToImmutable怎么用?C# ArrayBuilder.ToImmutable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayBuilder
的用法示例。
在下文中一共展示了ArrayBuilder.ToImmutable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildLocals
override protected ImmutableArray<LocalSymbol> BuildLocals()
{
if (syntax.Declaration != null)
{
var locals = new ArrayBuilder<LocalSymbol>(syntax.Declaration.Variables.Count);
foreach (VariableDeclaratorSyntax declarator in syntax.Declaration.Variables)
{
locals.Add(SourceLocalSymbol.MakeLocal(this.Owner, this, syntax.Declaration.Type, declarator.Identifier, declarator.Initializer, LocalDeclarationKind.Fixed));
}
return locals.ToImmutable();
}
return ImmutableArray<LocalSymbol>.Empty;
}
示例2: BuildLocals
override protected ImmutableArray<LocalSymbol> BuildLocals()
{
if (_syntax.Declaration != null)
{
var locals = new ArrayBuilder<LocalSymbol>(_syntax.Declaration.Variables.Count);
foreach (VariableDeclaratorSyntax declarator in _syntax.Declaration.Variables)
{
locals.Add(MakeLocal(_syntax.Declaration, declarator, LocalDeclarationKind.FixedVariable));
}
return locals.ToImmutable();
}
return ImmutableArray<LocalSymbol>.Empty;
}
示例3: BuildLocals
override protected ImmutableArray<LocalSymbol> BuildLocals()
{
if (_syntax.Declaration != null)
{
var locals = new ArrayBuilder<LocalSymbol>(_syntax.Declaration.Variables.Count);
foreach (VariableDeclaratorSyntax declarator in _syntax.Declaration.Variables)
{
locals.Add(MakeLocal(_syntax.Declaration, declarator, LocalDeclarationKind.FixedVariable));
// also gather expression-declared variables from the bracketed argument lists and the initializers
ExpressionVariableFinder.FindExpressionVariables(this, locals, declarator);
}
return locals.ToImmutable();
}
return ImmutableArray<LocalSymbol>.Empty;
}
示例4: BuildLocals
override protected ImmutableArray<LocalSymbol> BuildLocals()
{
if (_syntax.Declaration != null)
{
var locals = new ArrayBuilder<LocalSymbol>(_syntax.Declaration.Variables.Count);
foreach (VariableDeclaratorSyntax declarator in _syntax.Declaration.Variables)
{
locals.Add(MakeLocal(_syntax.Declaration, declarator, LocalDeclarationKind.FixedVariable));
if (declarator.Initializer != null)
{
ExpressionVariableFinder.FindExpressionVariables(this, locals, declarator.Initializer.Value);
}
}
return locals.ToImmutable();
}
return ImmutableArray<LocalSymbol>.Empty;
}
示例5: GetRefKindsOrNull
private static ImmutableArray<RefKind> GetRefKindsOrNull(ArrayBuilder<RefKind> refKinds)
{
foreach (var refKind in refKinds)
{
if (refKind != RefKind.None)
{
return refKinds.ToImmutable();
}
}
return default(ImmutableArray<RefKind>);
}