Skip to content

Commit

Permalink
NonPrintingCharacters to EscapedNonPrintingCharacters and style
Browse files Browse the repository at this point in the history
  • Loading branch information
clintval committed Jan 23, 2020
1 parent 6d73828 commit 167fa3e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ object ClpArgumentDefinitionPrinting {
private[cmdline] val ArgumentDefaultValuePrefix: String = "Default:"
private[cmdline] val ArgumentOptionalValue: String = "Optional"

/** A collection of non-printing ASCII characters and their string literals. */
private[cmdline] val NonPrintingCharacters: Map[String, String] = Map(
/** A collection of escaped non-printing ASCII characters and their string literals. */
private[cmdline] val EscapedNonPrintingCharacters: Map[Char, String] = Map(
"\t" -> """\t""",
"\b" -> """\b""",
"\n" -> """\n""",
Expand Down Expand Up @@ -126,8 +126,8 @@ object ClpArgumentDefinitionPrinting {

/** Converts all non-printing characters in a string into their string literal form. */
private[sopt] def nonPrintingToStringLiteral(string: String): String = {
NonPrintingCharacters.foldLeft(string) { (toModify, pair: (String, String)) =>
toModify.replaceAllLiterally(pair._1, pair._2)
EscapedNonPrintingCharacters.foldLeft(string) { case (toModify, (char, literal)) =>
toModify.replaceAllLiterally(char, literal)
}
}

Expand Down

0 comments on commit 167fa3e

Please sign in to comment.