Skip to content

Commit

Permalink
Add support of many special symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
Ttimofeyka committed Nov 20, 2024
1 parent 57457c7 commit 36d9658
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions std/json.rave
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,14 @@ namespace std {

idx[0] += 1; // skip first "
while((idx[0] < data.length) && (data.at(idx[0]) != '"')) {
if((data.at(idx[0]) == '\\') && (data.at(idx[0] + 1) == '"')) {
buffer.add('\\');
buffer.add('"');
if((data.at(idx[0]) == '\\')) {
switch(data.at(idx[0] + 1)) {
case('"') buffer.add('"');
case('n') buffer.add('\n');
case('r') buffer.add('\r');
case('t') buffer.add('\t');
case('\'') buffer.add('\'');
}
idx[0] += 2;
}
else {
Expand Down

0 comments on commit 36d9658

Please sign in to comment.