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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
""""""
"""Foo\"""bar"""
"""Foo
bar"""
"""#foobar #{foo + 42}"""
""
"Foo\"bar"
"Foo
bar"
"#foo #{ if /test/ == 'test' then 3 else 4}"
----------------------------------------------------
[
["interpolated-string", [["string", "\"\"\"\"\"\""]]],
["interpolated-string", [["string", "\"\"\"Foo\\\"\"\"bar\"\"\""]]],
["interpolated-string", [["string", "\"\"\"Foo\r\nbar\"\"\""]]],
["interpolated-string", [
["string", "\"\"\""],
["variable", "#foobar"],
["string", " "],
["interpolation", [
["interpolation-punctuation", "#{"],
["identifier", "foo"],
["operator", "+"],
["number", "42"],
["interpolation-punctuation", "}"]
]],
["string", "\"\"\""]
]],
["interpolated-string", [["string", "\"\""]]],
["interpolated-string", [["string", "\"Foo\\\"bar\""]]],
["interpolated-string", [["string", "\"Foo\r\nbar\""]]],
["interpolated-string", [
["string", "\""],
["variable", "#foo"],
["string", " "],
["interpolation", [
["interpolation-punctuation", "#{"],
["keyword", "if"],
["regex", "/test/"],
["operator", "=="],
["string", "'test'"],
["keyword", "then"],
["number", "3"],
["keyword", "else"],
["number", "4"],
["interpolation-punctuation", "}"]
]],
["string", "\""]
]]
]
----------------------------------------------------
Checks for interpolated strings.