summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/naive-ebnf/naive-ebnf.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/naive-ebnf/naive-ebnf.sty')
-rw-r--r--Master/texmf-dist/tex/latex/naive-ebnf/naive-ebnf.sty10
1 files changed, 8 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/latex/naive-ebnf/naive-ebnf.sty b/Master/texmf-dist/tex/latex/naive-ebnf/naive-ebnf.sty
index 5fd527fbf3a..07f2218e9e5 100644
--- a/Master/texmf-dist/tex/latex/naive-ebnf/naive-ebnf.sty
+++ b/Master/texmf-dist/tex/latex/naive-ebnf/naive-ebnf.sty
@@ -7,7 +7,7 @@
%% naive-ebnf.dtx (with options: `package')
%% (The MIT License)
%%
-%% Copyright (c) 2023 Yegor Bugayenko
+%% Copyright (c) 2023-2024 Yegor Bugayenko
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this software and associated documentation files (the 'Software'), to deal
@@ -31,7 +31,8 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{naive-ebnf}
-[2023-08-11 0.0.15 EBNF in Plain Text]
+[2024/10/25 0.0.17 EBNF in Plain Text]
+
@@ -138,22 +139,27 @@
{ >([^\s]) } {\\textgreater{}\1} \ebnf_tmp%
\regex_replace_all:nnN
{ ([^\s])'([^\s]) } {\1\\textquotesingle{}\2} \ebnf_tmp%
+ \regex_replace_all:nnN { \|\|\| }%
+ {\c{makebox}[#1][r]{ }} \ebnf_tmp%
\regex_replace_all:nnN
{ ([^\s])\|([^\s]) } {\1\\textbar{}\2} \ebnf_tmp%
%
\regex_replace_all:nnN
{ /(.+?)/ }%
{\c{ebnf@regexp}{\1}} \ebnf_tmp%
+ \cs_undefine:N\ebnf_curled%
\cs_new:Npn\ebnf_curled{%
\regex_replace_all:nnNT
{ \{\s(([^\s]*(\s[^\}\{]|\s(\}|\{)[^\s])?)*)\s\}(\+)? }%
{\c{ebnf@repetition}[\5]{\1}} \ebnf_tmp \ebnf_curled}%
\ebnf_curled%
+ \cs_undefine:N\ebnf_brackets%
\cs_new:Npn\ebnf_brackets{%
\regex_replace_all:nnNT
{ \(\s(([^\s]*(\s[^\)\(]|\s(\)|\()[^\s])?)*)\s\) }%
{\c{ebnf@grouping}{\1}} \ebnf_tmp \ebnf_brackets}%
\ebnf_brackets%
+ \cs_undefine:N\ebnf_squares%
\cs_new:Npn\ebnf_squares{%
\regex_replace_all:nnNT
{ \[\s(([^\s]*(\s[^\]\[]|\s(\]|\[)[^\s])?)*)\s\] }%