diff options
Diffstat (limited to 'tools/tracker_compiler.cc')
| -rw-r--r-- | tools/tracker_compiler.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/tracker_compiler.cc b/tools/tracker_compiler.cc index d2cdc98..e206fbb 100644 --- a/tools/tracker_compiler.cc +++ b/tools/tracker_compiler.cc @@ -422,8 +422,28 @@ int main(int argc, char** argv) { std::string line; std::string current_section = ""; + bool in_block_comment = false; while (std::getline(in, line)) { + // Handle /* */ block comments + if (in_block_comment) { + const size_t end = line.find("*/"); + if (end == std::string::npos) + continue; + line = line.substr(end + 2); + in_block_comment = false; + } + const size_t block_start = line.find("/*"); + if (block_start != std::string::npos) { + const size_t block_end = line.find("*/", block_start + 2); + if (block_end == std::string::npos) { + in_block_comment = true; + line = line.substr(0, block_start); + } else { + line = line.substr(0, block_start) + line.substr(block_end + 2); + } + } + if (line.empty() || line[0] == '#') continue; |
