From fb339a2425ac613e59d8bd24638d2842128d5cbd Mon Sep 17 00:00:00 2001 From: Seth Kingsley Date: Thu, 4 Oct 2018 21:00:38 -0700 Subject: [PATCH] ImGui::End() must always be called after Begin() --- misc/raii/extract_raii.rb | 86 ++++++++++++++++++++++----------------- misc/raii/imgui_raii.h | 8 ++-- 2 files changed, 53 insertions(+), 41 deletions(-) diff --git a/misc/raii/extract_raii.rb b/misc/raii/extract_raii.rb index d3a705724..e4f64d93c 100644 --- a/misc/raii/extract_raii.rb +++ b/misc/raii/extract_raii.rb @@ -11,29 +11,55 @@ puts <[\w\s]+\w)\s+(?\w*)\((?[^)]+)\)(?[^;]*);(?.*)$/) do |m| next unless m[:name].match(/^(Begin|Push|Open|Tree|Column)/) @@ -55,34 +81,20 @@ header_file.each_line do |line| fail "Return value #{m[:type]} is not bool or void" unless %w{bool void}.include?(m[:type]) - if !$current_match || $current_match[:name] != m[:name] - if $current_match - close_class + if !current_class || current_class.name != m[:name] + if current_class + current_class.close puts end - $current_match = m - $class_name = case m[:name] - when 'Begin' then 'ImWindow' - else "Im#{m[:name]}" - end - - puts <