public
Created

test file for string interpolation highlighting in coffee-script

  • Download Gist
interp.coffee
CoffeeScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
###
Interpolation test file
###
 
dqs = " Double quotes are
multi-line,
and they can have #{ string_interpolation = "cool" }, and
they need to escape \" but not ', (\' \n should be fine too)
and that's about all. "
meh = "also \ at end of line is fine \
if next isn't a end-of-string"
 
indeed = "\#{ shouldnot = 'trigger string interpolation'"
 
sqs = 'Single quotes are
also multi-line
and they interpret #{ string_interpolations = "literally" } so we
should not highlight them. we need to escape \' but not ", although we can \"
'
 
tdqs = """
triple-double quotes don't need to escape ' or " and
they #{ have = "string interpolations" }. Yessir.
"""
 
tsqs = '''
single quotes are similar in that they don't need to escape ' or ", but
they #{dont = "have string interpolations" }. oh no.'''
 
console.log indeed, dqs, meh, sqs, tdqs, tsqs

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.