From 3dbbe9e100c6036b10509dbfae578bf953b989c0 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 13 Jan 2024 12:13:38 +0100 Subject: [PATCH] Handle single line defines in the doc generator properly. --- tools/doc/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/doc/main.cpp b/tools/doc/main.cpp index 3202e13..ef13e6a 100644 --- a/tools/doc/main.cpp +++ b/tools/doc/main.cpp @@ -143,6 +143,13 @@ List process_classes_and_structs(const List &list) { for (int i = 0; i < lines.size(); ++i) { String l = lines[i]; + if (l.strip_edges(true, false).begins_with("#")) { + // Skip #if-s + // Note this will fail for multi line defines, But those currently does not appear in class definitions + stripped += l + "\n"; + continue; + } + if (l.contains("enum ")) { in_enum = true; enum_scope_start = current_scope_count;