private MethodAnalysisData AnalyzeSyntaxMethod(BlockSyntax syntax, SemanticModel model)
 {
     if (syntax == null)
     {
         return(new MethodAnalysisData()
         {
             NumberOfLines = 1,
             NumberOfStatements = 1,
             BasiliComplexity = 1,
             written = true
         });
     }
     else
     {
         var statementCounter = new StatementCounterWalker();
         syntax.Accept(statementCounter);
         var basiliWalker = new BasiliWalker();
         syntax.Accept(basiliWalker);
         return(new MethodAnalysisData()
         {
             NumberOfLines = syntax.ToString().Split('\n').Count(),
             NumberOfStatements = statementCounter.NumberOfStatements,
             BasiliComplexity = basiliWalker.Complexity,
             written = true
         });
     }
 }
Пример #2
0
        private void WriteMethodBody(StringBuilder builder, BlockSyntax body)
        {
            var intrinsicType = _context.Compilation.GetTypeByMetadataName(IntrinsicAttribute) !;
            var walker        = new ShaderBodyWalker(_context, _model, builder);

            body.Accept(walker);
            Debugger.Break();
        }