예제 #1
0
            static TypeSystemAstBuilder CreateAstBuilder(CSharpTypeResolveContext context, IL.ILFunction function = null)
            {
                CSharpResolver resolver = new CSharpResolver(context);

                if (function != null)
                {
                    foreach (var v in function.Variables)
                    {
                        if (v.Kind != IL.VariableKind.Parameter)
                        {
                            resolver = resolver.AddVariable(new DefaultVariable(v.Type, v.Name));
                        }
                    }
                }

                return(new TypeSystemAstBuilder(resolver)
                {
                    AddResolveResultAnnotations = true,
                    UseAliases = true
                });
            }