Skip to content

Commit

Permalink
[cpp] fixed a bug where parse::escape will ignore all escape codes if…
Browse files Browse the repository at this point in the history
… they're not at the front of the string
  • Loading branch information
harrand committed May 23, 2024
1 parent 364cd4f commit c4d2d97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cpp/src/parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace parse
}
for(std::size_t i = 0; i < literal.size(); i++)
{
const char* substr = literal.data() + i;
std::string_view substr{literal.data() + i, 2};
auto iter = escape_map.find(substr);
if(iter != escape_map.end())
{
Expand Down
2 changes: 1 addition & 1 deletion samples/scratchpad.psy
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ print_hello :: () -> u0
buffer[5] = '\0';
puts(buffer);

literal : i8& const := "hello again!";
literal : i8& const := "hello\tagain!";
puts(literal);
}

Expand Down

0 comments on commit c4d2d97

Please sign in to comment.