Skip to content

Commit

Permalink
Merge pull request #95 from goccy/feature/fix-handling-of-sequence-in…
Browse files Browse the repository at this point in the history
…dicator

Fix handling of sequence indicator
  • Loading branch information
goccy authored Mar 7, 2020
2 parents 142d152 + 0204fca commit 6bf031d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,24 @@ a - b - c: value
`,
`
a - b - c: value
`,
},
{
`
a:
-
b: c
d: e
-
f: g
h: i
`,
`
a:
- b: c
d: e
- f: g
h: i
`,
},
}
Expand Down
2 changes: 1 addition & 1 deletion scanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ func (s *Scanner) scan(ctx *Context) (pos int) {
continue
}
nc := ctx.nextChar()
if nc == ' ' {
if nc == ' ' || s.isNewLineChar(nc) {
s.addBufferedTokenIfExists(ctx)
ctx.addOriginBuf(c)
tk := token.SequenceEntry(string(ctx.obuf), s.pos())
Expand Down

0 comments on commit 6bf031d

Please sign in to comment.