diff --git a/doc/d-utils.md b/doc/d-utils.md index cc556bf..72afa0d 100644 --- a/doc/d-utils.md +++ b/doc/d-utils.md @@ -365,7 +365,9 @@ A unifying module for compound data structures tagging. ### make-tag [syntax] -* ```name``` - unquoted symbol to base the tag on + (_ tag) + +* ```tag``` - unquoted symbol to base the tag on Creates a unique and collision free symbol to identify compound data structures based on lists and pairs. diff --git a/doc/utils.md b/doc/utils.md index 0cfff7e..86f65e5 100644 --- a/doc/utils.md +++ b/doc/utils.md @@ -292,17 +292,3 @@ quoted-printable sequences. Returns the ```str``` with all characters converted to upper case using ```char-upcase```. Does not work with UTF-8. - -### Tag - - (import util-tag) - -A unifying module for compound data structures tagging. - - (make-tag name) - -* ```name``` - unquoted symbol to base the tag on - -Creates a unique and collision free symbol to identify compound data -structures based on lists and pairs. - diff --git a/src/duck-extract.scm b/src/duck-extract.scm index efa6eae..3948e2d 100644 --- a/src/duck-extract.scm +++ b/src/duck-extract.scm @@ -173,6 +173,11 @@ (newline) (print "### " (cadr sec) " [syntax]") (newline) + (let loop ((patterns (cadddr sec))) + (when (not (null? patterns)) + (print " " (car patterns)) + (loop (cdr patterns)))) + (newline) (print-duck-text (caddr sec))) (define (print-duck-unknown sec) diff --git a/src/duck.scm b/src/duck.scm index 780b1a2..c1438cc 100644 --- a/src/duck.scm +++ b/src/duck.scm @@ -74,7 +74,11 @@ expr))) (define-syntax duck-extract-doc - (syntax-rules (define/doc make-parameter define*/doc define-syntax/doc) + (syntax-rules (define/doc make-parameter define*/doc define-syntax/doc syntax-rules) + ((_ (define-syntax/doc id doc + (syntax-rules (literal ...) + (pattern template) ...))) + (list 'STX 'id `doc '(pattern ...))) ((_ (define-syntax/doc id doc transformer)) (list 'STX 'id `doc)) ((_ (define/doc (proc . args) doc expr ...)) diff --git a/src/util-tag.scm b/src/util-tag.scm index ccf6ddb..d7eb7e9 100644 --- a/src/util-tag.scm +++ b/src/util-tag.scm @@ -41,7 +41,7 @@ ;; Syntactic wrapper to allow easy tag creation (define-syntax/doc make-tag - ("* ```name``` - unquoted symbol to base the tag on + ("* ```tag``` - unquoted symbol to base the tag on Creates a unique and collision free symbol to identify compound data structures based on lists and pairs.")