2 // <script type="text/javascript">
5 toPretty = function toPretty(str)
7 var tr = new JSDOC.TokenReader();
8 var toks = tr.tokenize(str,false); // dont merge xxx + . + yyyy etc.
9 var sp = new JSDOC.ScopeParser(new JSDOC.TokenStream(toks));
11 // sp.mungeSymboltree();
13 r += sp.warnings.join("<BR>");
19 var cs = ''; // current style..
23 if (tok.isType("whitespace")) {
24 if (tok.data.indexOf("/") > -1) {
27 return cs; // keep the same..
29 if (tok.isType('string')) {
32 // other 'vary things??
33 if (tok.isType('identifier') || tok.isType('dot') || tok.isType('this')) {
36 if (/^[a-z]+/i.test(tok.data)) {
42 // loop through and print it...?
45 for (var i = 0;i < toks.length; i++) {
46 var ns = toStyle(toks[i]);
49 if (cs.length) r +='</span>';
50 r +='<span class="jsdoc-'+ns+'">';
53 if (toks[i].identifier) {
55 r += '<span class="with-ident2">' +
56 htmlescape(toks[i].data) + '</span>';
60 r += htmlescape(toks[i].data).replace(/\n/g, '<BR>');
62 if (cs.length) r +='</span>';
63 return '<code class="jsdoc-pretty">'+r+'</code>';