Ejemplo n.º 1
0
            private static AnalyzerStateData CreateFullyProcessedInstance()
            {
                AnalyzerStateData instance = new AnalyzerStateData();

                instance.SetStateKind(StateKind.FullyProcessed);
                return(instance);
            }
            private bool TryStartSyntaxAnalysis_NoLock(SyntaxTree tree, out AnalyzerStateData state)
            {
                if (_pendingSyntaxAnalysisTreesCount == 0)
                {
                    state = null;
                    return(false);
                }

                if (_lazySyntaxTreesWithAnalysisData.TryGetValue(tree, out state))
                {
                    if (state.StateKind != StateKind.ReadyToProcess)
                    {
                        state = null;
                        return(false);
                    }
                }
                else
                {
                    state = _analyzerStateDataPool.Allocate();
                }

                state.SetStateKind(StateKind.InProcess);
                Debug.Assert(state.StateKind == StateKind.InProcess);
                _lazySyntaxTreesWithAnalysisData[tree] = state;
                return(true);
            }
 private static AnalyzerStateData CreateFullyProcessedInstance()
 {
     var instance = new AnalyzerStateData();
     instance.SetStateKind(StateKind.FullyProcessed);
     return instance;
 }