Skip to content

Commit 85b2042

Browse files
authored
enh(ada) Ada 2022 allows [, ] as brackets and parallel as a keyword. (#4225)
1 parent 5685c0e commit 85b2042

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ New Grammars:
77
Core Grammars:
88

99
- enh(csp) add missing directives / keywords from MDN (7 more) [Max Liashuk][]
10+
- enh(ada) add new `parallel` keyword, allow `[]` for Ada 2022 [Max Reznik][]
1011

1112
CONTRIBUTORS
1213

1314
[Josh Marchand]: https://github.com/yHSJ
1415
[Max Liashuk]: https://github.com/probil
16+
[Max Reznik]: https://github.com/reznikmm
1517

1618
## Version 11.11.1
1719

src/languages/ada.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Description: Ada is a general-purpose programming language that has great suppor
77
the newest standard being Ada2012.
88
*/
99

10-
// We try to support full Ada2012
10+
// We try to support full Ada 2022
1111
//
1212
// We highlight all appearances of types, keywords, literals (string, char, number, bool)
1313
// and titles (user defined function/procedure/package)
@@ -37,7 +37,7 @@ export default function(hljs) {
3737
const ID_REGEX = '[A-Za-z](_?[A-Za-z0-9.])*';
3838

3939
// bad chars, only allowed in literals
40-
const BAD_CHARS = `[]\\{\\}%#'"`;
40+
const BAD_CHARS = `\\{\\}%#'"`;
4141

4242
// Ada doesn't have block comments, only line comments
4343
const COMMENTS = hljs.COMMENT('--', '$');
@@ -146,7 +146,8 @@ export default function(hljs) {
146146
"do",
147147
"mod",
148148
"requeue",
149-
"xor"
149+
"xor",
150+
"parallel"
150151
];
151152

152153
return {

test/markup/ada/default.expect.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Error_Message : <span class="hljs-type">String</span> := Null_Ignore_Value (Error_Message_C);
88
<span class="hljs-keyword">begin</span>
99

10-
Named : <span class="hljs-keyword">for</span> Index <span class="hljs-keyword">in</span> Foo..Bar <span class="hljs-keyword">loop</span>
10+
Named : <span class="hljs-type">parallel</span> <span class="hljs-keyword">for</span> Index <span class="hljs-keyword">in</span> Foo..Bar <span class="hljs-keyword">loop</span>
1111
Put (<span class="hljs-string">&quot;Hi[]{}&quot;</span>);
1212
<span class="hljs-keyword">end</span> <span class="hljs-keyword">loop</span> Named;
1313

test/markup/ada/default.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package body Sqlite.Simple is
77
Error_Message : String := Null_Ignore_Value (Error_Message_C);
88
begin
99

10-
Named : for Index in Foo..Bar loop
10+
Named : parallel for Index in Foo..Bar loop
1111
Put ("Hi[]{}");
1212
end loop Named;
1313

0 commit comments

Comments
 (0)