Merge pull request #19 from lgreve/remove_multi_line_typedefs

Fix removal of multi-line typedefs (Thanks Lucas!)
This commit is contained in:
Mark VanderVoord
2014-02-24 09:00:50 -05:00
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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" +