From 1632053432b03ed9158f0d3cad380e67e8c2dd16 Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Sun, 17 Feb 2013 15:02:21 -0600 Subject: [PATCH] Replace instead of ReplaceAll --- Antlr4.Runtime/CommonToken.cs | 6 +++--- Antlr4.Runtime/DefaultErrorStrategy.cs | 6 +++--- Antlr4.Runtime/Recognizer`2.cs | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Antlr4.Runtime/CommonToken.cs b/Antlr4.Runtime/CommonToken.cs index 37fc2cfe6..d467dcbf7 100644 --- a/Antlr4.Runtime/CommonToken.cs +++ b/Antlr4.Runtime/CommonToken.cs @@ -270,9 +270,9 @@ namespace Antlr4.Runtime string txt = Text; if (txt != null) { - txt = txt.ReplaceAll("\n", "\\\\n"); - txt = txt.ReplaceAll("\r", "\\\\r"); - txt = txt.ReplaceAll("\t", "\\\\t"); + txt = txt.Replace("\n", "\\n"); + txt = txt.Replace("\r", "\\r"); + txt = txt.Replace("\t", "\\t"); } else { diff --git a/Antlr4.Runtime/DefaultErrorStrategy.cs b/Antlr4.Runtime/DefaultErrorStrategy.cs index 2cb99bc1e..c08eb7360 100644 --- a/Antlr4.Runtime/DefaultErrorStrategy.cs +++ b/Antlr4.Runtime/DefaultErrorStrategy.cs @@ -506,9 +506,9 @@ namespace Antlr4.Runtime protected internal virtual string EscapeWSAndQuote(string s) { // if ( s==null ) return s; - s = s.ReplaceAll("\n", "\\\\n"); - s = s.ReplaceAll("\r", "\\\\r"); - s = s.ReplaceAll("\t", "\\\\t"); + s = s.Replace("\n", "\\n"); + s = s.Replace("\r", "\\r"); + s = s.Replace("\t", "\\t"); return "'" + s + "'"; } diff --git a/Antlr4.Runtime/Recognizer`2.cs b/Antlr4.Runtime/Recognizer`2.cs index f2c2b34d7..8ee32e45a 100644 --- a/Antlr4.Runtime/Recognizer`2.cs +++ b/Antlr4.Runtime/Recognizer`2.cs @@ -148,9 +148,9 @@ namespace Antlr4.Runtime s = "<" + t.Type + ">"; } } - s = s.ReplaceAll("\n", "\\\\n"); - s = s.ReplaceAll("\r", "\\\\r"); - s = s.ReplaceAll("\t", "\\\\t"); + s = s.Replace("\n", "\\n"); + s = s.Replace("\r", "\\r"); + s = s.Replace("\t", "\\t"); return "'" + s + "'"; }