summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRichard van Velzen <richard@goreply.com>2023-03-01 00:07:24 +0100
committerGitHub <noreply@github.com>2023-03-01 00:07:24 +0100
commit80357823f6252a8b99c05bbd5338cf3be80bd052 (patch)
tree139b5d1ed3b52ce0519ce9cd21ae992c7f31264f /tests
parent875b85895fa5ab2094434796379288cd73ef0274 (diff)
downloadpygments-git-80357823f6252a8b99c05bbd5338cf3be80bd052.tar.gz
Improve lexing PHP's variable variable syntax (#2358)
Diffstat (limited to 'tests')
-rw-r--r--tests/snippets/php/variable_variable.txt45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/snippets/php/variable_variable.txt b/tests/snippets/php/variable_variable.txt
new file mode 100644
index 00000000..6ad748ca
--- /dev/null
+++ b/tests/snippets/php/variable_variable.txt
@@ -0,0 +1,45 @@
+---input---
+<?php
+${'whatever'} = '';
+${$whatever} = '';
+${${'whatever' . 'whatever'}} = '';
+
+---tokens---
+'<?php' Comment.Preproc
+'\n' Text
+
+'${' Name.Variable
+"'whatever'" Literal.String.Single
+'}' Name.Variable
+' ' Text
+'=' Operator
+' ' Text
+"''" Literal.String.Single
+';' Punctuation
+'\n' Text
+
+'${' Name.Variable
+'$whatever' Name.Variable
+'}' Name.Variable
+' ' Text
+'=' Operator
+' ' Text
+"''" Literal.String.Single
+';' Punctuation
+'\n' Text
+
+'${' Name.Variable
+'${' Name.Variable
+"'whatever'" Literal.String.Single
+' ' Text
+'.' Operator
+' ' Text
+"'whatever'" Literal.String.Single
+'}' Name.Variable
+'}' Name.Variable
+' ' Text
+'=' Operator
+' ' Text
+"''" Literal.String.Single
+';' Punctuation
+'\n' Text