private static IUnboundExpr Match(BindingContext context, IBoundDecl decl,
                                          IPattern caseExpr, IUnboundExpr value, IDictionary <string, IUnboundExpr> variables)
        {
            var matcher = new PatternMatcher(context, decl, value, caseExpr, variables);

            return(caseExpr.Accept(matcher));
        }
Example #2
0
 /// <summary>
 /// Gets whether or not the given pattern is covered and will not
 /// be matched. If it can be, adds the pattern to the set of covered values.
 /// </summary>
 /// <param name="pattern">The pattern being matched.</param>
 /// <returns><c>true</c> if the pattern could be matched, <c>false</c>
 /// if a previous patterns cover it.</returns>
 private bool CoverPattern(IPattern pattern)
 {
     if (FullyCovered)
     {
         return(true);
     }
     return(pattern.Accept(this));
 }