Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yaml-cpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
yaml-cpp
Commits
ae06a40f
Commit
ae06a40f
authored
Oct 22, 2009
by
Jesse Beder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to flow sequence when emitting an empty sequence
parent
315b0006
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
src/emitter.cpp
+11
-4
No files found.
src/emitter.cpp
View file @
ae06a40f
...
...
@@ -349,12 +349,18 @@ namespace YAML
EMITTER_STATE
curState
=
m_pState
->
GetCurState
();
FLOW_TYPE
flowType
=
m_pState
->
GetCurGroupFlowType
();
if
(
flowType
==
FT_BLOCK
)
assert
(
curState
==
ES_DONE_WITH_BLOCK_SEQ_ENTRY
);
else
if
(
flowType
==
FT_FLOW
)
{
m_stream
<<
"]"
;
if
(
flowType
==
FT_BLOCK
)
{
// Note: block sequences are *not* allowed to be empty, but we convert it
// to a flow sequence if it is
assert
(
curState
==
ES_DONE_WITH_BLOCK_SEQ_ENTRY
||
curState
==
ES_WAITING_FOR_BLOCK_SEQ_ENTRY
);
if
(
curState
==
ES_WAITING_FOR_BLOCK_SEQ_ENTRY
)
{
unsigned
curIndent
=
m_pState
->
GetCurIndent
();
m_stream
<<
IndentTo
(
curIndent
)
<<
"[]"
;
}
}
else
if
(
flowType
==
FT_FLOW
)
{
// Note: flow sequences are allowed to be empty
assert
(
curState
==
ES_DONE_WITH_FLOW_SEQ_ENTRY
||
curState
==
ES_WAITING_FOR_FLOW_SEQ_ENTRY
);
m_stream
<<
"]"
;
}
else
assert
(
false
);
...
...
@@ -685,3 +691,4 @@ namespace YAML
return
*
this
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment