Skip to content

Commit 7770534

Browse files
committed
Parserのキー設定のバグを修正
1 parent 4b63239 commit 7770534

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ clang++ -I <Your Include Path> ./main.cpp
5757
すると、以下の結果が返されます。
5858

5959
```
60-
{"user_info":{"user_id":"A1234567",""user_name"":"Yamada Taro"}}
60+
{"user_info":{"user_id":"A1234567","user_name":"Yamada Taro"}}
6161
A1234567
6262
```
6363

src/parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ namespace JsonParser {
108108
if (chs[index_current + 1][0] != '"') {
109109
throw std::runtime_error("At Object(): '\"' is expected, however other character is set.");
110110
}
111-
child = new Node(chs[index_current + 1]);
111+
child = new Node(chs[index_current + 1].substr(1, chs[index_current + 1].size() - 2));
112112

113113
// Check exists ":" between "key" and Value.
114114
if (index_current + 2 >= chs.size()) {

0 commit comments

Comments
 (0)