Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
yaml-cpp
Commits
f1697dea
Commit
f1697dea
authored
Oct 22, 2010
by
Jesse Beder
Browse files
Refactored emitter so that it emits the : for an implicit key right away
parent
6b7cb45a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
src/emitter.cpp
src/emitter.cpp
+9
-5
No files found.
src/emitter.cpp
View file @
f1697dea
...
...
@@ -201,10 +201,6 @@ namespace YAML
m_pState
->
SetError
(
ErrorMsg
::
EXPECTED_VALUE_TOKEN
);
return
true
;
case
ES_WAITING_FOR_BLOCK_MAP_VALUE
:
if
(
m_pState
->
CurrentlyInLongKey
())
m_stream
<<
IndentTo
(
curIndent
);
m_stream
<<
':'
;
m_pState
->
RequireSeparation
();
m_pState
->
SwitchState
(
ES_WRITING_BLOCK_MAP_VALUE
);
return
true
;
case
ES_WRITING_BLOCK_MAP_VALUE
:
...
...
@@ -286,6 +282,10 @@ namespace YAML
// block map
case
ES_WRITING_BLOCK_MAP_KEY
:
if
(
!
m_pState
->
CurrentlyInLongKey
())
{
m_stream
<<
':'
;
m_pState
->
RequireSeparation
();
}
m_pState
->
SwitchState
(
ES_DONE_WITH_BLOCK_MAP_KEY
);
break
;
case
ES_WRITING_BLOCK_MAP_VALUE
:
...
...
@@ -499,8 +499,12 @@ namespace YAML
return
m_pState
->
SetError
(
ErrorMsg
::
UNEXPECTED_VALUE_TOKEN
);
if
(
flowType
==
FT_BLOCK
)
{
if
(
m_pState
->
CurrentlyInLongKey
())
if
(
m_pState
->
CurrentlyInLongKey
())
{
m_stream
<<
'\n'
;
m_stream
<<
IndentTo
(
m_pState
->
GetCurIndent
());
m_stream
<<
':'
;
m_pState
->
RequireSeparation
();
}
m_pState
->
SwitchState
(
ES_WAITING_FOR_BLOCK_MAP_VALUE
);
}
else
if
(
flowType
==
FT_FLOW
)
{
m_pState
->
SwitchState
(
ES_WAITING_FOR_FLOW_MAP_VALUE
);
...
...
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