diff options
author | Karl Berry <karl@freefriends.org> | 2023-08-08 19:53:29 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-08-08 19:53:29 +0000 |
commit | 28244d186b7641d09dff79ba1905f3dfc289a6f7 (patch) | |
tree | f1e1d789c84b36992ee0659296f95be4d32f807e /Master | |
parent | 70fb6221c767f7acb3b27a683421c46ac158397c (diff) |
naive-ebnf (8aug23)
git-svn-id: svn://tug.org/texlive/trunk@67851 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/naive-ebnf/DEPENDS.txt | 15 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/naive-ebnf/naive-ebnf.pdf | bin | 718356 -> 727190 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/naive-ebnf/naive-ebnf.dtx | 13 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/naive-ebnf/naive-ebnf.sty | 9 |
4 files changed, 33 insertions, 4 deletions
diff --git a/Master/texmf-dist/doc/latex/naive-ebnf/DEPENDS.txt b/Master/texmf-dist/doc/latex/naive-ebnf/DEPENDS.txt index 6abbcb3ff6d..9bae0232c3d 100644 --- a/Master/texmf-dist/doc/latex/naive-ebnf/DEPENDS.txt +++ b/Master/texmf-dist/doc/latex/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/Master/texmf-dist/doc/latex/naive-ebnf/naive-ebnf.pdf b/Master/texmf-dist/doc/latex/naive-ebnf/naive-ebnf.pdf Binary files differindex ee1c39c6b98..8f70242c2aa 100644 --- a/Master/texmf-dist/doc/latex/naive-ebnf/naive-ebnf.pdf +++ b/Master/texmf-dist/doc/latex/naive-ebnf/naive-ebnf.pdf diff --git a/Master/texmf-dist/source/latex/naive-ebnf/naive-ebnf.dtx b/Master/texmf-dist/source/latex/naive-ebnf/naive-ebnf.dtx index 804e2121b97..b3972202f69 100644 --- a/Master/texmf-dist/source/latex/naive-ebnf/naive-ebnf.dtx +++ b/Master/texmf-dist/source/latex/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/Master/texmf-dist/tex/latex/naive-ebnf/naive-ebnf.sty b/Master/texmf-dist/tex/latex/naive-ebnf/naive-ebnf.sty index e667cbd550a..45ec4a3ad46 100644 --- a/Master/texmf-dist/tex/latex/naive-ebnf/naive-ebnf.sty +++ b/Master/texmf-dist/tex/latex/naive-ebnf/naive-ebnf.sty @@ -31,7 +31,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{naive-ebnf} -[2023-07-14 0.0.13 EBNF in Plain Text] +[2023-08-08 0.0.14 EBNF in Plain Text] @@ -94,6 +94,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 @@ -144,6 +146,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\} }% |