Skip to content

Commit

Permalink
Don't pass string literal token through Unescape if the string is mar…
Browse files Browse the repository at this point in the history
…ked as a verbatim string literal using '@' prefix
  • Loading branch information
RobFone committed Feb 24, 2016
1 parent cf63838 commit 7b8ef46
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ExpressionEvaluator/Parser/ExpressionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1002,8 +1002,13 @@ public static string Unescape(string txt)

public static Expression ParseStringLiteral(string token)
{
token = token.Substring(1, token.Length - 2);
token = Unescape(token);
if (token[0] == '@')
token = token.Substring(2, token.Length - 3);
else
{
token = token.Substring(1, token.Length - 2);
token = Unescape(token);
}
return Expression.Constant(token, typeof(string));
}

Expand Down

0 comments on commit 7b8ef46

Please sign in to comment.