Skip to content

Commit 0f96a00

Browse files
committed
refactor error API: update docs
1 parent 0e3aa92 commit 0f96a00

6 files changed

Lines changed: 1598 additions & 24 deletions

File tree

changelog/0.8.0.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Breaking changes
1+
### Breaking changes
22

33
- [BREAKING] Fix [#480](https://github.com/biojppm/rapidyaml/issues/480) ([PR#489](https://github.com/biojppm/rapidyaml/pull/489)):
44
- Deserializing an empty quoted string *will not* cause an error.
@@ -9,7 +9,7 @@
99
- [BREAKING] Fix [#477](https://github.com/biojppm/rapidyaml/issues/477) ([PR#479](https://github.com/biojppm/rapidyaml/pull/479)): changed `read<std::map>()` to overwrite existing entries. The provided implementations had an inconsistency between `std::map` (which wasn't overwriting) and `std::vector` (which *was* overwriting).
1010

1111

12-
## Fixes
12+
### Fixes
1313

1414
- [PR#488](https://github.com/biojppm/rapidyaml/pull/488):
1515
- add workarounds for problems with codegen of gcc 11,12,13.
@@ -36,7 +36,7 @@
3636
- [PR#499](https://github.com/biojppm/rapidyaml/pull/499): fix warnings with `-Wundef`.
3737

3838

39-
## Thanks
39+
### Thanks
4040

4141
- @ingydotnet
4242
- @perlpunk

changelog/current.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
1+
### Improvements
12

2-
## Fixes
3+
- [PR#503](https://github.com/biojppm/rapidyaml/pull/503) (fixes ): change error callbacks. Errors in ryml now have one of these types:
4+
- parse error: when parsing YAML/JSON. See: `pfn_error_parse`, `ErrorDataParse`, `ExceptionParse`, `err_parse_format()`.
5+
- visit error: when visiting a tree (reading or writing). See: `pfn_error_visit`, `ErrorDataVisit`, `ExceptionVisit`, `err_visit_format()`.
6+
- basic error: other, non specific errors. See: `pfn_error_basic`, `ErrorDataBasic`, `ExceptionBasic`, `err_basic_format()`.
7+
- parse and visit errors/exceptions can be treated/caught as basic errors/exceptions
8+
- Add message formatting functions to simplify implementation of error callbacks:
9+
- `err_parse_format()`
10+
- `err_visit_format()`
11+
- `err_basic_format()`
12+
- `location_format()`
13+
- `location_format_with_context()`: useful to create a rich error message showing the region causing the error.
14+
- The functions above receive are generic, and can be used to a function
15+
- `Location`:
316

4-
- [PR#503](https://github.com/biojppm/rapidyaml/pull/503): ensure parse error on `a: b: c` and similar cases containing nested maps opening on the same line.
17+
18+
### Fixes
19+
20+
- [PR#504](https://github.com/biojppm/rapidyaml/pull/504): ensure parse error on `a: b: c` and similar cases containing nested maps opening on the same line.
521
- [PR#502](https://github.com/biojppm/rapidyaml/pull/502): fix parse errors or missing tags:
622
- missing tags in empty documents:
723
```yaml

doc/Doxyfile

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -949,20 +949,21 @@ WARN_LOGFILE =
949949
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
950950
# Note: If this tag is empty the current directory is searched.
951951

952-
INPUT = \
953-
./doxy_main.md \
954-
../src \
955-
../test/test_suite/test_suite_event_handler.hpp \
956-
../test/test_suite/test_suite_event_handler.cpp \
957-
../samples/quickstart.cpp \
958-
../ext/c4core/src/c4/substr.hpp \
959-
../ext/c4core/src/c4/charconv.hpp \
960-
../ext/c4core/src/c4/format.hpp \
961-
../ext/c4core/src/c4/base64.hpp \
962-
../ext/c4core/src/c4/utf.hpp \
963-
../ext/c4core/src/c4/std/string.hpp \
964-
../ext/c4core/src/c4/std/string_view.hpp \
965-
../ext/c4core/src/c4/std/vector.hpp \
952+
INPUT = \
953+
./doxy_main.md \
954+
./doxy_changelog.md \
955+
../src \
956+
../test/test_suite/test_suite_event_handler.hpp \
957+
../test/test_suite/test_suite_event_handler.cpp \
958+
../samples/quickstart.cpp \
959+
../ext/c4core/src/c4/substr.hpp \
960+
../ext/c4core/src/c4/charconv.hpp \
961+
../ext/c4core/src/c4/format.hpp \
962+
../ext/c4core/src/c4/base64.hpp \
963+
../ext/c4core/src/c4/utf.hpp \
964+
../ext/c4core/src/c4/std/string.hpp \
965+
../ext/c4core/src/c4/std/string_view.hpp \
966+
../ext/c4core/src/c4/std/vector.hpp \
966967

967968
# This tag can be used to specify the character encoding of the source files
968969
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -1099,7 +1100,7 @@ EXCLUDE_SYMBOLS =
10991100
# that contain example code fragments that are included (see the \include
11001101
# command).
11011102

1102-
EXAMPLE_PATH =
1103+
EXAMPLE_PATH = ../changelog
11031104

11041105
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
11051106
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
@@ -1223,7 +1224,7 @@ STRIP_CODE_COMMENTS = NO
12231224
# entity all documented functions referencing it will be listed.
12241225
# The default value is: NO.
12251226

1226-
REFERENCED_BY_RELATION = YES
1227+
REFERENCED_BY_RELATION = NO
12271228

12281229
# If the REFERENCES_RELATION tag is set to YES then for each documented function
12291230
# all documented entities called/used by that function will be listed.

doc/Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ SPHINXOPTS ?=
77
SPHINXBUILD ?= sphinx-build
88
SOURCEDIR = .
99
BUILDDIR = _build
10+
CLANG ?= clang++
11+
DOXYGEN ?= doxygen #/home/jpmag/proj/doxygen/install/linux-x86_64-gxx14.2-Release/bin/doxygen
12+
DOXYGEN_OPTS ?= #-t
1013

1114
# Put it first so that "make" without argument is like "make help".
1215
help:
@@ -28,7 +31,11 @@ doxy:
2831
# ensure submodules are checked out
2932
if [ ! -f $(shell pwd)/../ext/c4core/cmake/c4Project.cmake ] ; then echo "ERROR: submodules not present" ; exit 1 ; fi
3033
if [ ! -f $(shell pwd)/../ext/c4core/src/c4/charconv.hpp ] ; then echo "ERROR: submodules not present" ; exit 1 ; fi
31-
doxygen Doxyfile
34+
## use cmake to generate a compile database
35+
#cmake -S .. -B "$(BUILDDIR)/proj" -DCMAKE_CXX_COMPILER=$(CLANG) -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
36+
#ln -fs "$(BUILDDIR)/proj/compile_commands.json" .
37+
## finally, run doxygen
38+
$(DOXYGEN) $(DOXYGEN_OPTS) Doxyfile
3239

3340
clean:
3441
rm -rf doxygen/

0 commit comments

Comments
 (0)