Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
yaml-cpp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Third Party Mirrors
yaml-cpp
Commits
5217149e
Commit
5217149e
authored
15 years ago
by
Jesse Beder
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bug with complex keys (and simplified the parsing for flow maps)
parent
e7ac6b3b
No related branches found
Branches containing commit
Tags
release-0.2.7
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/map.cpp
+8
-11
8 additions, 11 deletions
src/map.cpp
src/scantoken.cpp
+0
-3
0 additions, 3 deletions
src/scantoken.cpp
yaml-reader/spectests.cpp
+2
-2
2 additions, 2 deletions
yaml-reader/spectests.cpp
with
10 additions
and
16 deletions
src/map.cpp
+
8
−
11
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
)
...
...
This diff is collapsed.
Click to expand it.
src/scantoken.cpp
+
0
−
3
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
();
...
...
This diff is collapsed.
Click to expand it.
yaml-reader/spectests.cpp
+
2
−
2
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"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment