Rename total_levels to total_pairs

- We are counting pairs of braces, not levels of indentation
This commit is contained in:
laurens
2019-11-13 00:03:52 +01:00
parent 811b85e1b1
commit 0c45d26a28
+4 -4
View File
@@ -78,12 +78,12 @@ class CMockHeaderParser
def count_number_of_pairs_of_braces_in_function(source)
is_function_start_found = false
curr_level = 0
total_levels = 0
total_pairs = 0
source.each_char do |c|
if ("{" == c)
curr_level += 1
total_levels +=1
total_pairs +=1
is_function_start_found = true
elsif ("}" == c)
curr_level -=1
@@ -93,10 +93,10 @@ class CMockHeaderParser
end
if 0 != curr_level
total_levels = 0 # Something is fishy about this source, not enough closing braces?
total_pairs = 0 # Something is fishy about this source, not enough closing braces?
end
return total_levels
return total_pairs
end
# Transform inline functions to regular functions in the source by the user