If you have an unpaired backtick

file = $`
raise unless file == "my_file.rb"

You get the next line treated as a comment string.

It seems to be a pairing problem, based on

file = $`
raise unless file == "my_file.rb"
file2 = $`
raise unless file2 == "my_other_file.rb"

having the last line highlighted correctly.

This is observed in the current version of this answer.

Edit: Correction based on Michael's answer.


It's coloring them like strings, not like comments. There are a couple languages that use backticks to execute shell code, so they have to be paired like '' or ""; probably the syntax highlighter is treating them that way. You get the same behavior with:

file = $'
raise unless file == "my_file.rb"
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged .