Skip to content

Commit deed35e

Browse files
authoredDec 18, 2021
Zig: Added missing keywords (#3279)
1 parent 809af0d commit deed35e

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed
 

‎components/prism-zig.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
return function () { return str; };
55
}
66

7-
var keyword = /\b(?:align|allowzero|and|asm|async|await|break|cancel|catch|comptime|const|continue|defer|else|enum|errdefer|error|export|extern|fn|for|if|inline|linksection|nakedcc|noalias|null|or|orelse|packed|promise|pub|resume|return|stdcallcc|struct|suspend|switch|test|threadlocal|try|undefined|union|unreachable|usingnamespace|var|volatile|while)\b/;
7+
var keyword = /\b(?:align|allowzero|and|anyframe|anytype|asm|async|await|break|cancel|catch|comptime|const|continue|defer|else|enum|errdefer|error|export|extern|fn|for|if|inline|linksection|nakedcc|noalias|nosuspend|null|or|orelse|packed|promise|pub|resume|return|stdcallcc|struct|suspend|switch|test|threadlocal|try|undefined|union|unreachable|usingnamespace|var|volatile|while)\b/;
88

99
var IDENTIFIER = '\\b(?!' + keyword.source + ')(?!\\d)\\w+\\b';
1010
var ALIGN = /align\s*\((?:[^()]|\([^()]*\))*\)/.source;

‎components/prism-zig.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/languages/zig/keyword_feature.test

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
align
22
allowzero
33
and
4+
anyframe
5+
anytype
46
asm
57
async
68
await
@@ -24,6 +26,7 @@ inline
2426
linksection
2527
nakedcc
2628
noalias
29+
nosuspend
2730
null
2831
or
2932
orelse
@@ -53,6 +56,8 @@ while
5356
["keyword", "align"],
5457
["keyword", "allowzero"],
5558
["keyword", "and"],
59+
["keyword", "anyframe"],
60+
["keyword", "anytype"],
5661
["keyword", "asm"],
5762
["keyword", "async"],
5863
["keyword", "await"],
@@ -76,6 +81,7 @@ while
7681
["keyword", "linksection"],
7782
["keyword", "nakedcc"],
7883
["keyword", "noalias"],
84+
["keyword", "nosuspend"],
7985
["keyword", "null"],
8086
["keyword", "or"],
8187
["keyword", "orelse"],

0 commit comments

Comments
 (0)
Please sign in to comment.