diff options
author | Jérémy Faivre <contact@jeremyfa.com> | 2017-02-12 00:41:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-12 00:41:06 +0100 |
commit | 4ea1e60281add31667e436b0f8a3ff19dea2b2cf (patch) | |
tree | 5e1126baf3373abc01485bd00e3fee4d6972466a | |
parent | 5e74781976ad23645970eb192f2d83a324e7c95f (diff) | |
parent | 167043de4167eeabde695b20d9f159034cae869e (diff) | |
download | yamljs-4ea1e60281add31667e436b0f8a3ff19dea2b2cf.tar.gz |
Merge pull request #79 from ar-shao/issue#60
Fix issue #60
-rw-r--r-- | src/Parser.coffee | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/Parser.coffee b/src/Parser.coffee index 546c02f..812d23f 100644 --- a/src/Parser.coffee +++ b/src/Parser.coffee @@ -334,17 +334,16 @@ class Parser if indent is newIndent removeComments = not removeCommentsPattern.test @currentLine - if isItUnindentedCollection and not @isStringUnIndentedCollectionItem(@currentLine) and indent is newIndent - @moveToPreviousLine() - break + if removeComments and @isCurrentLineComment() + continue if @isCurrentLineBlank() data.push @currentLine[newIndent..] continue - if removeComments and @isCurrentLineComment() - if indent is newIndent - continue + if isItUnindentedCollection and not @isStringUnIndentedCollectionItem(@currentLine) and indent is newIndent + @moveToPreviousLine() + break if indent >= newIndent data.push @currentLine[newIndent..] |