summaryrefslogtreecommitdiff
path: root/tests/examplefiles/savi
diff options
context:
space:
mode:
authorJoe Eli McIlvain <joe.eli.mac@gmail.com>2022-04-03 12:31:49 -0700
committerJean Abou-Samra <jean@abou-samra.fr>2022-04-04 12:53:27 +0200
commitd7fda4e60b477e6e4c9560d001d5d71ce1562ab7 (patch)
tree680b086ccf05bbdcd0f9bcc952d311879c50023a /tests/examplefiles/savi
parent5313208d26351809af98545034ed54054d8784fb (diff)
downloadpygments-git-d7fda4e60b477e6e4c9560d001d5d71ce1562ab7.tar.gz
Add string interpolation to the Savi lexer.
Now the Savi lexer can tokenize string interpolation inside strings, which is a new feature added to Savi since the last time this lexer was updated.
Diffstat (limited to 'tests/examplefiles/savi')
-rw-r--r--tests/examplefiles/savi/example.savi3
-rw-r--r--tests/examplefiles/savi/example.savi.output25
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/examplefiles/savi/example.savi b/tests/examplefiles/savi/example.savi
index 5a927b70..e4945506 100644
--- a/tests/examplefiles/savi/example.savi
+++ b/tests/examplefiles/savi/example.savi
@@ -24,3 +24,6 @@
assert error: add_overflow!(U64.max_value, 1)
assert no_error: add_overflow!(U64.max_value, 0)
assert no_error: add_overflow!(integers[0]!, 1)
+
+ // Print a bit of extra information using string interpolation.
+ @env.out.print("The first integer is \(integers[0]!)")
diff --git a/tests/examplefiles/savi/example.savi.output b/tests/examplefiles/savi/example.savi.output
index b10eea36..109a7a2c 100644
--- a/tests/examplefiles/savi/example.savi.output
+++ b/tests/examplefiles/savi/example.savi.output
@@ -227,4 +227,29 @@
' ' Text.Whitespace
'1' Literal.Number
')' Punctuation
+'\n\n' Text.Whitespace
+
+' ' Text.Whitespace
+'// Print a bit of extra information using string interpolation.' Comment.Single
+'\n' Text.Whitespace
+
+' ' Text.Whitespace
+'@' Punctuation
+'env' Name.Function
+'.' Punctuation
+'out' Name.Function
+'.' Punctuation
+'print' Name.Function
+'(' Punctuation
+'"' Literal.String.Double
+'The first integer is ' Literal.String.Double
+'\\(' Literal.String.Interpol
+'integers' Name
+'[' Punctuation
+'0' Literal.Number
+']' Punctuation
+'!' Generic.Deleted
+')' Literal.String.Interpol
+'"' Literal.String.Double
+')' Punctuation
'\n' Text.Whitespace