Skip to content

Commit

Permalink
fix plain-url-in-flow-mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
goccy committed Dec 9, 2024
1 parent 0e95011 commit 7a84d32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions scanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,10 @@ func (s *Scanner) scanMapDelim(ctx *Context) (bool, error) {
if s.startedFlowMapNum <= 0 && nc != ' ' && nc != '\t' && !s.isNewLineChar(nc) && !ctx.isNextEOS() {
return false, nil
}
if s.startedFlowMapNum > 0 && nc == '/' {
// like http://
return false, nil
}

if strings.HasPrefix(strings.TrimPrefix(string(ctx.obuf), " "), "\t") && !strings.HasPrefix(string(ctx.buf), "\t") {
invalidTk := token.Invalid("tab character cannot use as a map key directly", string(ctx.obuf), s.pos())
Expand Down
1 change: 0 additions & 1 deletion yaml_test_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ var failureTestNames = []string{
"nested-implicit-complex-keys", // no json.
"node-anchor-not-indented", // pass yamlv3.
"plain-dashes-in-flow-sequence",
"plain-url-in-flow-mapping", // pass yamlv3.
"question-mark-edge-cases/00", // no json.
"question-mark-edge-cases/01", // no json.
"scalar-value-with-two-anchors", // pass yamlv3.
Expand Down

0 comments on commit 7a84d32

Please sign in to comment.