1
0
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:
Greg Williams
2015-03-12 10:33:23 -04:00
parent 28d05e4f33
commit a24bd45511
3 changed files with 15 additions and 4 deletions

8
auto/type_sanitizer.rb Normal file
View 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