--- gforth/doc/makedoc.fs 1997/05/21 20:40:04 1.1 +++ gforth/doc/makedoc.fs 1997/08/03 20:21:55 1.2 @@ -23,11 +23,11 @@ \ it takes the name of the doc-file to be generated. \ the forth source must have the following format: -\ .... name ( stack-effect ) \ wordset [pronounciation] +\ .... name ( stack-effect ) \ [prefix-] wordset [pronounciation] \ \G description ... \ The output is a Forth source file that looks like this: -\ doc-entry name stack-effect ) wordset [pronountiation] +\ doc[-prefix]-entry name stack-effect ) wordset [pronountiation] \ description \ \ (i.e., the entry is terminated by an empty line or the end-of-file) @@ -67,14 +67,28 @@ s" \ automatically generated by makedoc. if s" " doc-file-id write-line throw s" make-doc " doc-file-id write-file throw - last @ name>string doc-file-id write-file throw - >in @ + >in @ >r [char] ( parse 2drop - [char] ) parse doc-file-id write-file throw - s" )" doc-file-id write-file throw + [char] ) parse [char] \ parse 2drop + >in @ + bl word dup c@ + IF + dup count 1- chars + c@ [char] - = + IF + s" --" doc-file-id write-file throw + count doc-file-id write-file throw drop + ELSE + drop >in ! + THEN + ELSE + drop >in ! + THEN + last @ name>string doc-file-id write-file throw + doc-file-id write-file throw + s" )" doc-file-id write-file throw POSTPONE \g - >in ! + r> >in ! endif ; : (doc-header) ( -- )