/// <summary> /// This is used to see if a range classification is one of the string literal types /// </summary> /// <param name="classification">The classification to check</param> /// <returns>True if the classification is an interpolated, normal, or verbatim string literal, false /// if not.</returns> internal static bool IsStringLiteral(this RangeClassification classification) { return(classification == RangeClassification.InterpolatedStringLiteral || classification == RangeClassification.NormalStringLiteral || classification == RangeClassification.VerbatimStringLiteral); }
/// <summary> /// Constructor /// </summary> /// <param name="expression">The regular expression to use</param> /// <param name="classification">The classification to assign matched text</param> public RegexClassification(Regex expression, RangeClassification classification) { this.Expression = expression; this.Classification = classification; }
//===================================================================== /// <summary> /// This is used to see if a range classification is one of the string literal types and is followed by /// another of the same type. /// </summary> /// <param name="classification">The classification to check</param> /// <returns>True if the classification is an interpolated, normal, or verbatim string literal followed /// by another of the same type, false if not.</returns> internal static bool ConsecutiveStringLiterals(this RangeClassification classification, RangeClassification nextClassification) { return((classification == RangeClassification.InterpolatedStringLiteral || classification == RangeClassification.NormalStringLiteral || classification == RangeClassification.VerbatimStringLiteral) && classification == nextClassification); }