mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Allow NL value termination for arrays
This commit is contained in:
@@ -367,7 +367,7 @@ func lexArrayValue(lx *lexer) stateFn {
|
|||||||
func lexArrayValueEnd(lx *lexer) stateFn {
|
func lexArrayValueEnd(lx *lexer) stateFn {
|
||||||
r := lx.next()
|
r := lx.next()
|
||||||
switch {
|
switch {
|
||||||
case isWhitespace(r) || isNL(r):
|
case isWhitespace(r):
|
||||||
return lexSkip(lx, lexArrayValueEnd)
|
return lexSkip(lx, lexArrayValueEnd)
|
||||||
case r == commentHashStart:
|
case r == commentHashStart:
|
||||||
lx.push(lexArrayValueEnd)
|
lx.push(lexArrayValueEnd)
|
||||||
@@ -380,7 +380,7 @@ func lexArrayValueEnd(lx *lexer) stateFn {
|
|||||||
}
|
}
|
||||||
lx.backup()
|
lx.backup()
|
||||||
fallthrough
|
fallthrough
|
||||||
case r == arrayValTerm:
|
case r == arrayValTerm || isNL(r):
|
||||||
return lexSkip(lx, lexArrayValue) // Move onto next
|
return lexSkip(lx, lexArrayValue) // Move onto next
|
||||||
case r == arrayEnd:
|
case r == arrayEnd:
|
||||||
return lexArrayEnd
|
return lexArrayEnd
|
||||||
|
|||||||
Reference in New Issue
Block a user