Simplify inline function removal during source/function parsing

- If inlines are included, we don't do anything since they are
  disguised already as normal functions
- If inlines are NOT included, we remove anything that has inline in
  it
This commit is contained in:
laurens
2019-11-14 13:38:10 +01:00
parent 0f6e4604ff
commit cb55b73522
+2 -7
View File
@@ -236,13 +236,8 @@ class CMockHeaderParser
src_lines.delete_if {|line| !(line =~ /(?:^|\s+)(?:extern)\s+/).nil?} # remove extern functions
end
if (@treat_inlines == :include)
src_lines.each {
|src_line|
src_line.gsub!(/^inline/, "") # Remove "inline" so that they are 'normal' functions
}
else
src_lines.delete_if {|line| !(line =~ /(?:^|\s+)(?:inline)\s+/).nil?} # remove inline functions
unless (@treat_inlines == :include)
src_lines.delete_if {|line| !(line =~ /(?:^|\s+)(?:inline)\s+/).nil?} # remove inline functions
end
src_lines.delete_if {|line| line.empty? } #drop empty lines