| 178 | } |
| 179 | |
| 180 | void AppendMap(const MapExpr& obj) { |
| 181 | if (obj.entries().empty()) { |
| 182 | Append("{}"); |
| 183 | return; |
| 184 | } |
| 185 | Append("{"); |
| 186 | AppendLine(); |
| 187 | Indent(); |
| 188 | for (int i = 0; i < obj.entries().size(); ++i) { |
| 189 | const auto& entry = obj.entries()[i]; |
| 190 | if (i > 0) { |
| 191 | Append(","); |
| 192 | AppendLine(); |
| 193 | } |
| 194 | if (entry.optional()) { |
| 195 | Append("?"); |
| 196 | } |
| 197 | AppendExpr(entry.key()); |
| 198 | Append(":"); |
| 199 | AppendExpr(entry.value()); |
| 200 | Append(adorner_.AdornMapEntry(entry)); |
| 201 | } |
| 202 | AppendLine(); |
| 203 | Unindent(); |
| 204 | Append("}"); |
| 205 | } |
| 206 | |
| 207 | void AppendComprehension(const ComprehensionExpr& comprehension) { |
| 208 | Append("__comprehension__("); |