4 ENUM ERR_NONE
,ERR_ARGS
,ERR_OPEN
6 RAISE ERR_ARGS
IF ReadArgs()=NIL
,
7 ERR_OPEN
IF Open()=ZERO
10 DEF rda
=NIL
,in
=ZERO
,out
=ZERO
,str
[257]:STRING,c
,q
,tprefix
[10]:STRING,n
11 DEF a
[2]:ARRAY OF LONG
12 rda
:=ReadArgs('FROM/A,TO/A',a
,NIL
)
13 in
:=Open(a
[0],OLDFILE
)
14 out
:=Open(a
[1],NEWFILE
)
15 WHILE
Fgets(in
,str
,256)
16 IF StrCmp(str
,'\t\t/* ',STRLEN
)
20 ELSEIF StrCmp(str
,'\t\t-> ',STRLEN
)
22 ELSEIF StrCmp(str
,'\t\t->\n')
24 ELSEIF StrCmp(str
,'-> ',STRLEN
)
26 ELSEIF StrCmp(str
,'->\n')
28 ELSEIF StrCmp(str
,'\tELSEIF stricmp(first,\a',STRLEN
)
31 WHILE (c
:=q
[]++)<>"'" AND c
DO StrAdd(tprefix
,{c
}+3,1)
32 VfPrintf(out
,'\n\e[1m\s_#? TAGS\e[22m\n\n',[tprefix
])
33 ELSEIF StrCmp(str
,'\t\t\t\a',STRLEN
)
38 WHILE (c
:=q
[]++)<>"'" AND c
DO FputC(out
,c
) BUT n
++
39 WHILE n
<30 DO FputC(out
," ") BUT n
++
41 q
:=str
+InStr(str
,'TAG_')+STRLEN
42 WHILE (c
:=q
[]++)<>"," AND c
DO FputC(out
,c
) BUT n
++
43 IF (q
:=str
+InStr(str
,'->'))>str
44 WHILE n
<6 DO FputC(out
," ") BUT n
++
46 WHILE (c
:=q
[]++)<>"\n" AND c
DO FputC(out
,c
)
54 IF rda
THEN FreeArgs(rda
)
56 CASE ERR_ARGS
; PrintFault(IoErr(),'MakeDoc cannot read args')
57 CASE ERR_OPEN
; PrintFault(IoErr(),'MakeDoc cannot open file')