mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Fixed bug with block comments inside maps
This commit is contained in:
15
conf/lex.go
15
conf/lex.go
@@ -408,6 +408,18 @@ func lexMapKeyStart(lx *lexer) stateFn {
|
||||
case r == mapEnd:
|
||||
lx.next()
|
||||
return lexSkip(lx, lexMapEnd)
|
||||
case r == commentHashStart:
|
||||
lx.next()
|
||||
lx.push(lexMapKeyStart)
|
||||
return lexCommentStart
|
||||
case r == commentSlashStart:
|
||||
lx.next()
|
||||
rn := lx.next()
|
||||
if rn == commentSlashStart {
|
||||
lx.push(lexMapKeyStart)
|
||||
return lexCommentStart
|
||||
}
|
||||
lx.backup()
|
||||
}
|
||||
lx.ignore()
|
||||
lx.next()
|
||||
@@ -462,8 +474,7 @@ func lexMapValue(lx *lexer) stateFn {
|
||||
lx.backup()
|
||||
fallthrough
|
||||
case r == mapValTerm:
|
||||
return lx.errorf("Unexpected map value terminator '%s'.",
|
||||
mapValTerm)
|
||||
return lx.errorf("Unexpected map value terminator '%s'.", mapValTerm)
|
||||
case r == mapEnd:
|
||||
return lexSkip(lx, lexMapEnd)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user