X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/87883222727894b13d3d4ce50e413a544a50fe20..be18b63c233dae3873691486a2d858e600b087f8:/doc/sod.sty?ds=sidebyside

diff --git a/doc/sod.sty b/doc/sod.sty
index 43b77cc..90a3838 100644
--- a/doc/sod.sty
+++ b/doc/sod.sty
@@ -263,10 +263,25 @@
   \fi%
 }
 
-%% \parse@dhd{NEXT}{CAT}{...}...[NAME]{SYNOPSIS}
+%% \parse@dhd{NEXT}[MOD]{CAT}{...}...[NAME]{SYNOPSIS}
 %% call NEXT{MOD}{CAT}{{...}...}{NAME}{SYNOPSIS}
 %%            #1   #2      #3     #4      #5
-\def\parse@dhd#1#2{%  {NEXT}{CAT}
+\def\@setf{setf}
+\def\parse@dhd#1{%  {NEXT}
+  \@ifnextchar[{\parse@dhd@a{#1}}{\parse@dhd@c{#1}}}
+\def\parse@dhd@a#1[#2]#3{%  {NEXT}[MOD]{CAT}
+  \@desc@dispatch{descargs}{#3}{\parse@dhd@ab{#1}{#2}{#3}}}
+\def\parse@dhd@ab#1#2#3#4{%  {NEXT}{MOD}{CAT}{{...}...}
+  \@ifnextchar[{\parse@dhd@ac{#1}{#2}{#3}{#4}}{\parse@dhd@ad{#1}{#2}{#3}{#4}}}
+\def\parse@dhd@ac#1#2#3#4[#5]#6{%  {NEXT}{MOD}{CAT}{{...}...}[NAME]{SYNOPSIS}
+  #1{#2}{#3}{#4}{#5}{#6}}
+\def\parse@dhd@ad#1#2#3#4#5{%  {NEXT}{MOD}{CAT}{{...}...}{NAME [ARGS...]}
+  \parse@dhd@ae{#1}{#2}{#3}{#4}{#5}#5 \q@}
+\def\parse@dhd@ae#1#2#3#4#5#6 #7\q@{%
+  % {NEXT}{MOD}{CAT}{{...}...}{SYNSOPSIS}NAME [ARGS...]\q@
+  #1{#2}{#3}{#4}{#6}{#5}}
+
+\def\parse@dhd@c#1#2{%  {NEXT}{CAT}
   \@desc@dispatch{descargs}{#2}{\parse@dhd@cb{#1}{#2}}}
 \def\parse@dhd@cb#1#2#3{%  {NEXT}{CAT}{{...}...}
   \@ifnextchar[{\parse@dhd@cc{#1}{#2}{#3}}{\parse@dhd@cd{#1}{#2}{#3}}}
