Test: check to see if quotations are tokenized

This commit is contained in:
GreasySlug 2022-09-21 13:49:04 +09:00
parent 77e5e0422f
commit baf7b3eb38
2 changed files with 36 additions and 1 deletions

View file

@ -27,3 +27,14 @@ complex_string = """\\\
\r\n\
\\"""
print! complex_string
quotation_mark = """\"\"\""""
print! quotation_mark
quotation_marks = """"
""
""\"
\"\"\"""
\"\""
\"\"\""""
print! quotation_marks

View file

@ -367,6 +367,30 @@ line break\"\"\"",
(Newline, newline),
(Symbol, "print!"),
(Symbol, "complex_string"),
(Newline, newline),
(Newline, newline),
(Symbol, "quotation_mark"),
(Equal, "="),
(StrLit, "\"\"\"\"\"\"\"\"\""),
(Newline, newline),
(Symbol, "print!"),
(Symbol, "quotation_mark"),
(Newline, newline),
(Newline, newline),
(Symbol, "quotation_marks"),
(Equal, "="),
(
StrLit,
"\"\"\"\"
\"\"
\"\"\"
\"\"\"\"\"
\"\"\"
\"\"\"\"\"\"",
),
(Newline, newline),
(Symbol, "print!"),
(Symbol, "quotation_marks"),
(EOF, ""),
];
let mut tok: Token;