diff options
| author | skal <pascal.massimino@gmail.com> | 2026-03-05 00:32:04 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-03-05 00:32:04 +0100 |
| commit | f810da79a3e2bd5b16e647fb3efbb50ee2da44fc (patch) | |
| tree | 33007e9bb8fc1eb5b99415eb7fcea744e1d59689 /tools | |
| parent | e0be1ff83f6da41f37ac806428bcb0ce7f0e4b32 (diff) | |
feat(tracker): add /* */ block comment support to .track parser
handoff(Gemini): tracker_compiler now handles single-line and multi-line block comments.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'tools')
| -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; |
