New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiline comments broken if contain code with ###
#4897
Comments
This is to be expected. JavaScript works the same way: /*
console.log('*/ oh no, I’m no longer in the comment!')
*/ Comments are like strings, treated as random characters until the next delimiter is encountered. |
i was under the impression that coffee took care of this by requiring the opening and closing tag to share the same indentation level. i remember getting indentation errors when commenting out code parts without matching them in my early days with coffee. |
@Inve1951 Comments were refactored between 1 and 2, to allow block ( However I don’t seem to be able to replicate the “same indentation” requirement you describe. At least in 1.12.7, open and closing |
Yeah, that’s to be expected. In v1 block comments could only exist where expressions could, like where you could put a parenthesized block, whereas in v2 they can now exist anywhere. |
OP's issue is quite the edge case, indeed. however i feel like there could be a clean solution to it. for example escaping the first hashtag with a backslash. ###
console.log '\##\# this should be ignored, not compiled'
console.log '\##\# this too'
console.log '\##\##\##\# and this'
### edit: just noticed that you can't open block comments inside string literals. so OP's code compiles fine unless commented out. |
I think the most reasonable solution is to just use an editor that allows commenting out long selections of text. Almost any editor I’ve used, whether a simple text editor or an IDE, allows you to select multiple lines of text and press Cmd-/ or Ctrl-/ to insert |
neat, learned something new |
Using latest master: 571e9df
The text was updated successfully, but these errors were encountered: