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
a853a7a1
Commit
a853a7a1
authored
Oct 31, 2011
by
beder
Browse files
Fixed emitter bug with colon at the end of a scalar in a flow collection
parent
e4e410af
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
src/exp.h
src/exp.h
+1
-1
test/emittertests.cpp
test/emittertests.cpp
+7
-0
No files found.
src/exp.h
View file @
a853a7a1
...
...
@@ -149,7 +149,7 @@ namespace YAML
return
e
;
}
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
;
}
...
...
test/emittertests.cpp
View file @
a853a7a1
...
...
@@ -790,6 +790,12 @@ namespace Test
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
)
{
out
<<
YAML
::
BeginSeq
;
...
...
@@ -1068,6 +1074,7 @@ namespace Test
RunEmitterTest
(
&
Emitter
::
EmptyBinary
,
"empty binary"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
ColonAtEndOfScalar
,
"colon at end of 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
::
DocStartAndEnd
,
"doc start and end"
,
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