Standardize parsing of symbol and string array literals
Previously, string array literal parsing used a custom implementation, combined with a custom lexer mode (next_string_array_token).
This patch changes that to reuse the same parser and lexer features as other string literals. This standardization removes an extra concept and thus reduces code surface area. In return, we're adding some conditionals for this specific literal type into the standard implementations. This increases complexity a little bit, but it's still fairly easy to reason about and a common pattern in the parser.
Combining the parsing of all string-related literals clearly shows their differences (in the form of such conditionals) and ensures consistent behaviour.
In particular, this change establishes standard behaviour for escape characters, and thus fixes https://github.com/crystal-lang/crystal/issues/12277
However, it's unclear whether we accept this behaviour change (see https://github.com/crystal-lang/crystal/issues/12277#issuecomment-4040648416). If not, we need to implement a non-standard escape algorithm to ensure backwards-compatibility.
The main motivation for this refactor is that it opens the path for implementing string literals with interpolation (RFC 0021).
- Drops
Lexer#next_string_array_token. It's replaced byLexer#next_string_token
Resolves #12277