Closed uncomputable closed 2 days ago
The issue isn't greediness vs non-greediness, it's that to implement nested comments you need to explicitly keep track of the nesting depth. (If you just used a non-greedy parser, it'd treat everything from the start of the first comment to the end of the last comment as "commented out" :))
But agreed, this is easy to implement and a big improvement to ergonomics, so we should support it.
I'm closing this issue because Rust has the same issue. The above program is invalid Rust. We have line comments now, which can be "nested" in each other.
Rust has nested comments.
Either I cannot trust my IDE or I'm just tired: First I see a syntax error for nested comments. How I everything compiles.
Anyway, I'm closing nested comments as out of scope :) We can look into this again when we replace the parser.
Sounds good!
Block comments cannot be nested, presumably because the parser is greedy.
The following program does not compile: