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
db6deedc
Unverified
Commit
db6deedc
authored
Jul 23, 2021
by
Snow Pettersen
Committed by
GitHub
Jul 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include name of anchor in invalid anchor error (#1015)
parent
79aa6d53
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
include/yaml-cpp/exceptions.h
+1
-1
src/singledocparser.cpp
+5
-2
No files found.
include/yaml-cpp/exceptions.h
View file @
db6deedc
...
@@ -65,7 +65,7 @@ const char* const ZERO_INDENT_IN_BLOCK =
...
@@ -65,7 +65,7 @@ const char* const ZERO_INDENT_IN_BLOCK =
const
char
*
const
CHAR_IN_BLOCK
=
"unexpected character in block scalar"
;
const
char
*
const
CHAR_IN_BLOCK
=
"unexpected character in block scalar"
;
const
char
*
const
AMBIGUOUS_ANCHOR
=
const
char
*
const
AMBIGUOUS_ANCHOR
=
"cannot assign the same alias to multiple nodes"
;
"cannot assign the same alias to multiple nodes"
;
const
char
*
const
UNKNOWN_ANCHOR
=
"the referenced anchor is not defined"
;
const
char
*
const
UNKNOWN_ANCHOR
=
"the referenced anchor is not defined
:
"
;
const
char
*
const
INVALID_NODE
=
const
char
*
const
INVALID_NODE
=
"invalid node; this may result from using a map iterator as a sequence "
"invalid node; this may result from using a map iterator as a sequence "
...
...
src/singledocparser.cpp
View file @
db6deedc
...
@@ -424,8 +424,11 @@ anchor_t SingleDocParser::RegisterAnchor(const std::string& name) {
...
@@ -424,8 +424,11 @@ anchor_t SingleDocParser::RegisterAnchor(const std::string& name) {
anchor_t
SingleDocParser
::
LookupAnchor
(
const
Mark
&
mark
,
anchor_t
SingleDocParser
::
LookupAnchor
(
const
Mark
&
mark
,
const
std
::
string
&
name
)
const
{
const
std
::
string
&
name
)
const
{
auto
it
=
m_anchors
.
find
(
name
);
auto
it
=
m_anchors
.
find
(
name
);
if
(
it
==
m_anchors
.
end
())
if
(
it
==
m_anchors
.
end
())
{
throw
ParserException
(
mark
,
ErrorMsg
::
UNKNOWN_ANCHOR
);
std
::
stringstream
ss
;
ss
<<
ErrorMsg
::
UNKNOWN_ANCHOR
<<
name
;
throw
ParserException
(
mark
,
ss
.
str
());
}
return
it
->
second
;
return
it
->
second
;
}
}
...
...
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