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
62634f53
Commit
62634f53
authored
Oct 31, 2011
by
Jesse Beder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed emitter bug with colon at the end of a scalar in a flow collection
parent
860365b2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
+8
-1
src/exp.h
+1
-1
test/emittertests.cpp
+7
-0
No files found.
src/exp.h
View file @
62634f53
...
@@ -149,7 +149,7 @@ namespace YAML
...
@@ -149,7 +149,7 @@ namespace YAML
return
e
;
return
e
;
}
}
inline
const
RegEx
&
EndScalarInFlow
()
{
inline
const
RegEx
&
EndScalarInFlow
()
{
static
const
RegEx
e
=
(
RegEx
(
':'
)
+
(
BlankOrBreak
()
||
RegEx
(
",]}"
,
REGEX_OR
)))
||
RegEx
(
",?[]{}"
,
REGEX_OR
);
static
const
RegEx
e
=
(
RegEx
(
':'
)
+
(
BlankOrBreak
()
||
RegEx
(
)
||
RegEx
(
",]}"
,
REGEX_OR
)))
||
RegEx
(
",?[]{}"
,
REGEX_OR
);
return
e
;
return
e
;
}
}
...
...
test/emittertests.cpp
View file @
62634f53
...
@@ -790,6 +790,12 @@ namespace Test
...
@@ -790,6 +790,12 @@ namespace Test
desiredOutput
=
"apple:
\"
:
\"\n
banana:
\"
:
\"
"
;
desiredOutput
=
"apple:
\"
:
\"\n
banana:
\"
:
\"
"
;
}
}
void
ColonAtEndOfScalarInFlow
(
YAML
::
Emitter
&
out
,
std
::
string
&
desiredOutput
)
{
out
<<
YAML
::
Flow
<<
YAML
::
BeginMap
<<
YAML
::
Key
<<
"C:"
<<
YAML
::
Value
<<
"C:"
<<
YAML
::
EndMap
;
desiredOutput
=
"{
\"
C:
\"
:
\"
C:
\"
}"
;
}
void
BoolFormatting
(
YAML
::
Emitter
&
out
,
std
::
string
&
desiredOutput
)
void
BoolFormatting
(
YAML
::
Emitter
&
out
,
std
::
string
&
desiredOutput
)
{
{
out
<<
YAML
::
BeginSeq
;
out
<<
YAML
::
BeginSeq
;
...
@@ -1068,6 +1074,7 @@ namespace Test
...
@@ -1068,6 +1074,7 @@ namespace Test
RunEmitterTest
(
&
Emitter
::
EmptyBinary
,
"empty binary"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
EmptyBinary
,
"empty binary"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
ColonAtEndOfScalar
,
"colon at end of scalar"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
ColonAtEndOfScalar
,
"colon at end of scalar"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
ColonAsScalar
,
"colon as scalar"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
ColonAsScalar
,
"colon as scalar"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
ColonAtEndOfScalarInFlow
,
"colon at end of scalar in flow"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
BoolFormatting
,
"bool formatting"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
BoolFormatting
,
"bool formatting"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
DocStartAndEnd
,
"doc start and end"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
DocStartAndEnd
,
"doc start and end"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
ImplicitDocStart
,
"implicit doc start"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
ImplicitDocStart
,
"implicit doc start"
,
passed
,
total
);
...
...
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