Skip to content

Commit

Permalink
#16 fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jul 12, 2023
1 parent 96f74b6 commit b58f584
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions naive-ebnf.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,16 @@
\NewDocumentEnvironment{ebnf}{O{4em}+b}
{\tl_set:Nn\ebnf_tmp{#2}}
{%
\regex_replace_all:nnN { ([^\ ])/([^\ ]) } {\1\\slash{}\2} \ebnf_tmp%
\regex_replace_all:nnN { ([^\ ])< } {\1\\textless{}} \ebnf_tmp%
\regex_replace_all:nnN { >([^\ ]) } {\\textgreater{}\1} \ebnf_tmp%
\regex_replace_all:nnN { ([^\ ])'([^\ ]) } {\1\\textquotesingle{}\2} \ebnf_tmp%
\regex_replace_all:nnN { ([^\ ])\|([^\ ]) } {\1\\textbar{}\2} \ebnf_tmp%
\regex_replace_all:nnN
{ ([^\ ])/([^\ ]) } {\1\\slash{}\2} \ebnf_tmp%
\regex_replace_all:nnN
{ ([^\ ])< } {\1\\textless{}} \ebnf_tmp%
\regex_replace_all:nnN
{ >([^\ ]) } {\\textgreater{}\1} \ebnf_tmp%
\regex_replace_all:nnN
{ ([^\ ])'([^\ ]) } {\1\\textquotesingle{}\2} \ebnf_tmp%
\regex_replace_all:nnN
{ ([^\ ])\|([^\ ]) } {\1\\textbar{}\2} \ebnf_tmp%
%
\regex_replace_all:nnN { \ /(.+?)/\ }%
{\c{ebnf@regexp}{\1}} \ebnf_tmp%
Expand Down

0 comments on commit b58f584

Please sign in to comment.