summaryrefslogtreecommitdiffstats
path: root/tests/snippets/crystal/test_macro.txt
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 11:33:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 11:33:32 +0000
commit1f403ad2197fc7442409f434ee574f3e6b46fb73 (patch)
tree0299c6dd11d5edfa918a29b6456bc1875f1d288c /tests/snippets/crystal/test_macro.txt
parentInitial commit. (diff)
downloadpygments-upstream.tar.xz
pygments-upstream.zip
Adding upstream version 2.14.0+dfsg.upstream/2.14.0+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/snippets/crystal/test_macro.txt')
-rw-r--r--tests/snippets/crystal/test_macro.txt76
1 files changed, 76 insertions, 0 deletions
diff --git a/tests/snippets/crystal/test_macro.txt b/tests/snippets/crystal/test_macro.txt
new file mode 100644
index 0000000..765caa2
--- /dev/null
+++ b/tests/snippets/crystal/test_macro.txt
@@ -0,0 +1,76 @@
+---input---
+def<=>(other : self) : Int
+{%for field in %w(first_name middle_name last_name)%}
+cmp={{field.id}}<=>other.{{field.id}}
+return cmp if cmp!=0
+{%end%}
+0
+end
+
+---tokens---
+'def' Keyword
+'<=>' Name.Function
+'(' Punctuation
+'other' Name
+' ' Text.Whitespace
+':' Punctuation
+' ' Text.Whitespace
+'self' Keyword
+')' Punctuation
+' ' Text.Whitespace
+':' Punctuation
+' ' Text.Whitespace
+'Int' Name
+'\n' Text.Whitespace
+
+'{%' Literal.String.Interpol
+'for' Keyword
+' ' Text.Whitespace
+'field' Name
+' ' Text.Whitespace
+'in' Keyword
+' ' Text.Whitespace
+'%w(' Literal.String.Other
+'first_name middle_name last_name' Literal.String.Other
+')' Literal.String.Other
+'%}' Literal.String.Interpol
+'\n' Text.Whitespace
+
+'cmp' Name
+'=' Operator
+'{{' Literal.String.Interpol
+'field' Name
+'.' Operator
+'id' Name
+'}}' Literal.String.Interpol
+'<=>' Operator
+'other' Name
+'.' Operator
+'{{' Literal.String.Interpol
+'field' Name
+'.' Operator
+'id' Name
+'}}' Literal.String.Interpol
+'\n' Text.Whitespace
+
+'return' Keyword
+' ' Text.Whitespace
+'cmp' Name
+' ' Text.Whitespace
+'if' Keyword
+' ' Text.Whitespace
+'cmp' Name
+'!=' Operator
+'0' Literal.Number.Integer
+'\n' Text.Whitespace
+
+'{%' Literal.String.Interpol
+'end' Keyword
+'%}' Literal.String.Interpol
+'\n' Text.Whitespace
+
+'0' Literal.Number.Integer
+'\n' Text.Whitespace
+
+'end' Keyword
+'\n' Text.Whitespace