Commit Graph

993 Commits

Author SHA1 Message Date
Simon Gene Gottlieb
5d9e4b6251 patch: split fp_to_string.h into fptostring.h and fptostring.cpp 2024-11-07 15:14:36 -06:00
Simon Gene Gottlieb
28c0a1bc25 doc: add a little more information to dragonbox file 2024-11-07 15:14:36 -06:00
Simon Gene Gottlieb
72865f7d32 fix: remove trailing return types 2024-11-07 15:14:36 -06:00
Simon Gene Gottlieb
f4bca79dc4 fix: fp_to_string uses now 2 spaces 2024-11-07 15:14:36 -06:00
Simon Gene Gottlieb
d4e00bd473 fix: rename fp_to_string to FpToString to match coding style 2024-11-07 15:14:36 -06:00
Simon Gene Gottlieb
bd070a7b76 fix: prettier floating point numbers
Add dragonbox to compute the required precision to print floating point
numbers. This avoids uglification of floating point numbers that
happen by default via std::stringstream.

Numbers like 34.34 used to be converted to '34.340000000000003' as strings.
With this version they will be converted to the string '34.34'.

This fixes issue https://github.com/jbeder/yaml-cpp/issues/1289
2024-11-07 15:14:36 -06:00
Reini Urban
3d2888cc8a missing keys should throw InvalidNode, not BadConversion
Fixes GH #1274
2024-11-01 10:25:39 -05:00
Federico Di Pierro
c2bec4c755 chore(test): moved infiniteloop test to load_node_test suite.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-10-29 22:21:05 -05:00
Federico Di Pierro
29c59c01d4 new(test): added a test to avoid future issues with LoadAll().
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-10-29 22:21:05 -05:00
Federico Di Pierro
bc67157109 fix(src): avoid possible infinite loop in LoadAll().
Leave at first empty root.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-10-29 22:21:05 -05:00
Federico Di Pierro
da82fd982c chore(test/integration): refactor some test cases to their own test.
Plus, check that the content is what we actually expect.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-13 10:18:41 +02:00
Federico Di Pierro
1f2b841949 fix(src,include,test): fixed multiple cases where a bad yaml was accepted.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-13 10:18:41 +02:00
Orgad Shaneh
47cd2725d6 Remove build debug messages
They were commented out before 0733aeb45, but when that commit
was reverted in 2b65c65e1 they were recovered uncommented.
2024-08-27 12:23:42 -05:00
Orgad Shaneh
850ec4f39e Fix reference types in iterators
Amends 26faac387c.
2024-08-27 11:12:58 -05:00
Simon Gene Gottlieb
84459a7f98 fix: missing token enum name 2024-08-22 07:55:33 -05:00
Simon Gene Gottlieb
ee9c4d19be fix: parse files with '\r' symbols as line ending correctly 2024-08-22 07:53:52 -05:00
Cristian Le
b38ac5b55f Use FetchContent_MakeAvailable 2024-08-21 12:44:27 -05:00
Christopher Fore
7b469b4220 emitterutils: Explicitly include <cstdint>
GCC 15 will no longer include it by default, resulting in build
failures in projects that do not explicitly include it.

Error:
src/emitterutils.cpp:221:11: error: 'uint16_t' was not declared in this scope
  221 | std::pair<uint16_t, uint16_t> EncodeUTF16SurrogatePair(int codePoint) {
      |           ^~~~~~~~
src/emitterutils.cpp:13:1: note: 'uint16_t' is defined in header '<cstdint>';
this is probably fixable by adding '#include <cstdint>'
   12 | #include "yaml-cpp/null.h"
  +++ |+#include <cstdint>
   13 | #include "yaml-cpp/ostream_wrapper.h"

Tests pass.

Closes: #1307
See-also: https://gcc.gnu.org/pipermail/gcc-cvs/2024-August/407124.html
See-also: https://bugs.gentoo.org/937412
Signed-off-by: Christopher Fore <csfore@posteo.net>
2024-08-18 15:19:15 -05:00
Simon Gene Gottlieb
8fbf344aee doc, fix: invalid liquid '{{...}}' tags
jekyll/liquid got hung up on `{{"Daniel", 26}, {"Jesse", 24}}`.

The reason is that `{{...}}` are used as variables that are replaced by
there values. In this case we have a YAML object that looks the same.
This issue can be fixed by surrounding the block into `{% raw %}...{%
endraw %}` tags.
2024-08-06 10:40:52 -05:00
NameSirius
06c3d1db51 fix compile warning(Pull requests #1305)(Issues #1306) 2024-08-06 10:39:36 -05:00
Jesse Beder
04dddd6999 Revert "Fix compile warning with -Wshadow"
This reverts commit 1f5e971f77.

See #1306; the previous commit caused an error with -Wpedantic:

yaml-cpp/include/yaml-cpp/emitterstyle.h:13:2: error: extra ‘;’ [-Wpedantic]

Since the original commit was to resolve warnings, reverting and the OP can produce a new one that fixes this issue.
2024-08-05 15:50:36 -05:00
NameSirius
1f5e971f77 Fix compile warning with -Wshadow 2024-08-05 09:50:21 -05:00
Josiah VanderZee
b11eaf1631 Run format target from project root
The CMake format target does not use the correct .clang-format file in
out-of-source builds. This instructs CMake to use the project root as
the working directory for running the clang-format command so that it
finds the .clang-format file.
2024-08-02 07:20:10 -05:00
Josiah VanderZee
9f7babc3ff Use c-strings to constant initialize token array
Since `std::string` has to be dynamically constructed and destructed,
it could be accessed before initialization or after destruction in a
multithreaded context. By using constant c-strings instead, we guarantee
that the array will be valid for the whole lifetime of the program. The
use of `constexpr` also enforces this requirement.

I have run clang-format on the file to format my changes according to
CONTRIBUTING.md.
2024-08-01 22:54:57 -05:00
Simon Gene Gottlieb
b95aa146ec fix: use C locale by default 2024-07-17 13:39:30 -05:00
Frank Osterfeld
1d8ca1f35e Avoid static reference to temporary
These caused issues when used in a wasm project.
2024-05-02 09:29:05 -05:00
Humberto Dias
76dc671573 Add option YAML_ENABLE_PIC=ON 2024-02-22 12:12:48 -06:00
Humberto Dias
5c1bbbd276 Skip Position Independent Code for PSP/PS3 2024-02-22 12:12:48 -06:00
dependabot[bot]
4afd53b0d3 Bump the github-actions group with 1 update
Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).

- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-28 15:49:18 -06:00
Jason Beach
96f5c887f3 assign fallback value 2024-01-26 13:28:55 -06:00
Alejandro-FA
c67d701ad8 Fix indentation of empty sequences and add test 2024-01-26 12:30:06 -06:00
Trompettesib
9eb1142900 Fix GIT_TAG field in cmake integration example 2024-01-04 09:40:42 -06:00
Alexandre TISSOT
c28295bda4 Add CMake integration example 2024-01-04 09:40:42 -06:00
Levi Armstrong
94710bb221 Add default destructor to EmitFromEvents 2023-12-28 10:44:52 -06:00
Diogo Teles Sant'Anna
c7639e81d5 ci: configure dependabot to montly update GHAs
Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>
2023-12-14 09:13:33 -06:00
Diogo Teles Sant'Anna
f30582fb09 ci: hash-pin sensitive workflow dependency
Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>
2023-12-14 09:13:33 -06:00
Alex Thiessen
eaf7205372 README.md: Describe building with debug libstdc++ mode 2023-11-27 14:29:13 -06:00
Alex Thiessen
1c5a38eef3 workflows/build.yml: Use debug std C++ library on Ubuntu
Protect from regressions due to use of undefined or
implementation-specific behavior when using `std::` containers and smart
pointers.

This only has effect on platforms with the GNU standard C++ library.

Refer to https://gcc.gnu.org/onlinedocs/libstdc++/manual/debug_mode.html.
2023-11-27 14:29:13 -06:00
Levi Armstrong
51adc5f739 Update yaml-cpp-config.cmake.in 2023-11-06 19:25:04 -06:00
Levi Armstrong
30e6933279 Fix yaml-cpp-config.cmake.in 2023-11-06 19:25:04 -06:00
Gianfranco Costamagna
db03655d58 Make sure CXX_STANDARD can be overridden from outside (#1239) 2023-10-23 07:20:22 -05:00
Gianfranco Costamagna
145eec5f3e Add CMake option YAML_USE_SYSTEM_GTEST to use system googletest if available. (#1035)
There is no need to use the embedded gtest code copy in Linux systems, if they already provide the googletest framework system-wide.
Search for it, and fallback to the embedded one if the system one is not detected.

This patch has been also contributed by Simon Quigley <tsimonq2@debian.org>
2023-10-22 00:06:39 -05:00
Ezekiel Warren
f791b955d8 remove unncessary continue-on-error (#1234) 2023-10-12 19:27:47 -04:00
Ezekiel Warren
4fc5ec36bc automatically create bzlmod archive for release (#1230) 2023-10-12 11:52:22 -04:00
Pete Lewis
8106fcf1e5 Resolve warnings about unreferenced parameter 'style' in NullEventHandlers (#1193) 2023-10-12 11:49:34 -04:00
Pierre Wendling
c26e047223 CMake: Fixes for generated config (#1212)
* CMake: Add option to set the package install dir.

* CMake: Fix generated config.

- `YAML_CPP_SHARED_LIBS_BUILT` should not be set with a `PATH_VAR` as it
would always evaluate to true.
- `YAML_CPP_LIBRARIES` should used the exported target name including
the namespace, but `check_required_components` shouldn't.
- Use `CMAKE_CURRENT_LIST_DIR` to find the target file, instead of a
`PATH_VAR`. Package managers such as vcpkg move CMake configs after
installing.

* CI: Test the generated CMake package.

* CMake: Create add a deprecated yaml-cpp target.

This target is meant to provide compatibility with versions prior to
0.8.0.

* CMake: mark the yaml-cpp target as IMPORTED.

---------

Co-authored-by: Jesse Beder <jbeder+github@gmail.com>
2023-10-12 11:48:16 -04:00
Megamouse
ac144ed46c Hide uninstall target unless YAML_CPP_INSTALL is set, and allow it to be disabled by YAML_CPP_DISABLE_UNINSTALL
add_custom_target uninstall causes a clash with the same target in rtmidi (https://github.com/thestk/rtmidi).
"add_custom_target cannot create target "uninstall" because another target with the same name already exists.  The existing target is a custom target created in source directory"

Adds new option YAML_CPP_DISABLE_UNINSTALL 

fixes #1151

---------

Co-authored-by: Megamouse <studienricky89@googlemail.de>
Co-authored-by: Jesse Beder <jbeder+github@gmail.com>
2023-10-11 00:02:33 -04:00
Alfi Maulana
4c061a5058 Disable format target when not building as the main project (#1231) 2023-10-10 23:40:09 -04:00
Paul Jurczak
37f1b8b8c9 Update How-To-Emit-YAML.md (#976) 2023-09-21 15:38:56 -05:00
FireWolf
d046eea331 node/convert: Enable the template specialization for std::string_view properly when the library is compiled by MSVC on Windows. (#1227) 2023-09-17 11:58:31 -04:00