diff options
| author | Gustavo A. Hoffmann <gusthoff@users.noreply.github.com> | 2022-04-29 16:26:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-29 16:26:15 +0200 |
| commit | 0ac8a20677442eb08e56ac0e27aa3758350756f1 (patch) | |
| tree | 9e5483b3cdb199a3b80fa4c5c38b57caecaefe3a /tests/examplefiles | |
| parent | 0c946ef78041c4999a3d5db38ba6d720efa025b1 (diff) | |
| download | pygments-git-0ac8a20677442eb08e56ac0e27aa3758350756f1.tar.gz | |
Ada 2022: introducing support for new syntactic additions (#2121)
* Ada 2022: adding support for at sign
* Ada 2022: adding support for square brackets
* Ada 2022: introducing test for new syntactic additions
Diffstat (limited to 'tests/examplefiles')
| -rw-r--r-- | tests/examplefiles/ada/test_ada2022.adb | 27 | ||||
| -rw-r--r-- | tests/examplefiles/ada/test_ada2022.adb.output | 186 |
2 files changed, 213 insertions, 0 deletions
diff --git a/tests/examplefiles/ada/test_ada2022.adb b/tests/examplefiles/ada/test_ada2022.adb new file mode 100644 index 00000000..033c219b --- /dev/null +++ b/tests/examplefiles/ada/test_ada2022.adb @@ -0,0 +1,27 @@ +with Ada.Text_IO; use Ada.Text_IO; +with Ada.Containers.Vectors; + +procedure Test_Ada2022 is + + package Integer_Vectors is new + Ada.Containers.Vectors + (Index_Type => Natural, + Element_Type => Integer); + + use Integer_Vectors; + + procedure Increment_All (V : in out Vector) is + begin + for E of V loop + E := @ + 1; + end loop; + end Increment_All; + + V : Vector := [0, 0, 0]; + +begin + + Increment_All (V); + Put_Line (V'Image); + +end Test_Ada2022; diff --git a/tests/examplefiles/ada/test_ada2022.adb.output b/tests/examplefiles/ada/test_ada2022.adb.output new file mode 100644 index 00000000..c884ef57 --- /dev/null +++ b/tests/examplefiles/ada/test_ada2022.adb.output @@ -0,0 +1,186 @@ +'with' Keyword.Namespace +' ' Text +'Ada.Text_IO' Name.Namespace +';' Punctuation +' ' Text +'use' Keyword.Namespace +' ' Text +'Ada.Text_IO' Name.Namespace +';' Punctuation +'\n' Text + +'with' Keyword.Namespace +' ' Text +'Ada.Containers.Vectors' Name.Namespace +';' Punctuation +'\n\n' Text + +'procedure' Keyword.Declaration +' ' Text +'Test_Ada2022' Name.Function +' ' Text +'is' Keyword.Reserved +'\n\n' Text + +' ' Text +'package' Keyword.Declaration +' ' Text +'Integer_Vectors' Name.Class +' ' Text +'is new' Keyword.Reserved +'\n' Text + +' ' Text +'Ada.Containers.Vectors' Name.Class +'\n' Text + +' ' Text +'(' Punctuation +'Index_Type' Name.Variable +' ' Text +'=>' Punctuation +' ' Text +'N' Text +'a' Text +'t' Text +'u' Text +'r' Text +'a' Text +'l' Text +',' Punctuation +'\n' Text + +' ' Text +'Element_Type' Name.Variable +' ' Text +'=>' Punctuation +' ' Text +'I' Text +'n' Text +'t' Text +'e' Text +'g' Text +'e' Text +'r' Text +')' Punctuation +';' Punctuation +'\n\n' Text + +' ' Text +'use' Keyword.Namespace +' ' Text +'Integer_Vectors' Name.Namespace +';' Punctuation +'\n\n' Text + +' ' Text +'procedure' Keyword.Declaration +' ' Text +'Increment_All' Name.Function +' ' Text +'(' Punctuation +'V' Name.Variable +' ' Text +': ' Punctuation +'in' Name.Variable +' ' Text +'out' Name.Variable +' ' Text +'Vector' Name.Variable +')' Punctuation +' ' Text +'is' Keyword.Reserved +'\n' Text + +' ' Text +'begin' Keyword.Reserved +'\n' Text + +' ' Text +'for' Keyword.Reserved +' ' Text +'E' Name +' ' Text +'of' Keyword.Reserved +' ' Text +'V' Name +' ' Text +'loop' Keyword.Reserved +'\n' Text + +' ' Text +'E' Name +' ' Text +':=' Punctuation +' ' Text +'@' Punctuation +' ' Text +'+' Operator +' ' Text +'1' Literal.Number.Integer +';' Punctuation +'\n' Text + +' ' Text +'end' Keyword.Reserved +' ' Text +'loop' Keyword.Reserved +';' Punctuation +'\n' Text + +' ' Text +'end' Keyword.Reserved +' ' Text +'Increment_All' Name.Function +';' Punctuation +'\n\n' Text + +' ' Text +'V' Name +' ' Text +':' Punctuation +' ' Text +'Vector' Name +' ' Text +':=' Punctuation +' ' Text +'[' Punctuation +'0' Literal.Number.Integer +',' Punctuation +' ' Text +'0' Literal.Number.Integer +',' Punctuation +' ' Text +'0' Literal.Number.Integer +']' Punctuation +';' Punctuation +'\n\n' Text + +'begin' Keyword.Reserved +'\n\n' Text + +' ' Text +'Increment_All' Name +' ' Text +'(' Punctuation +'V' Name +')' Punctuation +';' Punctuation +'\n' Text + +' ' Text +'Put_Line' Name +' ' Text +'(' Punctuation +'V' Name +"'" Punctuation +'Image' Name.Attribute +')' Punctuation +';' Punctuation +'\n\n' Text + +'end' Keyword.Reserved +' ' Text +'Test_Ada2022' Name.Function +';' Punctuation +'\n' Text |
