summaryrefslogtreecommitdiffstats
path: root/tests/snippets/scala
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/scala
parentInitial commit. (diff)
downloadpygments-1f403ad2197fc7442409f434ee574f3e6b46fb73.tar.xz
pygments-1f403ad2197fc7442409f434ee574f3e6b46fb73.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/scala')
-rw-r--r--tests/snippets/scala/test_colon_colon_function_name.txt33
-rw-r--r--tests/snippets/scala/test_default_parameter.txt37
-rw-r--r--tests/snippets/scala/test_end_val.txt8
-rw-r--r--tests/snippets/scala/test_end_valx.txt8
-rw-r--r--tests/snippets/scala/test_float_with_exponents.txt12
-rw-r--r--tests/snippets/scala/test_function_operator_name.txt18
-rw-r--r--tests/snippets/scala/test_import_path.txt12
-rw-r--r--tests/snippets/scala/test_invalid_symbol_and_invalid_char.txt8
-rw-r--r--tests/snippets/scala/test_open_soft_keyword.txt12
-rw-r--r--tests/snippets/scala/test_package_name.txt11
-rw-r--r--tests/snippets/scala/test_prepend_operator.txt10
-rw-r--r--tests/snippets/scala/test_qualified_name.txt10
-rw-r--r--tests/snippets/scala/test_qualified_name_class.txt10
-rw-r--r--tests/snippets/scala/test_script_header.txt6
-rw-r--r--tests/snippets/scala/test_symbol_followed_by_op.txt7
-rw-r--r--tests/snippets/scala/test_symbol_name_ending_with_star.txt6
-rw-r--r--tests/snippets/scala/test_underscore_name.txt12
17 files changed, 220 insertions, 0 deletions
diff --git a/tests/snippets/scala/test_colon_colon_function_name.txt b/tests/snippets/scala/test_colon_colon_function_name.txt
new file mode 100644
index 0000000..8840fff
--- /dev/null
+++ b/tests/snippets/scala/test_colon_colon_function_name.txt
@@ -0,0 +1,33 @@
+---input---
+def ::(xs: List[T]): List[T] = ::(x, xs)
+
+---tokens---
+'def' Keyword
+' ' Text.Whitespace
+'::' Name.Function
+'(' Punctuation
+'xs' Name
+':' Punctuation
+' ' Text.Whitespace
+'List' Name.Class
+'[' Punctuation
+'T' Name.Class
+']' Punctuation
+')' Punctuation
+':' Punctuation
+' ' Text.Whitespace
+'List' Name.Class
+'[' Punctuation
+'T' Name.Class
+']' Punctuation
+' ' Text.Whitespace
+'=' Operator
+' ' Text.Whitespace
+'::' Name
+'(' Punctuation
+'x' Name
+',' Punctuation
+' ' Text.Whitespace
+'xs' Name
+')' Punctuation
+'\n' Text.Whitespace
diff --git a/tests/snippets/scala/test_default_parameter.txt b/tests/snippets/scala/test_default_parameter.txt
new file mode 100644
index 0000000..16ce948
--- /dev/null
+++ b/tests/snippets/scala/test_default_parameter.txt
@@ -0,0 +1,37 @@
+---input---
+def f(using y: Char = if true then 'a' else 2): Int = ???
+
+---tokens---
+'def' Keyword
+' ' Text.Whitespace
+'f' Name.Function
+'(' Punctuation
+'using' Keyword
+' ' Text.Whitespace
+'y' Name
+':' Punctuation
+' ' Text.Whitespace
+'Char' Name.Class
+' ' Text.Whitespace
+'=' Operator
+' ' Text.Whitespace
+'if' Keyword
+' ' Text.Whitespace
+'true' Keyword.Constant
+' ' Text.Whitespace
+'then' Keyword
+' ' Text.Whitespace
+"'a'" Literal.String.Char
+' ' Text.Whitespace
+'else' Keyword
+' ' Text.Whitespace
+'2' Literal.Number.Integer
+')' Punctuation
+':' Punctuation
+' ' Text.Whitespace
+'Int' Name.Class
+' ' Text.Whitespace
+'=' Operator
+' ' Text.Whitespace
+'???' Operator
+'\n' Text.Whitespace
diff --git a/tests/snippets/scala/test_end_val.txt b/tests/snippets/scala/test_end_val.txt
new file mode 100644
index 0000000..43ac172
--- /dev/null
+++ b/tests/snippets/scala/test_end_val.txt
@@ -0,0 +1,8 @@
+---input---
+end val
+
+---tokens---
+'end' Keyword
+' ' Text.Whitespace
+'val' Keyword
+'\n' Text.Whitespace
diff --git a/tests/snippets/scala/test_end_valx.txt b/tests/snippets/scala/test_end_valx.txt
new file mode 100644
index 0000000..e1d17d7
--- /dev/null
+++ b/tests/snippets/scala/test_end_valx.txt
@@ -0,0 +1,8 @@
+---input---
+end valx
+
+---tokens---
+'end' Keyword
+' ' Text.Whitespace
+'valx' Name.Namespace
+'\n' Text.Whitespace
diff --git a/tests/snippets/scala/test_float_with_exponents.txt b/tests/snippets/scala/test_float_with_exponents.txt
new file mode 100644
index 0000000..d64ee63
--- /dev/null
+++ b/tests/snippets/scala/test_float_with_exponents.txt
@@ -0,0 +1,12 @@
+---input---
+.1e12 .1e+34 .1e-56 .1e12f
+
+---tokens---
+'.1e12' Literal.Number.Float
+' ' Text.Whitespace
+'.1e+34' Literal.Number.Float
+' ' Text.Whitespace
+'.1e-56' Literal.Number.Float
+' ' Text.Whitespace
+'.1e12f' Literal.Number.Float
+'\n' Text.Whitespace
diff --git a/tests/snippets/scala/test_function_operator_name.txt b/tests/snippets/scala/test_function_operator_name.txt
new file mode 100644
index 0000000..72c375d
--- /dev/null
+++ b/tests/snippets/scala/test_function_operator_name.txt
@@ -0,0 +1,18 @@
+---input---
+def < (y: String): Boolean
+
+---tokens---
+'def' Keyword
+' ' Text.Whitespace
+'<' Name.Function
+' ' Text.Whitespace
+'(' Punctuation
+'y' Name
+':' Punctuation
+' ' Text.Whitespace
+'String' Name.Class
+')' Punctuation
+':' Punctuation
+' ' Text.Whitespace
+'Boolean' Name.Class
+'\n' Text.Whitespace
diff --git a/tests/snippets/scala/test_import_path.txt b/tests/snippets/scala/test_import_path.txt
new file mode 100644
index 0000000..1c316a0
--- /dev/null
+++ b/tests/snippets/scala/test_import_path.txt
@@ -0,0 +1,12 @@
+---input---
+import a.b.c
+
+---tokens---
+'import' Keyword
+' ' Text.Whitespace
+'a' Name.Namespace
+'.' Punctuation
+'b' Name.Namespace
+'.' Punctuation
+'c' Name
+'\n' Text.Whitespace
diff --git a/tests/snippets/scala/test_invalid_symbol_and_invalid_char.txt b/tests/snippets/scala/test_invalid_symbol_and_invalid_char.txt
new file mode 100644
index 0000000..ccaae59
--- /dev/null
+++ b/tests/snippets/scala/test_invalid_symbol_and_invalid_char.txt
@@ -0,0 +1,8 @@
+---input---
+'1 //'
+
+---tokens---
+"'" Error
+'1' Literal.Number.Integer
+' ' Text.Whitespace
+"//'\n" Comment.Single
diff --git a/tests/snippets/scala/test_open_soft_keyword.txt b/tests/snippets/scala/test_open_soft_keyword.txt
new file mode 100644
index 0000000..903be71
--- /dev/null
+++ b/tests/snippets/scala/test_open_soft_keyword.txt
@@ -0,0 +1,12 @@
+---input---
+val open = true
+
+---tokens---
+'val' Keyword.Declaration
+' ' Text.Whitespace
+'open' Name
+' ' Text.Whitespace
+'=' Operator
+' ' Text.Whitespace
+'true' Keyword.Constant
+'\n' Text.Whitespace
diff --git a/tests/snippets/scala/test_package_name.txt b/tests/snippets/scala/test_package_name.txt
new file mode 100644
index 0000000..53633e2
--- /dev/null
+++ b/tests/snippets/scala/test_package_name.txt
@@ -0,0 +1,11 @@
+---input---
+package p1.p2:
+
+---tokens---
+'package' Keyword
+' ' Text.Whitespace
+'p1' Name.Namespace
+'.' Punctuation
+'p2' Name
+':' Punctuation
+'\n' Text.Whitespace
diff --git a/tests/snippets/scala/test_prepend_operator.txt b/tests/snippets/scala/test_prepend_operator.txt
new file mode 100644
index 0000000..cf7b2f9
--- /dev/null
+++ b/tests/snippets/scala/test_prepend_operator.txt
@@ -0,0 +1,10 @@
+---input---
+a +: b
+
+---tokens---
+'a' Name
+' ' Text.Whitespace
+'+:' Operator
+' ' Text.Whitespace
+'b' Name
+'\n' Text.Whitespace
diff --git a/tests/snippets/scala/test_qualified_name.txt b/tests/snippets/scala/test_qualified_name.txt
new file mode 100644
index 0000000..a004410
--- /dev/null
+++ b/tests/snippets/scala/test_qualified_name.txt
@@ -0,0 +1,10 @@
+---input---
+a.b.c
+
+---tokens---
+'a' Name
+'.' Punctuation
+'b' Name
+'.' Punctuation
+'c' Name
+'\n' Text.Whitespace
diff --git a/tests/snippets/scala/test_qualified_name_class.txt b/tests/snippets/scala/test_qualified_name_class.txt
new file mode 100644
index 0000000..7345092
--- /dev/null
+++ b/tests/snippets/scala/test_qualified_name_class.txt
@@ -0,0 +1,10 @@
+---input---
+a.b.C
+
+---tokens---
+'a' Name
+'.' Punctuation
+'b' Name
+'.' Punctuation
+'C' Name.Class
+'\n' Text.Whitespace
diff --git a/tests/snippets/scala/test_script_header.txt b/tests/snippets/scala/test_script_header.txt
new file mode 100644
index 0000000..6d96fd6
--- /dev/null
+++ b/tests/snippets/scala/test_script_header.txt
@@ -0,0 +1,6 @@
+---input---
+#!/usr/bin/scala
+
+---tokens---
+'#!/usr/bin/scala' Comment.Hashbang
+'\n' Text.Whitespace
diff --git a/tests/snippets/scala/test_symbol_followed_by_op.txt b/tests/snippets/scala/test_symbol_followed_by_op.txt
new file mode 100644
index 0000000..518abce
--- /dev/null
+++ b/tests/snippets/scala/test_symbol_followed_by_op.txt
@@ -0,0 +1,7 @@
+---input---
+symbol*
+
+---tokens---
+'symbol' Name
+'*' Operator
+'\n' Text.Whitespace
diff --git a/tests/snippets/scala/test_symbol_name_ending_with_star.txt b/tests/snippets/scala/test_symbol_name_ending_with_star.txt
new file mode 100644
index 0000000..25e5dc6
--- /dev/null
+++ b/tests/snippets/scala/test_symbol_name_ending_with_star.txt
@@ -0,0 +1,6 @@
+---input---
+symbol_*
+
+---tokens---
+'symbol_*' Name
+'\n' Text.Whitespace
diff --git a/tests/snippets/scala/test_underscore_name.txt b/tests/snippets/scala/test_underscore_name.txt
new file mode 100644
index 0000000..f7a24af
--- /dev/null
+++ b/tests/snippets/scala/test_underscore_name.txt
@@ -0,0 +1,12 @@
+---input---
+val head = _head
+
+---tokens---
+'val' Keyword.Declaration
+' ' Text.Whitespace
+'head' Name
+' ' Text.Whitespace
+'=' Operator
+' ' Text.Whitespace
+'_head' Name
+'\n' Text.Whitespace