Skip to content

Commit

Permalink
Merge pull request #1689 from rogeralsing/hocon-tripple-quote-escape-fix
Browse files Browse the repository at this point in the history
Hocon Tripple quoted text - Fixes #1687
  • Loading branch information
Horusiath committed Feb 7, 2016
2 parents 3390255 + 2919b7f commit 60684b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 8 additions & 0 deletions src/core/Akka.Tests/Configuration/HoconTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,14 @@ public void CanAssignTripleQuotedStringToField()
Assert.Equal("hello", ConfigurationFactory.ParseString(hocon).GetString("a"));
}

[Fact]
public void CanAssignTripleQuotedStringWithUnescapedCharsToField()
{
var hocon = @"a=""""""hello\y\o\u""""""";
Assert.Equal("hello\\y\\o\\u", ConfigurationFactory.ParseString(hocon).GetString("a"));
}


[Fact]
public void CanUseFallback()
{
Expand Down
11 changes: 2 additions & 9 deletions src/core/Akka/Configuration/Hocon/HoconTokenizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -470,15 +470,8 @@ public Token PullTripleQuotedText()
Take(3);
while (!EoF && !Matches("\"\"\""))
{
if (Matches("\\"))
{
sb.Append(PullEscapeSequence());
}
else
{
sb.Append(Peek());
Take();
}
sb.Append(Peek());
Take();
}
Take(3);
return Token.LiteralValue(sb.ToString());
Expand Down

0 comments on commit 60684b3

Please sign in to comment.