Skip to content

Commit

Permalink
Merge pull request #109 from abap34/refactor/#108
Browse files Browse the repository at this point in the history
`join_with` を削除
  • Loading branch information
abap34 authored May 17, 2024
2 parents c43d8a5 + 9c368f3 commit 5a271ab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,11 @@ namespace almo {
}

json += "\"childs\":[";
for (auto c : childs | std::views::transform([](auto child){ return child->to_json(); }) | std::views::join_with(',')){
json += c;
if (childs.size() > 0) {
for (auto child : childs) {
json += child->to_json() + ",";
}
json = json.substr(0, json.length() - 1);
}
json += "]}";
return json;
Expand Down

0 comments on commit 5a271ab

Please sign in to comment.