Skip to content

Commit

Permalink
mikefarah#607 Fix string value with spaces error
Browse files Browse the repository at this point in the history
  • Loading branch information
djajcevic committed Dec 21, 2020
1 parent 57cd67f commit ed71b03
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions pkg/yqlib/operator_assign_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ var assignOperatorScenarios = []expressionScenario{
"D0, P[], ()::a:\n b: cat\nx: frog\n",
},
},
{
description: "Create yaml file with value with spaces",
expression: `.a.b = "cat" | .x = "frog jumps"`,
expected: []string{
"D0, P[], ()::a:\n b: cat\nx: frog jumps\n",
},
},
{
description: "Update node to be the child value",
document: `{a: {b: {g: foof}}}`,
Expand Down
2 changes: 1 addition & 1 deletion pkg/yqlib/path_tokeniser.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func initLexer() (*lex.Lexer, error) {
lexer.Add([]byte(`[Nn][Uu][Ll][Ll]`), nullValue())
lexer.Add([]byte(`~`), nullValue())

lexer.Add([]byte(`"[^ "]*"`), stringValue(true))
lexer.Add([]byte(`"[^"]*"`), stringValue(true))

lexer.Add([]byte(`\[\]`), literalToken(SplatOrEmptyCollect, true))

Expand Down

0 comments on commit ed71b03

Please sign in to comment.