![]() Allows for reserved keywords to be used as argument labels / parameters in mocked types. Fixes: https://github.com/Brightify/Cuckoo/issues/452 - Moves escaping util function to Utils and makes it internal since it now needs to be used outside of `Generator`. - Uses escaping function in areas affected by the bug. - Renames set of reserved names to reflect the larger scope (no longer used for just function names). - Some minor clean-up to style and formatting on areas touched. Example of the problem: Generate a mock for a protocol with the function: ``` func escape(for: String) -> String ``` This would result in `for` as a function parameter used within the body of the function for the mock and verification and stubbing proxies, which would not compile. This change escapes keywords like this so the generated code will compile. See `TestedProtocol.withReservedKeywords` for a test example. An example was added to `TestedClass` as well, but the real motivation for this is protocols since conforming types can and often do use a different parameter name so the argument label like `for` would never be used within the body of the function. |
||
---|---|---|
.. | ||
Derived/InfoPlists | ||
Source | ||
bin | ||
Project.swift |