rocambole-indent
Advanced tools
Comparing version 1.1.0 to 1.1.1
# rocambole-indent changelog | ||
## v1.1.1 (2015-03-25) | ||
- fix `WhiteSpace` conversion into `Indent` inside `alignComments()` | ||
## v1.1.0 (2015-03-25) | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "rocambole-indent", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "helpers for rocambole AST indentation", | ||
@@ -5,0 +5,0 @@ "main": "rocambole-indent.js", |
@@ -187,10 +187,10 @@ 'use strict'; | ||
if (!base) { | ||
if (tk.isIndent(token.prev) || tk.isWs(token.prev)) { | ||
if (isIndentOrWs(token.prev)) { | ||
tk.remove(token.prev); | ||
} | ||
} else { | ||
if (tk.isIndent(token.prev) || tk.isWs(token.prev)) { | ||
if (isIndentOrWs(token.prev)) { | ||
// we reuse whitespace just because user might not have converted all | ||
// the whitespaces into Indent tokens | ||
token.type = 'Indent'; | ||
token.prev.type = 'Indent'; | ||
token.prev.value = base.value; | ||
@@ -226,5 +226,5 @@ token.prev.level = base.level; | ||
if (tk.isBr(nextLine) || !nextLine) { | ||
return tk.isIndent(prevLine) || tk.isWs(prevLine) ? prevLine : null; | ||
return isIndentOrWs(prevLine) ? prevLine : null; | ||
} | ||
return tk.isIndent(nextLine) || tk.isWs(nextLine) ? nextLine : null; | ||
return isIndentOrWs(nextLine) ? nextLine : null; | ||
} | ||
@@ -260,2 +260,6 @@ | ||
function isIndentOrWs(token) { | ||
return tk.isIndent(token) || tk.isWs(token); | ||
} | ||
function nextInLineNotComment(token) { | ||
@@ -262,0 +266,0 @@ token = token.next; |
16407
319