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
337cb553
Commit
337cb553
authored
Dec 03, 2010
by
Jesse Beder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed emitting colon at end of scalar bug
parent
99089bf2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
3 deletions
+26
-3
CMakeLists.txt
+2
-2
src/regeximpl.h
+7
-1
test/emittertests.cpp
+17
-0
No files found.
CMakeLists.txt
View file @
337cb553
...
...
@@ -5,8 +5,8 @@ project (YAML_CPP)
set
(
LIB_TYPE SHARED
)
if
(
IPHONE
)
set
(
CMAKE_OSX_SYSROOT iphoneos4.
0
)
set
(
CMAKE_OSX_ARCHITECTURES
$
(
ARCHS_STANDARD_32_BIT
)
)
set
(
CMAKE_OSX_SYSROOT iphoneos4.
2
)
set
(
CMAKE_OSX_ARCHITECTURES
"armv6;armv7"
)
set
(
LIB_TYPE
)
endif
(
IPHONE
)
...
...
src/regeximpl.h
View file @
337cb553
...
...
@@ -58,7 +58,13 @@ namespace YAML
template
<>
inline
bool
RegEx
::
IsValidSource
<
StringCharSource
>
(
const
StringCharSource
&
source
)
const
{
return
source
||
m_op
==
REGEX_EMPTY
;
switch
(
m_op
)
{
case
REGEX_MATCH
:
case
REGEX_RANGE
:
return
source
;
default
:
return
true
;
}
}
template
<
typename
Source
>
...
...
test/emittertests.cpp
View file @
337cb553
...
...
@@ -726,6 +726,21 @@ namespace Test
out
<<
YAML
::
Binary
(
""
,
0
);
desiredOutput
=
"--- !!binary
\"\"
"
;
}
void
ColonAtEndOfScalar
(
YAML
::
Emitter
&
out
,
std
::
string
&
desiredOutput
)
{
out
<<
"a:"
;
desiredOutput
=
"---
\"
a:
\"
"
;
}
void
ColonAsScalar
(
YAML
::
Emitter
&
out
,
std
::
string
&
desiredOutput
)
{
out
<<
YAML
::
BeginMap
;
out
<<
YAML
::
Key
<<
"apple"
<<
YAML
::
Value
<<
":"
;
out
<<
YAML
::
Key
<<
"banana"
<<
YAML
::
Value
<<
":"
;
out
<<
YAML
::
EndMap
;
desiredOutput
=
"---
\n
apple:
\"
:
\"\n
banana:
\"
:
\"
"
;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
// incorrect emitting
...
...
@@ -916,6 +931,8 @@ namespace Test
RunEmitterTest
(
&
Emitter
::
Binary
,
"binary"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
LongBinary
,
"long binary"
,
passed
,
total
);
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
);
RunEmitterErrorTest
(
&
Emitter
::
ExtraEndSeq
,
"extra EndSeq"
,
passed
,
total
);
RunEmitterErrorTest
(
&
Emitter
::
ExtraEndMap
,
"extra EndMap"
,
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