You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Inside {}'s, or []'s only identifier like keys or values. There isn't a good way to handle unquoted values inside of these, because of examples like 'a: 1, b: 2'
For maps, we have to pick and choose between nesting and error handling.
Scan the line for ':' followed by a space or a newline.
Error out if line/word starts with YAML controls ``@%!"'
if the line ends in a :, and does not contain "'s or spaces, then it is a bare key, and the next line must be indented further in, and be the start of an indented list, or new indented map)
If the line has one ': ', then split it into key, value. Key must not have spaces.
If value starts with a {, [, ',", or -+0123456789, parse as normal
Or take entire line, trimming whitespace at end and front, as value
For indented lists we can do the same, handling a value in the same way as a map,
search for a {, [, ',", or -+0123456789 and parse as normal.
Or take entire line, trimming whitespace at end and front, as value
Note: Because of negative numbers, nesting lists complicate nesting
However, a - name: foo can work.
The text was updated successfully, but these errors were encountered:
tef
changed the title
Proposal:
Proposal: --fix-unquoted doing line at a time repair
Jan 23, 2018
Unquoted handling:
For Inside
{}
's, or[]
's only identifier like keys or values. There isn't a good way to handle unquoted values inside of these, because of examples like 'a: 1, b: 2'For maps, we have to pick and choose between nesting and error handling.
Scan the line for ':' followed by a space or a newline.
Error out if line/word starts with YAML controls ``@
%!"'
if the line ends in a
:
, and does not contain"'
s or spaces, then it is a bare key, and the next line must be indented further in, and be the start of an indented list, or new indented map)If the line has one ': ', then split it into key, value. Key must not have spaces.
If value starts with a
{
,[
,'
,"
, or-+0123456789
, parse as normalOr take entire line, trimming whitespace at end and front, as value
For indented lists we can do the same, handling a value in the same way as a map,
{
,[
,'
,"
, or-+0123456789
and parse as normal.Note: Because of negative numbers, nesting lists complicate nesting
However, a
- name: foo
can work.The text was updated successfully, but these errors were encountered: