Skip to content

Commit a36f2b3

Browse files
committed
Add test for {interpolation} after two double quotes
This is an edge case of how the lexer changes behavior when reading string literals versus reading unquoted source code. Three double quotes would begin a multi-line string literal, but just two are still ambiguous, so it has to `peek()` to see whether it's inside a multi-line string literal or outside an empty regular string.
1 parent cd4be6a commit a36f2b3

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def hello = $11
2+
def goodbye = $22
3+
4+
def greeting equs "hello"
5+
println ""{greeting}
6+
7+
def string equs "\"goodbye\""
8+
println ""{goodbye}""
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: interpolation-after-string.asm(5):
2+
Unknown character '{'
3+
error: interpolation-after-string.asm(5):
4+
syntax error, unexpected symbol
5+
while expanding symbol "greeting"
6+
error: interpolation-after-string.asm(5):
7+
Unknown character '}'
8+
error: interpolation-after-string.asm(8):
9+
Unknown character '{'
10+
error: interpolation-after-string.asm(8):
11+
syntax error, unexpected symbol
12+
error: interpolation-after-string.asm(8):
13+
Unknown character '}'
14+
Assembly aborted with 6 errors!

0 commit comments

Comments
 (0)