summaryrefslogtreecommitdiff
path: root/vendor/gopkg.in/yaml.v3/scannerc.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-10-02 06:13:25 -0400
committerGitHub <noreply@github.com>2020-10-02 06:13:25 -0400
commit00c7b493a0565205aa054be7708281874163c85d (patch)
treeef43b932450ef34f26ae3b8d1dda53aab752c760 /vendor/gopkg.in/yaml.v3/scannerc.go
parent0b7b22243798650841cd9b790809a0a482f4cbcb (diff)
parent5aead1509c681de533b8966e781e15327fe35ab6 (diff)
downloadpodman-00c7b493a0565205aa054be7708281874163c85d.tar.gz
podman-00c7b493a0565205aa054be7708281874163c85d.tar.bz2
podman-00c7b493a0565205aa054be7708281874163c85d.zip
Merge pull request #7815 from jwhonce/wip/creds_remote
Add X-Registry-Config support
Diffstat (limited to 'vendor/gopkg.in/yaml.v3/scannerc.go')
-rw-r--r--vendor/gopkg.in/yaml.v3/scannerc.go21
1 files changed, 12 insertions, 9 deletions
diff --git a/vendor/gopkg.in/yaml.v3/scannerc.go b/vendor/gopkg.in/yaml.v3/scannerc.go
index 57e954ca5..d9a539c39 100644
--- a/vendor/gopkg.in/yaml.v3/scannerc.go
+++ b/vendor/gopkg.in/yaml.v3/scannerc.go
@@ -749,6 +749,11 @@ func yaml_parser_fetch_next_token(parser *yaml_parser_t) (ok bool) {
if !ok {
return
}
+ if len(parser.tokens) > 0 && parser.tokens[len(parser.tokens)-1].typ == yaml_BLOCK_ENTRY_TOKEN {
+ // Sequence indicators alone have no line comments. It becomes
+ // a head comment for whatever follows.
+ return
+ }
if !yaml_parser_scan_line_comment(parser, comment_mark) {
ok = false
return
@@ -2856,13 +2861,12 @@ func yaml_parser_scan_line_comment(parser *yaml_parser_t, token_mark yaml_mark_t
return false
}
skip_line(parser)
- } else {
- if parser.mark.index >= seen {
- if len(text) == 0 {
- start_mark = parser.mark
- }
- text = append(text, parser.buffer[parser.buffer_pos])
+ } else if parser.mark.index >= seen {
+ if len(text) == 0 {
+ start_mark = parser.mark
}
+ text = read(parser, text)
+ } else {
skip(parser)
}
}
@@ -2999,10 +3003,9 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo
return false
}
skip_line(parser)
+ } else if parser.mark.index >= seen {
+ text = read(parser, text)
} else {
- if parser.mark.index >= seen {
- text = append(text, parser.buffer[parser.buffer_pos])
- }
skip(parser)
}
}