File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 475
475
(emits " (function(){throw " throw " })()" )
476
476
(emitln " throw " throw " ;" )))
477
477
478
+ (defn munge-param [line]
479
+ (if (re-find #"@param" line)
480
+ (let [[p t n & xs] (map string/trim
481
+ (string/split (string/trim line) #" " ))]
482
+ (if (and (= " @param" p)
483
+ t #?(:clj (.startsWith ^String t " {" )
484
+ :cljs (gstring/startsWith t " {" )))
485
+ (string/join " " (concat [p t (munge n)] xs))
486
+ line))
487
+ line))
488
+
478
489
(defn emit-comment
479
490
" Emit a nicely formatted comment string."
480
491
[doc jsdoc]
481
492
(let [docs (when doc [doc])
482
493
docs (if jsdoc (concat docs jsdoc) docs)
483
494
docs (remove nil? docs)]
484
495
(letfn [(print-comment-lines [e]
485
- (let [[x & ys] (string/split-lines e)]
496
+ (let [[x & ys] (map munge-param ( string/split-lines e) )]
486
497
(emitln " * " (string/replace x " */" " * /" ))
487
498
(doseq [next-line ys]
488
499
(emitln " * "
You can’t perform that action at this time.
0 commit comments