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
676e0b94
Commit
676e0b94
authored
May 22, 2012
by
Jesse Beder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed flow seq/map indentation
parent
0e3e6791
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
src/emitter.cpp
+3
-6
test/emittertests.cpp
+1
-1
No files found.
src/emitter.cpp
View file @
676e0b94
...
@@ -339,7 +339,6 @@ namespace YAML
...
@@ -339,7 +339,6 @@ namespace YAML
void
Emitter
::
FlowSeqPrepareNode
(
EmitterNodeType
::
value
child
)
void
Emitter
::
FlowSeqPrepareNode
(
EmitterNodeType
::
value
child
)
{
{
const
unsigned
curIndent
=
m_pState
->
CurIndent
();
const
unsigned
lastIndent
=
m_pState
->
LastIndent
();
const
unsigned
lastIndent
=
m_pState
->
LastIndent
();
if
(
!
m_pState
->
HasBegunNode
())
{
if
(
!
m_pState
->
HasBegunNode
())
{
...
@@ -359,7 +358,7 @@ namespace YAML
...
@@ -359,7 +358,7 @@ namespace YAML
case
EmitterNodeType
:
:
Scalar
:
case
EmitterNodeType
:
:
Scalar
:
case
EmitterNodeType
:
:
FlowSeq
:
case
EmitterNodeType
:
:
FlowSeq
:
case
EmitterNodeType
:
:
FlowMap
:
case
EmitterNodeType
:
:
FlowMap
:
SpaceOrIndentTo
(
m_pState
->
HasBegunContent
()
||
m_pState
->
CurGroupChildCount
()
>
0
,
cur
Indent
);
SpaceOrIndentTo
(
m_pState
->
HasBegunContent
()
||
m_pState
->
CurGroupChildCount
()
>
0
,
last
Indent
);
break
;
break
;
case
EmitterNodeType
:
:
BlockSeq
:
case
EmitterNodeType
:
:
BlockSeq
:
case
EmitterNodeType
:
:
BlockMap
:
case
EmitterNodeType
:
:
BlockMap
:
...
@@ -431,7 +430,6 @@ namespace YAML
...
@@ -431,7 +430,6 @@ namespace YAML
void
Emitter
::
FlowMapPrepareSimpleKey
(
EmitterNodeType
::
value
child
)
void
Emitter
::
FlowMapPrepareSimpleKey
(
EmitterNodeType
::
value
child
)
{
{
const
unsigned
curIndent
=
m_pState
->
CurIndent
();
const
unsigned
lastIndent
=
m_pState
->
LastIndent
();
const
unsigned
lastIndent
=
m_pState
->
LastIndent
();
if
(
!
m_pState
->
HasBegunNode
())
{
if
(
!
m_pState
->
HasBegunNode
())
{
...
@@ -451,7 +449,7 @@ namespace YAML
...
@@ -451,7 +449,7 @@ namespace YAML
case
EmitterNodeType
:
:
Scalar
:
case
EmitterNodeType
:
:
Scalar
:
case
EmitterNodeType
:
:
FlowSeq
:
case
EmitterNodeType
:
:
FlowSeq
:
case
EmitterNodeType
:
:
FlowMap
:
case
EmitterNodeType
:
:
FlowMap
:
SpaceOrIndentTo
(
m_pState
->
HasBegunContent
()
||
m_pState
->
CurGroupChildCount
()
>
0
,
cur
Indent
);
SpaceOrIndentTo
(
m_pState
->
HasBegunContent
()
||
m_pState
->
CurGroupChildCount
()
>
0
,
last
Indent
);
break
;
break
;
case
EmitterNodeType
:
:
BlockSeq
:
case
EmitterNodeType
:
:
BlockSeq
:
case
EmitterNodeType
:
:
BlockMap
:
case
EmitterNodeType
:
:
BlockMap
:
...
@@ -462,7 +460,6 @@ namespace YAML
...
@@ -462,7 +460,6 @@ namespace YAML
void
Emitter
::
FlowMapPrepareSimpleKeyValue
(
EmitterNodeType
::
value
child
)
void
Emitter
::
FlowMapPrepareSimpleKeyValue
(
EmitterNodeType
::
value
child
)
{
{
const
unsigned
curIndent
=
m_pState
->
CurIndent
();
const
unsigned
lastIndent
=
m_pState
->
LastIndent
();
const
unsigned
lastIndent
=
m_pState
->
LastIndent
();
if
(
!
m_pState
->
HasBegunNode
())
{
if
(
!
m_pState
->
HasBegunNode
())
{
...
@@ -479,7 +476,7 @@ namespace YAML
...
@@ -479,7 +476,7 @@ namespace YAML
case
EmitterNodeType
:
:
Scalar
:
case
EmitterNodeType
:
:
Scalar
:
case
EmitterNodeType
:
:
FlowSeq
:
case
EmitterNodeType
:
:
FlowSeq
:
case
EmitterNodeType
:
:
FlowMap
:
case
EmitterNodeType
:
:
FlowMap
:
SpaceOrIndentTo
(
m_pState
->
HasBegunContent
()
||
m_pState
->
CurGroupChildCount
()
>
0
,
cur
Indent
);
SpaceOrIndentTo
(
m_pState
->
HasBegunContent
()
||
m_pState
->
CurGroupChildCount
()
>
0
,
last
Indent
);
break
;
break
;
case
EmitterNodeType
:
:
BlockSeq
:
case
EmitterNodeType
:
:
BlockSeq
:
case
EmitterNodeType
:
:
BlockMap
:
case
EmitterNodeType
:
:
BlockMap
:
...
...
test/emittertests.cpp
View file @
676e0b94
...
@@ -205,7 +205,7 @@ namespace Test
...
@@ -205,7 +205,7 @@ namespace Test
out
<<
YAML
::
Value
<<
"angel"
;
out
<<
YAML
::
Value
<<
"angel"
;
out
<<
YAML
::
EndMap
;
out
<<
YAML
::
EndMap
;
desiredOutput
=
"? - 1
\n
- 3
\n
: monster
\n
? [2, 0]
\n
: demon
\n
the origin: angel"
;
desiredOutput
=
"? - 1
\n
- 3
\n
: monster
\n
[2, 0]
: demon
\n
the origin: angel"
;
}
}
void
ScalarFormat
(
YAML
::
Emitter
&
out
,
std
::
string
&
desiredOutput
)
void
ScalarFormat
(
YAML
::
Emitter
&
out
,
std
::
string
&
desiredOutput
)
...
...
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