private IEnumerable <Match> MatchSingleValue(JValue input, JValue pattern) { switch (pattern.Type) { case JTokenType.String: var patternValue = pattern.Value <string>(); if (PlaceholderHelper.IsPlaceholder(patternValue, out var placeholder)) { return(MatchCollectionHelper.CreateWithSingleGroup(new CapturingGroup { Key = placeholder, Value = (input as JValue).GetPrimitiveAsObject(), Path = input.Path })); } else { return(string.Equals(input.Value <string>(), PlaceholderHelper.Unescape(patternValue), this.stringComparison) ? MatchCollectionHelper.CreateWithEmptyMatch() : null); } case JTokenType.Integer: return(input.Value <long>() == pattern.Value <long>() ? MatchCollectionHelper.CreateWithEmptyMatch() : null); case JTokenType.Boolean: return(input.Value <bool>() == pattern.Value <bool>() ? MatchCollectionHelper.CreateWithEmptyMatch() : null); default: throw new NotSupportedJTokenTypeException(pattern); } }