Merge pull request #36 from jlesage/strippables_regex_fix2

Adjust source file to be able to properly strip macros when using strippables (An elegant solution, Jocelyn!)
This commit is contained in:
Mark VanderVoord
2014-05-22 10:18:21 -04:00
+1
View File
@@ -83,6 +83,7 @@ class CMockHeaderParser
source.gsub!(/(\W)(?:register|auto|static|restrict)(\W)/, '\1\2') # remove problem keywords
source.gsub!(/\s*=\s*['"a-zA-Z0-9_\.]+\s*/, '') # remove default value statements from argument lists
source.gsub!(/^(?:[\w\s]*\W)?typedef\W[^;]*/m, '') # remove typedef statements
source.gsub!(/\)(\w)/, ') \1') # add space between parenthese and alphanumeric
source.gsub!(/(^|\W+)(?:#{@c_strippables.join('|')})(?=$|\W+)/,'\1') unless @c_strippables.empty? # remove known attributes slated to be stripped
#scan for functions which return function pointers, because they are a pain