summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/naive-ebnf
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-08-09 03:01:14 +0000
committerNorbert Preining <norbert@preining.info>2023-08-09 03:01:14 +0000
commit9c6ffed1253f7d203afb08f7fffc9c661c48567b (patch)
treeeffd795e39f54272c64ea1ddae648d4d6c49bd96 /macros/latex/contrib/naive-ebnf
parent313a3ccce8935aa26c29f2e430042cffee435454 (diff)
CTAN sync 202308090301
Diffstat (limited to 'macros/latex/contrib/naive-ebnf')
-rw-r--r--macros/latex/contrib/naive-ebnf/DEPENDS.txt15
-rw-r--r--macros/latex/contrib/naive-ebnf/naive-ebnf.dtx13
-rw-r--r--macros/latex/contrib/naive-ebnf/naive-ebnf.pdfbin718356 -> 727190 bytes
3 files changed, 25 insertions, 3 deletions
diff --git a/macros/latex/contrib/naive-ebnf/DEPENDS.txt b/macros/latex/contrib/naive-ebnf/DEPENDS.txt
index 6abbcb3ff6..9bae0232c3 100644
--- a/macros/latex/contrib/naive-ebnf/DEPENDS.txt
+++ b/macros/latex/contrib/naive-ebnf/DEPENDS.txt
@@ -1,2 +1,15 @@
hard pgfopts
-hard expl3 \ No newline at end of file
+soft docshots
+soft etoolbox
+soft filecontentsdef
+soft href-ul
+soft hypdoc
+soft iexec
+soft l3build
+soft libertine
+soft mathtools
+soft microtype
+soft newtx
+soft pgfopts
+soft scheme-basic
+soft xetex \ No newline at end of file
diff --git a/macros/latex/contrib/naive-ebnf/naive-ebnf.dtx b/macros/latex/contrib/naive-ebnf/naive-ebnf.dtx
index 804e2121b9..b3972202f6 100644
--- a/macros/latex/contrib/naive-ebnf/naive-ebnf.dtx
+++ b/macros/latex/contrib/naive-ebnf/naive-ebnf.dtx
@@ -50,7 +50,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{naive-ebnf}
%<*package>
-[2023-07-14 0.0.13 EBNF in Plain Text]
+[2023-08-08 0.0.14 EBNF in Plain Text]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -112,6 +112,7 @@
% \item |/.../| denotes a regular expression, like |/[a-z]+/|;
% \item |[...]| denotes an optional substitution;
% \item |{...}| denotes a zero or more times repetition;
+% \item |{...}+| denotes one or more times repetition;
% \item \texttt{\char`\|\char`\|} denotes an indented vertical bar at the beginning of the string.
% \end{itemize}
@@ -228,7 +229,7 @@
% % There is no meaning in this:
% <x> := ( "x" ( "y" | ( "z" | <z> ) ) ) \\
% <y> := [ [ "x1" ] { /[a-z]+/ } ] \\
-% <z> := { { { <x> } <y> } <z> } \\
+% <z> := { { { <x> }+ <y> } <z> } \\
% <t> := [ <x> ] [ <y> ] \\
% \end{ebnf}
% \end{document}
@@ -354,6 +355,8 @@
{\ebnf@color{gray}{[}#1\ebnf@color{gray}{]}}
\newcommand\ebnf@repetition[1]
{\ebnf@color{gray}{\{}#1\ebnf@color{gray}{\}}}
+\newcommand\ebnf@iteration[1]
+ {\ebnf@color{gray}{\{}#1\ebnf@color{gray}{\}\(^{\scriptscriptstyle +}\)}}
\newcommand\ebnf@grouping[1]
{\ebnf@color{gray}{(}#1\ebnf@color{gray}{)}}
\ExplSyntaxOn
@@ -388,6 +391,7 @@
% \begin{macro}{ebnf}
% \changes{0.0.4}{2023/02/03}{Any symbols are allowed inside \texttt{\char`\\EbnfNonTerminal} commands and inside the \texttt{ebnf} environment, where non-terminals are mentioned.}
% \changes{0.0.11}{2023/07/12}{Many bugs fixed in the area of regular expression matching.}
+% \changes{0.0.14}{2023/08/08}{One-or-more repetition introduced with \texttt{\char`\{...\char`\}+} syntax.}
% Then, we define the |ebnf| environment:
% \begin{macrocode}
\ExplSyntaxOn
@@ -410,6 +414,11 @@
\regex_replace_all:nnN
{ /(.+?)/ }%
{\c{ebnf@regexp}{\1}} \ebnf_tmp%
+ \cs_new:Npn\ebnf_iterated{%
+ \regex_replace_all:nnNT
+ { \{\s(([^\s]*(\s[^\}\{]|\s(\}|\{)[^\s])?)*)\s\}\+ }%
+ {\c{ebnf@iteration}{\1}} \ebnf_tmp \ebnf_iterated}%
+ \ebnf_iterated%
\cs_new:Npn\ebnf_curled{%
\regex_replace_all:nnNT
{ \{\s(([^\s]*(\s[^\}\{]|\s(\}|\{)[^\s])?)*)\s\} }%
diff --git a/macros/latex/contrib/naive-ebnf/naive-ebnf.pdf b/macros/latex/contrib/naive-ebnf/naive-ebnf.pdf
index ee1c39c6b9..8f70242c2a 100644
--- a/macros/latex/contrib/naive-ebnf/naive-ebnf.pdf
+++ b/macros/latex/contrib/naive-ebnf/naive-ebnf.pdf
Binary files differ