%%%==============================================================================
%% 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 {<pkg-name>} { props} sets package info
%%%
%%%   \pkginfograbProvidesExplPackage {<pkg-name>} { props} sets package info
%%%     and calls \ProvidesExplPackage
%%%
%%%%%%%
\RequirePackage{pkginfograb}
\pkginfograbProvidesExplFile {codehighlight-0D}
  {
     name        = {codehighlight-0D} ,
     prefix      = {codehl} ,
     date        = {2026/11/27} ,
     version     = {1.0} ,
     description = {codehighlight ~language ~definitions ~0D}
  }
%%%%%%%
%%% End of cut-n-paste
%%%%%%%

\codehl_lang_def:nn { Modula-2 }
  {
    %%%
    info / note  =
     {
       Modula-2 ~ base ~ Language. ~ Some ~ references~\\
       https://www.modula2.org/reference/~\\
       https://en.wikipedia.org/wiki/Modula-2
     }  ,
    %%%

    comment                  =      {1} { (* } { *) }     { nestable } ,
    
    string                   =      {1} { "  }        { } { }  ,
    string                   =      {1} { '  }        { } { }  ,

    alphanumeric             =      true  ,
    oletter                  =      { \_ }  ,
  }

\codehl_keyset_def:nn { Modula-2 }
  {
    %%%
    info / note  =
     {
       Modula-2 ~ base ~ Language. ~ Some ~ references~\\
       https://www.modula2.org/reference/~\\
       https://en.wikipedia.org/wiki/Modula-2
     }  ,
    %%%

    keywd                    =      {1}
      { 
        AND, ARRAY, BEGIN, BY, CASE, CONST, DEFINITION, DIV, 
        DO, ELSE, ELSIF, END, EXIT, EXPORT, FOR, FROM, IF, 
        IMPLEMENTATION, IMPORT, IN, LOOP, MOD, MODULE, NOT, OF, 
        OR, POINTER, PROCEDURE, QUALIFIED, RECORD, REPEAT, RETURN, 
        SET, THEN, TO, TYPE, UNTIL, VAR, WHILE, WITH,
      }  ,
  }

\codehl_lang_def:nn { Oberon }
  {
    %%%
    info / note  =
     {
       Oberon ~ base ~ Language. ~ Some ~ references~\\
       https://online.oberon.org/oberon_en~\\
       https://github.com/oberon-lang/specification
     }  ,
    %%%

    based ~ on               =      { Modula-2 }  ,  %%% same base syntax
  }

\codehl_keyset_def:nn { Oberon }
  {
    %%%
    info / note  =
     {
       Oberon ~ base ~ Language. ~ Some ~ references~\\
       https://online.oberon.org/oberon_en~\\
       https://github.com/oberon-lang/specification
     }  ,
    %%%

    keywd                    =      {1}
      {  
        AND, ARRAY, BEGIN, BY, CASE, CONST, DIV, DO, ELSE, ELSIF, 
        END, EXIT, FOR, IF, IMPORT, IN, IS, LOOP, MOD, MODULE, 
        NIL, OF, OR, POINTER, PROCEDURE, RECORD, REPEAT, 
        RETURN, THEN, TO, TYPE, UNTIL, VAR, WHILE, WITH,
      }  ,
  }
  

\codehl_lang_def:nn { Oberon+ }
  {
    %%%
    info / note  =
     {
       Oberon+ ~ based  ~ on ~ Oberon.
     }  ,
    %%%

    based ~ on               =      { Oberon }  ,  %%% same base syntax
    
    tagged ~ area            =      { pragma } { <* } { *> } { }  ,
  }

\codehl_keyset_def:nn { Oberon+ }
  {
    %%%
    info / note  =
     {
       Oberon+ ~ based  ~ on ~ Oberon.
     }  ,
    %%%

    based ~ on               =      { Oberon }  ,  
    
    pragma                   =      {1}
      { %%% source code directives
        IF, ELSIF, ELSE, END, OR
      }  ,
  }

%%
%% Aliases
%%

%%%%%%%
%%%  This restore the 'expl syntax' state saved (hopefully) at the beginning
%%%%%%%
\hlExplFileOut


