Closed zachcran closed 2 years ago
So far, this PR handles ;$"\
characters. In creating it, I found that the following characters do not need to be escaped in a string: (){}#'@^/
, and I made a test verifying each one. Of the handled characters (;$"\
), only one backslash (\
) is needed in the string, except for escaping backslashes themselves and escaping the dollar sign at the beginning of a variable dereference. Both of these situations need three backslashes before the character to escape properly. For example, This is a backslash: \\\\
will result in "This is a backslash: \", and This dereferences a variable, var: \\\${var}
will result in "This dereferences a variable, var: ${var}".
@ryanmrichard Do you know of other special characters that we should support? I couldn't find a comprehensive list anywhere.
@zachcran those are the only special characters that I can think of (and I too can't find a list)
I almost forgot the integration tests. I will try incorporating this branch into CMaize and running those tests, as well as building some projects using CMaize with this branch.
Fixes #46, where escaped special characters were being deprotected as they passed through the various function calls made during the execution of an object method call. The solution to be implemented is to protect the special characters as soon as they are passed into the object method call as benign, untype-able (or at least not easily typed) ASCII characters, like ASCII character 7, the BEL character. Then, they will be decoded again immediately before execution.
Steps to complete this PR: