projects
/
gnome.introspection-doc-generator
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JSDOC/CompressWhite.vala
[gnome.introspection-doc-generator]
/
JSDOC
/
CompressWhite.js
diff --git
a/JSDOC/CompressWhite.js
b/JSDOC/CompressWhite.js
index
1698649
..
50d7476
100644
(file)
--- a/
JSDOC/CompressWhite.js
+++ b/
JSDOC/CompressWhite.js
@@
-8,19
+8,22
@@
@arg packer {Packer}
*/
@arg packer {Packer}
*/
-
CompressWhite = function (ts, packer
)
+
const CompressWhite = function (ts, packer, keepWhite
)
{
{
-
+ keepWhite = keepWhite || false;
ts.rewind();
//var str = File.read(fn);
var rep_var = 1;
ts.rewind();
//var str = File.read(fn);
var rep_var = 1;
+
+
while (true) {
var tok = ts.next();
if (!tok) {
break;
}
if (tok.type == "WHIT") {
while (true) {
var tok = ts.next();
if (!tok) {
break;
}
if (tok.type == "WHIT") {
+
continue;
//if (tok._isDoc) {
// continue;
continue;
//if (tok._isDoc) {
// continue;
@@
-79,7
+82,7
@@
CompressWhite = function (ts, packer)
throw "could not find end lbrace!!!";
}
//print("AFTER BALANCE (");
throw "could not find end lbrace!!!";
}
//print("AFTER BALANCE (");
- ts.dump(cu, ts.cursor);
+
//
ts.dump(cu, ts.cursor);
//ts.cursor--; // cursor at the (
if (!ts.balance("{") ){
ts.dump(cu-40, cu);
//ts.cursor--; // cursor at the (
if (!ts.balance("{") ){
ts.dump(cu-40, cu);
@@
-268,18
+271,27
@@
CompressWhite = function (ts, packer)
var out = '';
var outoff = 0;
var out = '';
var outoff = 0;
- out.length = ts.slen; // prealloc.
+ try { out.length = ts.slen; } catch (e) {} // prealloc.
+
out = '';
out = '';
+ var tok;
while (true) {
while (true) {
- var tok = ts.nextTok();
-
+
+ tok = keepWhite ? ts.next() : ts.nextTok();
+
if (!tok) {
break;
}
if (!tok) {
break;
}
+ if (tok.type == "COMM") {
+ tok.outData = '\n';
+ }
+ ///print(tok.type + ':' + tok.data);
- if (tok.type == "NAME" && tok.identifier && tok.identifier.mungedValue && tok.identifier.mungedValue.length) {
+ if (tok.type == "NAME" && tok.identifier
+ && tok.identifier.mungedValue && tok.identifier.mungedValue.length) {
//f.write(tok.identifier.mungedValue);
//f.write(tok.identifier.mungedValue);
+ //print("MUNGED: " + tok.identifier.mungedValue);
out += tok.identifier.mungedValue;
continue;
}
out += tok.identifier.mungedValue;
continue;
}