%%%============================================================================== %% Copyright 2026-present by Alceu Frigeri %% %% This work may be distributed and/or modified under the conditions of %% %% * The [LaTeX Project Public License](http://www.latex-project.org/lppl.txt), %% version 1.3c (or later), and/or %% * The [GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.html), %% version 3 (or later) %% %% This work has the LPPL maintenance status *maintained*. %% %% The Current Maintainer of this work is Alceu Frigeri %% %% This is version {1.0} {2026/11/27} %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/codehighlight %% %%%============================================================================== %% %% Nota Bene: %% Some languages 'got' an specific identifier %% like ==> identifier = { pragma } { \# } { } %% or ==> identifier = { texcs } { \\ } { } %% this is a flexible way to declare keywords/pragmas instead %% of changing the catcode of some chars to letter %% main implication: some keyword/pragma's lists got split. %%%============================================================================== %%%%%%% %%% This save the current 'expl syntax' state %%%%%%% \hlExplFileTest %%%%%%% %%% %%% Just an attempt at having my package's info in a regular way %%% \pkginfograb_set:nn {} { props} sets package info %%% %%% \pkginfograbProvidesExplPackage {} { props} sets package info %%% and calls \ProvidesExplPackage %%% %%%%%%% \RequirePackage{pkginfograb} \pkginfograbProvidesExplFile {codehighlight-01} { name = {codehighlight-01} , prefix = {codehl} , date = {2026/11/27} , version = {1.0} , description = {codehighlight ~language ~definitions ~01} } %%%%%%% %%% End of cut-n-paste %%%%%%% \codehl_lang_def:nn { Csharp.1 } { %%% info / note = { Csharp.1 ~ base ~ Language. ~ Some ~ references~\\ https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/ \\ https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/preprocessor-directives } , %%% comment ~ line = {1} { // } { } , comment = {2} { /* } { */ } { } , string = {1} { " } { \\ } { } , delimited ~ string = {2} { @" } { " } { } { } , delimited ~ string = {2} { \$" } { " } { } { } , delimited ~ string = {2} { \$@" } { " } { } { } , identifier = { pragma } { \# } { } , alphanumeric = true , oletter = { \_ } , } \codehl_lang_def:nn { Csharp.6 } { %%% info / note = { Csharp.6 ~ based ~ on ~ Csharp.1 } , %%% based ~ on = { Csharp.1 } , } \codehl_lang_def:nn { Csharp.11 } { %%% info / note = { Csharp.11 ~ based ~ on ~ Csharp.6 } , %%% based ~ on = { Csharp.6 } , string = {1} { """ } { \\ } { } , delimited ~ string = {1} { \$""" } { """ } { } { } , delimited ~ string = {1} { u8\" } { " } { } { } , } \codehl_lang_def:nn { Csharp.13 } { %%% info / note = { Csharp.13 ~ based ~ on ~ Csharp.11 } , %%% based ~ on = { Csharp.11 } , } \codehl_keyset_def:nn { Csharp.1 } { %%% info / note = { Csharp.1 ~ base ~ Language. ~ Some ~ references~\\ https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/ \\ https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/preprocessor-directives } , %%% keywd = {1} { abstract, as, base, bool, break, byte, case, catch, char, checked, class, const, continue, decimal, default, delegate, do, double, else, enum, event, explicit, extern, false, finally, fixed, float, for, foreach, goto, if, implicit, in, int, interface, internal, is, lock, long, namespace, new, null, object, operator, out, override, params, private, protected, public, readonly, ref, return, sbyte, sealed, short, sizeof, stackalloc, static, string, struct, switch, this, throw, true, try, typeof, uint, ulong, unchecked, unsafe, ushort, using, virtual, void, volatile, while, } , pragma = {1} { define, undef, if, elif, else, endif, region, endregion, pragma, error, warning, line, } , } \codehl_keyset_def:nn { Csharp.6 } { %%% info / note = { Csharp.6 ~ based ~ on ~ Csharp.1 } , %%% based ~ on = { Csharp.1 } , keywd = {1} { yield, partial, where, select, from, group, into, orderby, join, let, on, equals, by, ascending, descending, dynamic, async, await, nameof } , pragma = {1} { nullable, } , } \codehl_keyset_def:nn { Csharp.13 } { %%% info / note = { Csharp.13 ~ based ~ on ~ Csharp.6 } , %%% based ~ on = { Csharp.6 } , keywd = {1} { when, var, record, init, with, required, file, nint, nuint, and, or, not, scoped, } , } %% %% Aliases %% \codehl_lang_alias:nn { Csharp } { Csharp.13 } \codehl_keyset_alias:nn { Csharp } { Csharp.13 } %%%%%%% %%% This restore the 'expl syntax' state saved (hopefully) at the beginning %%%%%%% \hlExplFileOut