mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-23 00:15:58 +01:00
Added type_sanitizer.rb to consolidate converting a string to a valid C identifier, which will allow CMock and Ceedling to use the same construct which is currently duplicated in each repo.
This commit is contained in:
8
auto/type_sanitizer.rb
Normal file
8
auto/type_sanitizer.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
module TypeSanitizer
|
||||
|
||||
def self.sanitize_c_identifier(unsanitized)
|
||||
# convert filename to valid C identifier by replacing invalid chars with '_'
|
||||
return unsanitized.gsub(/[-\/\\\.\,\s]/, "_")
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user