projects
/
gnome.introspection-doc-generator
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2d62858
)
JSDOC/PrettyPrint.js
author
Alan Knowles
<alan@akbkhome.com>
Tue, 29 Jun 2010 10:18:07 +0000
(18:18 +0800)
committer
Alan Knowles
<alan@akbkhome.com>
Tue, 29 Jun 2010 10:18:07 +0000
(18:18 +0800)
JSDOC/PrettyPrint.js
patch
|
blob
|
history
diff --git
a/JSDOC/PrettyPrint.js
b/JSDOC/PrettyPrint.js
index
f872e38
..
13e154a
100644
(file)
--- a/
JSDOC/PrettyPrint.js
+++ b/
JSDOC/PrettyPrint.js
@@
-1,12
+1,15
@@
// <script type="text/javascript">
// <script type="text/javascript">
+TokenReader = imports.TokenReader.TokenReader;
+ScopeParser= imports.ScopeParser.ScopeParser;
+TokenStream = imports.TokenStream.TokenStream;
-
toPretty =
function toPretty(str)
+function toPretty(str)
{
{
- var tr = new
JSDOC.
TokenReader();
+ var tr = new TokenReader();
var toks = tr.tokenize(str,false); // dont merge xxx + . + yyyy etc.
var toks = tr.tokenize(str,false); // dont merge xxx + . + yyyy etc.
- var sp = new
JSDOC.ScopeParser(new JSDOC.
TokenStream(toks));
+ var sp = new
ScopeParser(new
TokenStream(toks));
sp.buildSymbolTree();
// sp.mungeSymboltree();
var r = '';
sp.buildSymbolTree();
// sp.mungeSymboltree();
var r = '';
@@
-20,17
+23,17
@@
toPretty = function toPretty(str)
function toStyle(tok)
{
function toStyle(tok)
{
- if (tok.is
Type("whitespace")
) {
+ if (tok.is
("WHIT") || tok.is("COMM")
) {
if (tok.data.indexOf("/") > -1) {
return 'comment';
}
return cs; // keep the same..
}
if (tok.data.indexOf("/") > -1) {
return 'comment';
}
return cs; // keep the same..
}
- if (tok.is
Type('string
')) {
+ if (tok.is
('STRN
')) {
return 'string';
}
// other 'vary things??
return 'string';
}
// other 'vary things??
- if (tok.is
Type('identifier') || tok.isType('dot') || tok.isType('this
')) {
+ if (tok.is
('NAME') || tok.data == '.' || tok.name == 'THIS
')) {
return 'var';
}
if (/^[a-z]+/i.test(tok.data)) {
return 'var';
}
if (/^[a-z]+/i.test(tok.data)) {