Skip to content

Commit

Permalink
Zig: Added missing keywords (#3279)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed Dec 18, 2021
1 parent 809af0d commit deed35e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/prism-zig.js
Expand Up @@ -4,7 +4,7 @@
return function () { return str; };
}

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/;
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/;

var IDENTIFIER = '\\b(?!' + keyword.source + ')(?!\\d)\\w+\\b';
var ALIGN = /align\s*\((?:[^()]|\([^()]*\))*\)/.source;
Expand Down
2 changes: 1 addition & 1 deletion components/prism-zig.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions tests/languages/zig/keyword_feature.test
@@ -1,6 +1,8 @@
align
allowzero
and
anyframe
anytype
asm
async
await
Expand All @@ -24,6 +26,7 @@ inline
linksection
nakedcc
noalias
nosuspend
null
or
orelse
Expand Down Expand Up @@ -53,6 +56,8 @@ while
["keyword", "align"],
["keyword", "allowzero"],
["keyword", "and"],
["keyword", "anyframe"],
["keyword", "anytype"],
["keyword", "asm"],
["keyword", "async"],
["keyword", "await"],
Expand All @@ -76,6 +81,7 @@ while
["keyword", "linksection"],
["keyword", "nakedcc"],
["keyword", "noalias"],
["keyword", "nosuspend"],
["keyword", "null"],
["keyword", "or"],
["keyword", "orelse"],
Expand Down

0 comments on commit deed35e

Please sign in to comment.