2

This question already has an answer here:

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.

marked as duplicate by ben is uǝq backwards, Rory, Mat, Hugo Dozois, animuson Jun 15 '13 at 18:49

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

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"

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