forked from jasder/antlr
Replace instead of ReplaceAll
This commit is contained in:
parent
80a8cdd773
commit
1632053432
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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 + "'";
|
||||
}
|
||||
|
||||
|
|
|
@ -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 + "'";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue