You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New: String literals now support proper escaping(BC break).
You can now "escape an escape sequence" (e.g a \n newline) using a double backslash (e.g. \\n) to avoid escaping. (BC break)
Previously, string literal "\\n" would result in a string of new-line preceeded by a backslash \ symbol. Now "\\n" results in literal \n.
Also, escape sequences were previously expanded when instantiating String value objects - even, for example, when it was the result of concatenating two strings "\" and "n", which would then result in new string equal to "\n", which would be then expanded to a literal newline, which is just wrong approach.
With the new approach escape sequences are expanded only at the time of the evaluating string literals in Primi source code. It is merely a way of how string literals are interpreted.
Example:
As of now, concatenating "\" + "n" will result in string "\n" being a literal backslash \ followed by a literal letter n. (BC break)
A string literal "\n"is still expanded to a newline symbol (i.e. line feed or decimal ASCII 10).
Currently supported escape sequences are these:
\n: Will result in a newline.
\t: Will result in TAB character.
\\: Will result in a single backslash \.
\": Will result in " in both single and double quoted string literals,
\': Will result in ' in both single and double quoted string literals,
**All other characters with a single backslash in front of them, for example \m, will result in an Unrecognized string escape sequence '\m' error. (BC break)