JSDOC/TokenReader.vala
[gnome.introspection-doc-generator] / JSDOC / TokenReader.vala
index 11a853a..bbdc179 100644 (file)
@@ -288,11 +288,17 @@ namespace JSDOC {
             if (found === "") {
                 return false;
             }
-            //print("WHITE = " + JSON.stringify(found)); 
+            //print("WHITE = " + JSON.stringify(found));
+            
+            // if we found a new line, then we could check if previous character was a ';' - if so we can drop it.
+            // otherwise generally keep it.. in which case it should reduce our issue with stripping new lines..
+            
             if (this.collapseWhite) {
-                found = " "; // this might work better if it was a ';' ???
+                found = " "; // this might work better if it was a '\n' ???
+            }
+            if (this.keepWhite) {
+                tokens.push(new Token(found, "WHIT", "SPACE", this.line));
             }
-            if (this.keepWhite) tokens.push(new Token(found, "WHIT", "SPACE", this.line));
             return true;
         
         },