Beispiel #1
0
 protected ModuleParseResults ModuleParseResults(QualifiedModuleName module, CancellationToken token)
 {
     _state.ClearStateCache(module);
     try
     {
         return(_parser.Parse(module, token));
     }
     catch (SyntaxErrorException syntaxErrorException)
     {
         //In contrast to the situation in the success scenario, the overall parser state is reevaluated immediately.
         //This sets the state directly on the state because it is the sole instance where we have to pass the SyntaxErrorException.
         _state.SetModuleState(module, ParserState.Error, token, syntaxErrorException);
         return(default);
 protected void ParseModule(QualifiedModuleName module, CancellationToken token)
 {
     _state.ClearStateCache(module);
     try
     {
         var parseResults = _parser.Parse(module, token);
         SaveModuleParseResultsOnState(module, parseResults, token);
     }
     catch (SyntaxErrorException syntaxErrorException)
     {
         //In contrast to the situation in the success scenario, the overall parser state is reevaluated immediately.
         //This sets the state directly on the state because it is the sole instance where we have to pass the SyntaxErorException.
         _state.SetModuleState(module, ParserState.Error, token, syntaxErrorException);
     }
     catch (Exception exception)
     {
         StateManager.SetStatusAndFireStateChanged(this, ParserState.Error, token);
         throw;
     }
 }