Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zig: Added missing keywords #3279

Merged
merged 2 commits into from Dec 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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