From 0f6e4604ff8c377753ab02ada2f25b4341139879 Mon Sep 17 00:00:00 2001 From: laurens Date: Thu, 14 Nov 2019 13:37:57 +0100 Subject: [PATCH] Remove inline specific keywords before starting function parsing --- lib/cmock_header_parser.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/cmock_header_parser.rb b/lib/cmock_header_parser.rb index 853cd11..94df308 100644 --- a/lib/cmock_header_parser.rb +++ b/lib/cmock_header_parser.rb @@ -162,6 +162,14 @@ class CMockHeaderParser @local_as_void += void_types.flatten.uniq.compact end + # If user wants to mock inline functions, + # remove the (user specific) inline keywords before removing anything else to avoid missing an inline function + if (@treat_inlines == :include) + @inline_function_patterns.each { |user_format_string| + source.gsub!(/#{user_format_string}/, '') # remove user defined inline function patterns + } + end + # smush multiline macros into single line (checking for continuation character at end of line '\') source.gsub!(/\s*\\\s*/m, ' ')