diff --git a/lib/cmock_header_parser.rb b/lib/cmock_header_parser.rb index 864e4c7..4ae8492 100644 --- a/lib/cmock_header_parser.rb +++ b/lib/cmock_header_parser.rb @@ -79,7 +79,7 @@ class CMockHeaderParser source.gsub!(/^[\w\s]*(enum|union|struct|typepdef)[\w\s]*\{[^\}]+\}[\w\s\*\,]*;/m, '') # remove struct, union, and enum definitions and typedefs with braces 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.*/, '') # remove typedef statements + source.gsub!(/^(?:[\w\s]*\W)?typedef\W[^;]*/m, '') # remove typedef statements 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 diff --git a/test/unit/cmock_header_parser_test.rb b/test/unit/cmock_header_parser_test.rb index 509546a..22daeab 100644 --- a/test/unit/cmock_header_parser_test.rb +++ b/test/unit/cmock_header_parser_test.rb @@ -165,7 +165,7 @@ class CMockHeaderParserTest < Test::Unit::TestCase "const typedef int INT;\n" + "int notatypedef;\n" + "int typedef_isnt_me;\n" + - " typedef who cares what really comes here \\\n" + # exercise multiline typedef + " typedef who cares what really comes here \n" + # exercise multiline typedef " continuation;\n" + "this should remain!;\n" + "typedef blah bleh;\n" +