mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-08-30 06:49:59 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user