-
Notifications
You must be signed in to change notification settings - Fork 115
add source locations tracking #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0c8c8f8
to
41bd851
Compare
Codecov Report
@@ Coverage Diff @@
## master #168 +/- ##
==========================================
+ Coverage 96.41% 96.69% +0.27%
==========================================
Files 63 68 +5
Lines 12905 14393 +1488
==========================================
+ Hits 12443 13917 +1474
- Misses 462 476 +14
Continue to review full report at Codecov.
|
773a029
to
19d533f
Compare
23f4b8c
to
9a1d0e6
Compare
9a1d0e6
to
b0b7591
Compare
7034f8f
to
33be969
Compare
2ea3d61
to
dbdbec9
Compare
add a macro to simplify using the callbacks structure
dbdbec9
to
e02ddac
Compare
bfb0732
to
8161add
Compare
Nice, I will test this whenever I get the chance. One thing I thought when reading the PR description: for calling |
ea8f5e3
to
e375143
Compare
[skip all] [only samples]
e375143
to
070504d
Compare
Fixes #164.
New features
Parser
:source()
andfilename()
to get the latest buffer and filename to be parsedcallbacks()
to get the parser's callbacksBreaking changes
As part of the work above, opportunity was taken to address a number of pre-existing API issues. These changes consisted of:
c4::yml::parse()
andc4::yml::Parser::parse()
overloads; all these functions will be shortly removed. Until removal, any call from client code will trigger a compiler warning.parse()
alternatives, eitherparse_in_place()
orparse_in_arena()
:parse_in_place()
receives onlysubstr
buffers, ie mutable YAML source buffers. Trying to pass acsubstr
buffer toparse_in_place()
will cause a compile error:parse_in_arena()
receives onlycsubstr
buffers, ie immutable YAML source buffers. Prior to parsing, the buffer is copied to the tree's arena, then the copy is parsed in place. Becauseparse_in_arena()
is meant for immutable buffers, overloads receiving asubstr
YAML buffer are now declared and marked deprecated, and intentionally left undefined, such that callingparse_in_arena()
with asubstr
will cause a linker error.substr
is implicitly convertible tocsubstr
. If you really intend to parse an originally mutable buffer in the tree's arena, convert it first to immutable by assigning thesubstr
to acsubstr
prior to callingparse_in_arena()
:parse_in_place()
becausecsubstr
is not implicitly convertible tosubstr
.ryml.parse()
was removed and not just deprecated; theparse_in_arena()
andparse_in_place()
now replace this.Callbacks
: changed behavior inParser
andTree
: