public ErrorRecoveryException(ErrorRecoveryScope scope)
        {
            if (scope == null)
            {
                throw new ArgumentNullException(nameof(scope));
            }

            Scope = scope;
        }
示例#2
0
        private bool CanRecoverInParentScope(TokenKind kind, string text, out ErrorRecoveryScope recoveryScope)
        {
            foreach (var scope in recoveryScopes_)
            {
                if (scope.CanRecover(kind, text))
                {
                    recoveryScope = scope;
                    return(true);
                }
            }

            recoveryScope = null;
            return(false);
        }