CS-Notes/docs/_style/prism-master/tests/languages/livescript/interpolated-string.test

57 lines
1.4 KiB
Plaintext
Raw Normal View History

2018-12-19 14:09:39 +08:00
""""""
"""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.