Open BlobCodes opened 1 year ago
Should multi-line symbols be allowed by the compiler? They would be very inconvenient to use.
I think they could be useful for macros.
The idea of quoted symbol identifiers is to allow almost any character as part of the symbol name. If that really needs to include LF and I don't know what kind of control characters...? 🤷 But technically it's not a big issue, there's just a minor bug in the symbol parsing logic which doesn't count the lines. So while the use case is questionable it's probably easiest to just fix this bug and allow the usage of LF in quoted symbol identifiers. There's no real harm from this.
The same issue also applies to char literals.
'
'
puts __LINE__ #=> 2
LF should probably be forbidden inside char literals (it also doesn't compile with CRLF).
it also doesn't compile with CRLF
That's because CRLF are two characters and a char literal contains exactly one character.
Bug Report
When using symbols which span accross multiple lines, the line counter is not increased.
For example this code:
It prints
2
to the terminal, while it is actually on line 10.