Merge pull request #359 from lukzeg/feature/358_cmock_speed_up_generation

Switch places in the extern C regex to speed up mock generation
This commit is contained in:
Mark VanderVoord
2023-01-05 15:53:48 -05:00
committed by GitHub
+1 -1
View File
@@ -245,8 +245,8 @@ class CMockHeaderParser
source.gsub!(/__attribute(?:__)?\s*\(\(+.*\)\)+/, '')
# remove preprocessor statements and extern "C"
source.gsub!(/^\s*#.*/, '')
source.gsub!(/extern\s+\"C\"\s*\{/, '')
source.gsub!(/^\s*#.*/, '')
# enums, unions, structs, and typedefs can all contain things (e.g. function pointers) that parse like function prototypes, so yank them
# forward declared structs are removed before struct definitions so they don't mess up real thing later. we leave structs keywords in function prototypes