Skip to content

Commit

Permalink
#14 nb!
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jul 12, 2023
1 parent a337cdc commit fc2863c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions naive-ebnf.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
%
% \maketitle
%
% \textbf{\color{red}NB!}
% Large ENBF snippets may take too long to render!
%
% \section{Introduction}
%
% This package helps render an
Expand Down Expand Up @@ -221,7 +224,7 @@
% \begin{document}\noindent
% \begin{ebnf}[1.5in]
% <x> := ( "x" ( "y" | ( "z" | <z> ) ) ) \\
% <y> := [ [ "x" ] /[a-z]+/ ] \\
% <y> := [ [ "x" ] { /[a-z]+/ } ] \\
% <z> := { { { <x> } <y> } <z> } \\
% \end{ebnf}
% \end{document}
Expand Down Expand Up @@ -394,8 +397,8 @@
\regex_replace_all:nnN { ([^\ ])'([^\ ]) } {\1\\textquotesingle{}\2} \ebnf_tmp%
\regex_replace_all:nnN { ([^\ ])\|([^\ ]) } {\1\\textbar{}\2} \ebnf_tmp%
%
\regex_replace_all:nnN { (\ )/(.+?)/(\ ) }%
{\1\c{ebnf@regexp}{\2}\3} \ebnf_tmp%
\regex_replace_all:nnN { \ /(.+?)/\ }%
{\c{ebnf@regexp}{\1}} \ebnf_tmp%
\cs_new:Npn\ebnf_curled{\regex_replace_all:nnNT { \{\ (([^\ ]*( [^\}\{]|\ (\}|\{)[^\ ])?)*)\ \} }%
{\c{ebnf@repetition}{\1}} \ebnf_tmp \ebnf_curled}%
\ebnf_curled%
Expand Down

0 comments on commit fc2863c

Please sign in to comment.