savi
savi copied to clipboard
Extension points for string literals
We currently have "normal" string literals (no prefix) and "byte string" literals (b prefix), but we have no extension points for allowing users to add their own prefixes, as Elixir does.
We likely want to add this at some point, but at this time I don't consider it essential for Savi v1.0.0.
also see C++ 11's user-defined literals: https://en.cppreference.com/w/cpp/language/user_literal which not only applies to strings, but also numerical literals. I have no clear opinion whether it's worth having such support... though 12_km reads better than Km(12)...
String literals of other types should support having different escape sequences.
For example, a Regex literal (defined by the Regex package, outside the core language) should be able to have escape sequences like \d or \w in it. Currently, we need to type these as \\d or \\w because the Savi compiler now disallows unknown escape sequences (as of #353).