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

Adding keyword 'record' 'init' 'nullable' (new syntax of C# 8, 9) #2991

Merged
merged 4 commits into from Jul 11, 2021
Merged
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions components/prism-csharp.js
Expand Up @@ -47,9 +47,9 @@
typeDeclaration: 'class enum interface struct',
// contextual keywords
// ("var" and "dynamic" are missing because they are used like types)
contextual: 'add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into join let nameof not notnull on or orderby partial remove select set unmanaged value when where',
contextual: 'add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group init into join let nameof not notnull on or orderby partial remove select set unmanaged value when where',
RunDevelopment marked this conversation as resolved.
Show resolved Hide resolved
// all other keywords
other: 'abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield'
other: 'abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly record ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield'
RunDevelopment marked this conversation as resolved.
Show resolved Hide resolved
};

// keywords
Expand Down Expand Up @@ -260,7 +260,7 @@
inside: {
// highlight preprocessor directives as keywords
'directive': {
pattern: /(#)\b(?:define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/,
pattern: /(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,
lookbehind: true,
alias: 'keyword'
}
Expand Down