| 498 | int indent = 0; |
| 499 | |
| 500 | Command cmd(const std::string &command, const std::string &post_comment = "") { |
| 501 | if (command.empty()) |
| 502 | throw std::invalid_argument("command cannot be empty"); |
| 503 | if (command == "if") { |
| 504 | indent++; |
| 505 | return Command(ss, indent - 1, command, post_comment); |
| 506 | } else if (command == "else" || command == "elseif") { |
| 507 | return Command(ss, indent - 1, command, post_comment); |
| 508 | } else if (command == "endif") { |
| 509 | indent--; |
| 510 | } |
| 511 | return Command(ss, indent, command, post_comment); |
| 512 | } |
| 513 | |
| 514 | CommandEndl comment(const std::string &comment) { |
| 515 | ss << Command::indent(indent) << "# " << comment << '\n'; |
no test coverage detected