File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed
Units/parser-tex.r/newcommand.d Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 1+ \\bar input.tex /^\\providecommand{\\bar}{\\section{#1}}$/;" C
2+ \\foo input.tex /^\\renewcommand{\\foo}{\\section{#1}}$/;" C
13\\mysection0 input.tex /^\\newcommand{\\mysection0}{\\section{#1}}$/;" C
24\\mysection1 input.tex /^\\newcommand{\\mysection1}[1]{\\section{#1}}$/;" C
35\\mysection2 input.tex /^\\newcommand{\\mysection2}[1][1]{\\section{#1}}$/;" C
Original file line number Diff line number Diff line change 22\newcommand {\mysection 0}{\section {#1 }}
33\newcommand {\mysection 1}[1]{\section {#1 }}
44\newcommand {\mysection 2}[1][1]{\section {#1 }}
5+ \renewcommand {\foo }{\section {#1 }}
6+ \providecommand {\bar }{\section {#1 }}
57\begin {document }
68\mysection 0{ABC}
79\mysection 1{EFG}
Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ enum eKeywordId {
6363 KEYWORD_bibitem ,
6464 KEYWORD_bibliography ,
6565 KEYWORD_newcommand ,
66+ KEYWORD_renewcommand ,
67+ KEYWORD_providecommand ,
6668 KEYWORD_newcounter ,
6769};
6870typedef int keywordId ; /* to allow KEYWORD_NONE */
@@ -169,6 +171,8 @@ static const keywordTable TexKeywordTable [] = {
169171 { "bibitem" , KEYWORD_bibitem },
170172 { "bibliography" , KEYWORD_bibliography },
171173 { "newcommand" , KEYWORD_newcommand },
174+ { "renewcommand" , KEYWORD_renewcommand },
175+ { "providecommand" , KEYWORD_providecommand },
172176 { "newcounter" , KEYWORD_newcounter },
173177};
174178
@@ -934,6 +938,8 @@ static void parseTexFile (tokenInfo *const token)
934938 false, & tokenUnprocessed );
935939 break ;
936940 case KEYWORD_newcommand :
941+ case KEYWORD_renewcommand :
942+ case KEYWORD_providecommand :
937943 eof = parseNewcommand (token , & tokenUnprocessed );
938944 break ;
939945 case KEYWORD_newcounter :
You can’t perform that action at this time.
0 commit comments