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
5217149e
Commit
5217149e
authored
Sep 06, 2009
by
Jesse Beder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug with complex keys (and simplified the parsing for flow maps)
parent
e7ac6b3b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
16 deletions
+10
-16
src/map.cpp
+8
-11
src/scantoken.cpp
+0
-3
yaml-reader/spectests.cpp
+2
-2
No files found.
src/map.cpp
View file @
5217149e
...
...
@@ -122,24 +122,21 @@ namespace YAML
pScanner
->
pop
();
break
;
}
// now it better be a key
if
(
token
.
type
!=
Token
::
KEY
)
throw
ParserException
(
token
.
mark
,
ErrorMsg
::
END_OF_MAP_FLOW
);
pScanner
->
pop
();
std
::
auto_ptr
<
Node
>
pKey
(
new
Node
),
pValue
(
new
Node
);
// grab key
pKey
->
Parse
(
pScanner
,
state
);
// grab key (if non-null)
if
(
token
.
type
==
Token
::
KEY
)
{
pScanner
->
pop
();
pKey
->
Parse
(
pScanner
,
state
);
}
// now grab value (optional)
if
(
!
pScanner
->
empty
()
&&
pScanner
->
peek
().
type
==
Token
::
VALUE
)
{
pScanner
->
pop
();
pValue
->
Parse
(
pScanner
,
state
);
}
// now eat the separator (or could be a map end, which we ignore - but if it's neither, then it's a bad node)
Token
&
nextToken
=
pScanner
->
peek
();
if
(
nextToken
.
type
==
Token
::
FLOW_ENTRY
)
...
...
src/scantoken.cpp
View file @
5217149e
...
...
@@ -182,9 +182,6 @@ namespace YAML
// Value
void
Scanner
::
ScanValue
()
{
// just in case we have an empty key
InsertPotentialSimpleKey
();
// and check that simple key
bool
isSimpleKey
=
VerifySimpleKey
();
...
...
yaml-reader/spectests.cpp
View file @
5217149e
...
...
@@ -325,8 +325,8 @@ namespace Test {
parser
.
GetNextDocument
(
doc
);
YAML_ASSERT
(
doc
.
size
()
==
2
);
YAML_ASSERT
(
doc
[
Pair
(
"Detroit Tigers"
,
"Chicago
C
ubs"
)].
size
()
==
1
);
YAML_ASSERT
(
doc
[
Pair
(
"Detroit Tigers"
,
"Chicago
C
ubs"
)][
0
]
==
"2001-07-23"
);
YAML_ASSERT
(
doc
[
Pair
(
"Detroit Tigers"
,
"Chicago
c
ubs"
)].
size
()
==
1
);
YAML_ASSERT
(
doc
[
Pair
(
"Detroit Tigers"
,
"Chicago
c
ubs"
)][
0
]
==
"2001-07-23"
);
YAML_ASSERT
(
doc
[
Pair
(
"New York Yankees"
,
"Atlanta Braves"
)].
size
()
==
3
);
YAML_ASSERT
(
doc
[
Pair
(
"New York Yankees"
,
"Atlanta Braves"
)][
0
]
==
"2001-07-02"
);
YAML_ASSERT
(
doc
[
Pair
(
"New York Yankees"
,
"Atlanta Braves"
)][
1
]
==
"2001-08-12"
);
...
...
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