summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarc Auberer <marc.auberer@sap.com>2022-09-13 23:23:42 +0200
committerGitHub <noreply@github.com>2022-09-13 23:23:42 +0200
commitca56bf26961a04e53c7691f4f15a1ffe1d222fec (patch)
tree55bbe4e3c01672d901390c7cf34c50656f93f39b /tests
parente94cb7eeaabaf8cccffabf3e431e284561139f04 (diff)
downloadpygments-git-ca56bf26961a04e53c7691f4f15a1ffe1d222fec.tar.gz
[Spice] Add new keywords and fix bugs (#2227)
* Cleanup * Add scope access operator * Add enum keyword * Update test ref * Fix bug for tokenizing number formats * Add pr to CHANGES
Diffstat (limited to 'tests')
-rw-r--r--tests/examplefiles/spice/example.spice16
-rw-r--r--tests/examplefiles/spice/example.spice.output93
2 files changed, 109 insertions, 0 deletions
diff --git a/tests/examplefiles/spice/example.spice b/tests/examplefiles/spice/example.spice
index 699efdf2..55d87753 100644
--- a/tests/examplefiles/spice/example.spice
+++ b/tests/examplefiles/spice/example.spice
@@ -1,3 +1,19 @@
+const int test 0x123;
+
+type BloodType enum {
+ A,
+ B = 3,
+ AB,
+ ZERO = 0
+}
+
+type Person struct {
+ string firstName
+ string lastName
+ unsigned int age
+ BloodType bloodType
+}
+
// Function to compute fibonacci numbers recursively
f<int> fib(int n) {
if n <= 2 {
diff --git a/tests/examplefiles/spice/example.spice.output b/tests/examplefiles/spice/example.spice.output
index 3d75ef94..9746813d 100644
--- a/tests/examplefiles/spice/example.spice.output
+++ b/tests/examplefiles/spice/example.spice.output
@@ -1,3 +1,96 @@
+'const' Keyword.Pseudo
+' ' Text.Whitespace
+'int' Keyword.Type
+' ' Text.Whitespace
+'test' Name.Other
+' ' Text.Whitespace
+'0x123' Literal.Number.Hex
+';' Punctuation
+'\n' Text.Whitespace
+
+'\n' Text.Whitespace
+
+'type' Keyword.Declaration
+' ' Text.Whitespace
+'BloodType' Name.Other
+' ' Text.Whitespace
+'enum' Keyword.Declaration
+' ' Text.Whitespace
+'{' Punctuation
+'\n' Text.Whitespace
+
+' ' Text.Whitespace
+'A' Name.Other
+',' Punctuation
+'\n' Text.Whitespace
+
+' ' Text.Whitespace
+'B' Name.Other
+' ' Text.Whitespace
+'=' Punctuation
+' ' Text.Whitespace
+'3' Literal.Number.Integer
+',' Punctuation
+'\n' Text.Whitespace
+
+' ' Text.Whitespace
+'AB' Name.Other
+',' Punctuation
+'\n' Text.Whitespace
+
+' ' Text.Whitespace
+'ZERO' Name.Other
+' ' Text.Whitespace
+'=' Punctuation
+' ' Text.Whitespace
+'0' Literal.Number.Integer
+'\n' Text.Whitespace
+
+'}' Punctuation
+'\n' Text.Whitespace
+
+'\n' Text.Whitespace
+
+'type' Keyword.Declaration
+' ' Text.Whitespace
+'Person' Name.Other
+' ' Text.Whitespace
+'struct' Keyword.Declaration
+' ' Text.Whitespace
+'{' Punctuation
+'\n' Text.Whitespace
+
+' ' Text.Whitespace
+'string' Keyword.Type
+' ' Text.Whitespace
+'firstName' Name.Other
+'\n' Text.Whitespace
+
+' ' Text.Whitespace
+'string' Keyword.Type
+' ' Text.Whitespace
+'lastName' Name.Other
+'\n' Text.Whitespace
+
+' ' Text.Whitespace
+'unsigned' Keyword.Pseudo
+' ' Text.Whitespace
+'int' Keyword.Type
+' ' Text.Whitespace
+'age' Name.Other
+'\n' Text.Whitespace
+
+' ' Text.Whitespace
+'BloodType' Name.Other
+' ' Text.Whitespace
+'bloodType' Name.Other
+'\n' Text.Whitespace
+
+'}' Punctuation
+'\n' Text.Whitespace
+
+'\n' Text.Whitespace
+
'// Function to compute fibonacci numbers recursively\n' Comment.Single
'f' Keyword.Declaration