Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 16bb419

Browse files
committed
New \grammartoken markup, similar to \token but allowed everywhere.
1 parent 2a274a7 commit 16bb419

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

Doc/perl/python.perl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,10 @@ sub do_cmd_token{
716716
return "<a href=\"$target\">$token</a>" . $_;
717717
}
718718

719+
sub do_cmd_grammartoken{
720+
return do_cmd_token(@_);
721+
}
722+
719723
sub do_env_productionlist{
720724
local($_) = @_;
721725
my $lang = next_optional_argument();

Doc/texinputs/python.sty

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,11 +867,13 @@
867867
\newcommand{\citetitle}[2][URL]{\emph{#2}}
868868

869869

870+
\newcommand{\grammartoken}[1]{\texttt{#1}}
870871
\newenvironment{productionlist}[1][\py@badkey]{
871872
\def\optional##1{{\Large[}##1{\Large]}}
872873
\def\production##1##2{\code{##1}&::=&\code{##2}\\}
873874
\def\orgroup##1{{\def\or{\textbar\ }##1}}
874875
\def\token##1{##1}
876+
\let\grammartoken=\token
875877
\begin{center}
876878
\begin{tabular}{lcl}
877879
}{%

0 commit comments

Comments
 (0)