--- gforth/doc/makedoc.fs 1997/08/03 20:21:55 1.2 +++ gforth/doc/makedoc.fs 1999/12/03 18:21:05 1.3 @@ -26,8 +26,8 @@ \ .... name ( stack-effect ) \ [prefix-] wordset [pronounciation] \ \G description ... -\ The output is a Forth source file that looks like this: -\ doc[-prefix]-entry name stack-effect ) wordset [pronountiation] +\ The output is a file of entries that look like this: +\ make-doc [--prefix]-entry name stack-effect ) wordset [pronounciation] \ description \ \ (i.e., the entry is terminated by an empty line or the end-of-file) @@ -57,16 +57,21 @@ r/w create-file throw value doc-file-id s" \ automatically generated by makedoc.fs" doc-file-id write-line throw +: >fileCR ( c-addr u -- ) + doc-file-id write-line throw ; +: >file ( c-addr u -- ) + doc-file-id write-file throw ; + : \G ( -- ) - source >in @ /string doc-file-id write-line throw + source >in @ /string >fileCR source >in ! drop ; immediate : put-doc-entry ( -- ) locals-list @ 0= \ not in a colon def, i.e., not a local name last @ 0<> and \ not an anonymous (i.e. noname) header if - s" " doc-file-id write-line throw - s" make-doc " doc-file-id write-file throw + s" " >fileCR + s" make-doc " >file >in @ >r [char] ( parse 2drop [char] ) parse @@ -76,17 +81,17 @@ s" \ automatically generated by makedoc. IF dup count 1- chars + c@ [char] - = IF - s" --" doc-file-id write-file throw - count doc-file-id write-file throw drop + s" --" >file + count >file 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 + last @ name>string >file + >file + s" )" >file POSTPONE \g r> >in ! endif ;