Add raw string literals

Also document + test multi line literals.
This commit is contained in:
ruby0x1
2021-04-04 13:52:32 -07:00
parent 345f919e26
commit 981ea4adf1
4 changed files with 156 additions and 1 deletions

View File

@ -3,3 +3,28 @@ System.print("a string") // expect: a string
// Non-ASCII.
System.print("A~¶Þॐஃ") // expect: A~¶Þॐஃ
// Raw strings.
System.print("""A raw string""") // expect: A raw string
var long = "
A
multi line
regular string
"
System.print(long) // expect:
// expect: A
// expect: multi line
// expect: regular string
// expect:
var raw = """
A if*(<invalid>)*
multi line /{}()
raw string [\]/
"json": "value"
"""
System.print(raw) // expect: A if*(<invalid>)*
// expect: multi line /{}()
// expect: raw string [\]/
// expect: "json": "value"

View File

@ -0,0 +1,2 @@
// expect error line 2
"""this string has no close quote