moonsharp
moonsharp copied to clipboard
To meet module naming convention
This patch is aimed at fixing an error with embedded module names containing hyphens. Visual Studio converts the hyphen into an underscore, however the Moonsharp library does not replace the hyphen with an underscore, this prevents an embedded LUA script from being loaded.
According to Microsoft documentation (see http://stackoverflow.com/questions/14705211/how-is-net-renaming-my-embedded-resources) module names may not include hyphens and should be replaced by an underscores.
Given the documentation:
"VerifyResourceName method compares each character in the string to a set of invalid tokens based on the language specified by the provider parameter. Any invalid character in the string is replaced with an underscore character. The characters that will be replaced with an underscore are as follows:
' ' (space), U+00A0 (non-breaking space), '.' (period), ',' (comma), ';' (semicolon), '|', '~', '@', '#', '%', '^', '&', '*', '+', '-', '/', '', '<', '>', '?', '[', ']', '(', ')', '{', '}', '"' (quote), ''' (apostrophe), ':', and '!'."
Should we not look at extending this to cover those scenarios? RIght now it seems like a bit of a simplistic patch to handle the single use case.
I have since changed companies, and no longer am doing any development in LUA (although that may change again in the future).
It would make sense to extend the fix to cover the other scenarios, but I currently don't have resources to look at them.