Commit Graph

115 Commits

Author SHA1 Message Date
Mark Gillard
44c7da27d6 fixed toml::literals namespace ambiguity (closes #69) 2020-10-22 16:25:26 +03:00
Mark Gillard
5f3e01f71c fixed array iterator conversion error (closes #67)
also removed superfluous newline when print ing a table (closes #68)
2020-10-22 14:34:01 +03:00
Mark Gillard
30b756f993 fixed parser not handling overlong float literals correctly
also a few other edge cases (see #65)
2020-10-10 11:45:53 +03:00
Mark Gillard
33f7d732a1 fixed issue handling malformed utf-8 2020-10-10 00:30:12 +03:00
Mark Gillard
6255dd765c fixed issue handling malformed utf-8 at EOF (closes #65) 2020-10-09 23:49:06 +03:00
Mark Gillard
fe0ac89500 fixed parser memory leak (fixes #64)
also:
- build/infra improvements
- updated submodules
- updated conformance tests
- misc code review/refactors
- library version bump
- TOML version bump
2020-10-09 11:44:40 +03:00
rezahousseini
aca6327cd8
Rename Windows.h to windows.h for mingw-w64 (#63)
Co-authored-by: Reza Housseini <reza.housseini@mecos.com>
2020-09-30 16:14:25 +03:00
Mark Gillard
1381240e10 meson refactoring
- renamed options to `snake_case`
- tests, examples and cmake config now explicitly disabled when used as a subproject
- removed small_binaries (it's now implicit when building as release)
- added minimum meson version 0.53
2020-09-05 13:26:12 +03:00
Mark Gillard
81d74663e8 fixed _Float16 erroneously supported on g++ (closes #57) 2020-09-01 14:47:21 +03:00
Mark Gillard
40d87de5b5 cleaned up some compiler warning management spam
also:
- removed `std::endl` from example code in documentation
- trimmed some fat from the toml.hpp generator
2020-08-11 18:07:02 +03:00
Mark Gillard
2ac735054a updated TOML version to v1.0.0-rc.2
also:
- simplified warning handling macros
- minor version bump
2020-08-09 12:32:17 +03:00
Mark Gillard
ad6be8e51e minor cleanup
mostly for testing on ICC.
2020-08-08 20:51:33 +03:00
Mark Gillard
82616e734c fix some issues handling infinities and NaNs
fixes #51
2020-08-03 09:10:06 +03:00
Mark Gillard
f6450f6ff9 moved is_homogenous to toml::node
also:
- added is_homogenous overload for identifying failure-causing element (to assist with implementing #45)
- added table::is_homogenous
- added value::is_homogenous (just for generic code's sake)
2020-08-02 17:02:10 +03:00
Mark Gillard
b024ee6dc2 added tests for copying and insertion (closes #49)
also:
- added tests to catch any regressions of pull/50
- moved UTF-8 decoder copyright notice
- cleaned up static assert messages
2020-08-02 12:20:41 +03:00
Mark Gillard
6f7f6c6554 moved the unicode function generator stuff to another repo
also:
- updated github templates
2020-08-01 22:37:39 +03:00
Mark Gillard
6b8fa1bef5 fixed source information being copied when copying nodes
also:
- many minor documentation fixes
- added pull request template
2020-07-30 23:31:08 +03:00
Mark Gillard
2efb15bf9e added insert, emplace, push_back etc. compatibility with node_views
In service of satisfying #49.
2020-07-28 01:21:41 +03:00
Mark Gillard
17d1876529 added copy construction/assignment for arrays. tables and values
In service of satisfying #49.
2020-07-27 13:38:01 +03:00
Mark Gillard
539aad89f4 fixed array::insert not working correctly in some cases
also:
- improved the documentation for table and array
- fixed documentation font on mobile
2020-07-26 15:03:33 +03:00
Mark Gillard
fd07301bae improved support for __fp16, _Float16 and __float128
also:
- fixed a bunch of doxygen parsing issues
- added `#define` leak detection to the single-header script
- renamed `TOML_ALL_INLINE` to `TOML_HEADER_ONLY` (the old one still works too)
- simplified abi namespace definitions
2020-07-25 20:50:24 +03:00
Mark Gillard
9afa43e7c2 fixed leading/trailing newlines with printing to ostreams (fixes #48)
also:
- change internal nan constant to match qNaN bits on x86/ARM
2020-07-21 16:11:32 +03:00
Mark Gillard
7314fbf8c2 deprecated parse_result::get() in favour of parse_result::table()
also:
- fixed static assert messages being badly formatted on clang
- minor documentation fixes
- updated version numbers
2020-07-20 17:26:36 +03:00
Mark Gillard
ca6f639fb9 fixed narrowing conversion warnings when constructing int values from unsigned
also:
- added ability to construct values from wide strings and u8 strings
- added non-template version of array::is_homogeneous()
- added explicit instantiations for more template types when `!TOML_ALL_INLINE`
- cleaned up abi namespaces
- simplified build and test machinery on windows
- removed TOML_CHAR_8_STRINGS since it no longer makes sense
2020-07-20 00:40:55 +03:00
Mark Gillard
cb791fe0ef expanded allowable conversion semantics of value and value_or
also:
- fixed infinity and NaN-related code breaking when using -ffast-math and friends
- added much more detail to many static_assert error messages
- added more test permutations of various compiler flags
- added many more static checks to test code
2020-07-17 16:33:56 +03:00
Mark Gillard
de07ba7187 string value serialization now emits literals where possible (closes #43)
also added support for wide strings on Windows (closes #42):
- added wide-string path arg overloads of `parse()` and `parse_file()`
- added wide-string support to all relevant `table` and `array` ops
- added `std::wstring` support to `node::value()` and `node::value_or()`
- added `std::wstring` support to `node_view::value()` and `node_view::value_or()`
- added wide-string overloads of `table::operator[]`
- added wide-string overloads of `node_view::operator[]`
- added `source_region::wide_path()`
- added `TOML_WINDOWS_COMPAT` switch for explicitly enabling/disabling this stuff

also:
- fixed internal macro `assert_or_assume` leaking out of `toml_parser.hpp`
- deprecated `node_view::get()` in favour of `node_view::node()`
- minor documentation fixes
- minor cleanup
2020-07-14 20:50:24 +03:00
Mark Gillard
8d958fcc54 documentation improvements and minor cleanup
- split conformance tests into multiple TU's
- added "Try this code on Compiler Explorer" links to the main page
- minor preprocessor cleanup
2020-07-06 01:03:07 +03:00
Mark Gillard
40a1a03315 simplified test code to reduce bloat and improve compile times 2020-06-29 01:57:59 +03:00
Mark Gillard
b8438b3258 fixed ML strings not allowing whitespace after line-ending backslashes
also:
- fixed value comparison with special floats
- added all the remaining conformance tests from BurntSushi/toml-test and iarna/toml-spec-tests
- added toml::inserter
- added license boilerplate to test files
2020-06-27 15:55:15 +03:00
Mark Gillard
761690d4a6 fixed BOM check causing EOF on very short iostream inputs
also fixed a number of small parsing conformance issues
2020-06-25 17:33:01 +03:00
Mark Gillard
a122b3b9b4 more preprocessor cleanup
- fixing 'unknown pragma' warnings in GCC
- cleaning up test structure
2020-06-24 21:05:23 +03:00
Mark Gillard
ab85988d59 fixed single-digit negative integer parsing bug (closes #39)
also:
- fixed overflow for very long binary integer literals
- added optimization for parsing string views containing trailing null characters
- added more tests
2020-06-19 14:17:52 +03:00
Mark Gillard
83315a3912 fixed multi-line strings being allowed in keys
also:
- significantly improved the performance of toml::parse_file
- improved the performance of printing to streams for deepy-nested TOML data
- simplified some of the examples
- added more tests
- cleaned up some of the test code
2020-06-08 18:31:23 +03:00
Mark Gillard
d8fdf4e1e5 fixed weird overflow with BOMs in char8 mode 2020-05-24 13:42:15 +03:00
Mark Gillard
289c95cb51 renamed table proxy pair members to first and second to match STL (closes #30)
also:
- implemented `table_iterator::operator -> ()` (closes #29)
- added `array::resize()` and `array::truncate()` (closes #33)
- refactored BOM handling to make static analyzer happy (closes #34)
- added `array::capacity()`, `array::shrink_to_fit()`, `array::max_size()`
- implemented non-const -> const conversion for table and array iterators
2020-05-23 17:35:47 +03:00
Mark Gillard
aa37852f53 minor code cleanup 2020-04-21 16:40:03 +03:00
Mark Gillard
5e683e9a73 fixed is_unicode_XXXXXX functions being wrong in some cases
also:
- added tests for unicode functions
- changed `TOML_LIKELY` semantics to work with gcc-style intrinsics
- greatly improved unicode-related codegen
- parser refactoring
2020-04-18 23:42:33 +03:00
Mark Gillard
cd9b3d2198 fixed some multi-line string parsing issues
also:
- fixed pedantic warnings on gcc 10 and clang 11
2020-04-13 23:23:11 +03:00
Mark Gillard
f3990256ce moved preprocessor machinery to a separate header
- added doxygen page for the configuration options
- added SPDX-License-Identifiers around the place
- changed TOML_UNRELEASED_FEATURES default to 0
- simplified ABI namespace machinery
- fixed a number of doxygen bugs
2020-04-10 19:46:00 +03:00
Mark Gillard
682436aa2e fixed printing of inf and nan
also:
- fixed parser not handling floats with leading '.' characters
- added `TOML_PARSER` configuration option
- added `TOML_LIB_SINGLE_HEADER` indicator
- moved parse_error and the utf8 stream machinery to separate headers
- updated catch2
2020-04-09 16:49:16 +03:00
Mark Gillard
104b2741d1 minor refactoring in the parser to reduce binary sizes
also:
- fixed pedantic vtable warnings on clang with -Weverything
- renamed `_impl.h` headers to `.hpp`
- build system and CI config tweaks
2020-04-08 16:33:57 +03:00
Mark Gillard
5ca6b29cb9 added support for implementations without <charconv> (fixes #21)
also:
- fixed some parsing and printing ops being locale-dependent (fixes #19)
- fixed pkgconfig subdir being wrong (fixes #23)
- fixed some parsing errors at EOF when `TOML_EXCEPTIONS = 0`
- fixed some unreferenced variable warnings on older compilers
- fixed some 'maybe-uninitialized' false-positives on GCC9
- added debug/release awareness to CI tests
- added locale awareness to catch test runner
2020-04-07 18:01:22 +03:00
Mark Gillard
358ac66669 added operator[], begin(), end() to parse_result in noexcept-mode
also:
- added note about `#include <fstream>` requirements README
- added tests for parse_result
- added array and table iterators to the toml namespace
2020-04-03 16:33:02 +03:00
Mark Gillard
cb000809b0 support for upcoming TOML v1.0.0 release
see https://github.com/toml-lang/toml/issues/698 for info about TOML v1.0.0

also:
- fixed some parser error-paths not returning early enough when exceptions were disabled
- added more specific error messages for parsing errors relating to prohibited codepoints
- added compilation speed improvements (particularly for platforms lacking floating-point `std::to_chars`)
- added many minor documentation improvements
- added additional tests
2020-04-03 00:39:21 +03:00
Mark Gillard
41d05792a5 narrowed scope of abi namespacing
also
- simplified `noexcept` specifiers (removed `TOML_MAY_THROW_UNLESS`)
- minor documentation fixes
2020-03-28 18:56:59 +02:00
Mark Gillard
b2f36e38f1 added trivial abi attribute to date, time, time_offset
also:
- included <cassert> directly in 'debug' builds when TOML_ASSERT isn't defined
- minor preprocessor cleanup
- minor documentation fixes
2020-03-23 17:55:32 +02:00
Mark Gillard
ee9b30c774 fixed compilation on older implementations without std::launder
also:
- fixed `json_formatter` type deduction on older compilers
- added build configuration option for compiling examples
2020-03-18 15:28:00 +02:00
Mark Gillard
438970b412 added support for \xHH escape sequences (unreleased)
also:
- fixed EOF bug in string parsing when exceptions are disabled
- fixed exception mode detection sometimes being incorrect on MSVC
- added short-form license preamble to all source files
- simplified license files
2020-03-12 17:23:25 +02:00
Mark Gillard
f0e91716a3 added error when TOML_EXCEPTIONS is 1 but compiler exceptions were disabled 2020-03-08 23:54:57 +02:00
Mark Gillard
64e3503a8e minor parsing performance improvements
also improved codegen for the utf8_generated functions
2020-03-08 01:06:53 +02:00
Mark Gillard
4bbca20fc1 added node::ref() and node_view::ref() (resolves #10)
also:
- simplified `const` handling in `node_view`
2020-03-05 13:07:26 +02:00
Mark Gillard
74e7209cca fixed parse_file for string literals (closes #12)
also:
- decoupled `TOML_EXCEPTION` from ex. mode (closes #13)
- added `TOML_OPTIONAL_TYPE` customization point
- added tests for a custom optional type
- ci refactoring
2020-03-03 23:28:24 +02:00
Mark Gillard
14249f4e66 minor refactoring to better enable explicit instantiations 2020-03-03 10:10:07 +02:00
Mark Gillard
d874264432 added support for compiling into DLLs on windows (TOML_API) 2020-03-02 12:14:54 +02:00
Mark Gillard
946a912cee added node::value() and node::value_or()
also:
- added `node_view::value`
- added relops for the date/time classes
- added `TOML_ALL_INLINE` and `TOML_IMPLEMENTATION` options
- fixed documentation header overflowing on narrow devices
2020-03-01 16:56:40 +02:00
Mark Gillard
98c599ec2c removed <cmath> dependency
also:
- fixed some pedantic clang warnings
- added preliminary support for ICC
- documentation fixes
2020-02-29 22:34:08 +02:00
Mark Gillard
9ed295f21c fixed source of UB when using char8 strings
also:
- documentation improvements
- minor test restructuring
2020-02-27 01:28:20 +02:00
Mark Gillard
3d653de7c9 fixed potential ODR issues relating to exception mode handling (fixes #6)
also:
- fixed truncation of floating-point values when using ostreams
- fixed some minor documentation issues (fixes #8)
- fixed missing value deduction guides for dates and times
- added serialization round-trip tests (closes #9)
- added node::is_number()
- added node_view::is_number()
- added node_view::value_or() (closes #7)
- added hexfloat parsing support for all implementations, not just <charconv> ones
2020-02-22 16:10:32 +02:00
Mark Gillard
2219fd22bb release 0.1.0
- added `toml::is_number<>`
- added `toml::node_type::none`
- added initializer_list and vector relops to `toml::array`
- added constructors for `time_offset` and `date_time`
- added much to `node_view`
- added tests for `node_view` value relops
- added lots more documentation
- removed `time_offset::from_hh_mm`
- removed the handling of `\s` literals (looks like it's not going be accepted as-is)
2020-02-20 23:33:32 +02:00
Mark Gillard
c7483cb92c added insertion operations for tables and arrays
also:
- fixed column numbers being wrong when a value ended at EOF
- fixed some `print_to_stream` overloads for `char8_t`
- fixed a minor preprocessor snafu on MSVC
- fixed '\' not being escaped when printing string values
- added an initializer list constructor for tables
- added `array::flatten`
- added `table::find`
- added `table::is_inline` setter
- added `TOML_SMALL_INT_TYPE`
- added `parse_file`
- added stream operator for source_region
- added proper license notice for the utf8 decoder
- added lots more documentation and tests
2020-02-13 20:34:45 +02:00
Mark Gillard
c4f30c2ffa added relops for values, arrays and tables
also:
 - fixed stream operator for node_type
 - implemented node::visit() noexcept propagation
 - removed some unnecessary overloads of string-based accessors
2020-01-30 22:17:03 +02:00
Mark Gillard
ab5ffa5a3c moved date and time stuff to separate header
also:
- merged all the separate integer parsing functions
- renamed the member functions of parse_error for clarity
- added the beginnings of a doxygen pipeline
2020-01-11 23:15:24 +02:00
Mark Gillard
537eb30080 added iterators for tables and arrays
also:
- fixed parsing table headers allowing invalid characters
- fixed implicit fallthrough warnings
- fixed some issues parsing dates and times
- added `table::erase`
- added `array::operator[]`
- added `value::operator*`
- added stream operators for date, time and date_time
- added `impl::print_to_stream`
- added more parsing diagnostics
- added many tests
2020-01-10 19:33:58 +02:00
Mark Gillard
40ffee43fb added json_formatter
also:
- added `toml_version.h`
- added version number to toml.hpp
- added `node::visit()`
- added `table::empty()`
- added `array::empty()`
- added version number to `toml.hpp`
- added ostream operator overload for `source_position`
- added tests for string escape sequences
- added tests for + in bare keys (toml/issues/687)
- added tests for hexfloat literals (toml/issues/562)
- added c++20 char8_t detection to meson
- moved third party submodules to `/extern`
- refactored noexcept version of `parse_result` to be more useful
- refactored all code to 'mostly' stick to a 120 column limit
- fixed some minor stuff picked up by gcc9
2020-01-06 22:24:53 +02:00
Mark Gillard
930bf0ad58 new file: .circleci/config.yml
new file:   .editorconfig
new file:   .gitattributes
new file:   .gitignore
new file:   .gitmodules
new file:   LICENSE
new file:   README.md
new file:   examples/example.cpp
new file:   examples/example.toml
new file:   examples/meson.build
new file:   include/toml++/toml.h
new file:   include/toml++/toml_array.h
new file:   include/toml++/toml_common.h
new file:   include/toml++/toml_formatter.h
new file:   include/toml++/toml_node.h
new file:   include/toml++/toml_node_view.h
new file:   include/toml++/toml_parser.h
new file:   include/toml++/toml_table.h
new file:   include/toml++/toml_utf8.h
new file:   include/toml++/toml_utf8_generated.h
new file:   include/toml++/toml_value.h
new file:   meson.build
new file:   python/ci_single_header_check.py
new file:   python/generate_single_header.py
new file:   python/generate_unicode_functions.py
new file:   tests/catch2
new file:   tests/catch2.h
new file:   tests/lifetimes.cpp
new file:   tests/main.cpp
new file:   tests/meson.build
new file:   tests/parsing_arrays.cpp
new file:   tests/parsing_booleans.cpp
new file:   tests/parsing_comments.cpp
new file:   tests/parsing_dates_and_times.cpp
new file:   tests/parsing_floats.cpp
new file:   tests/parsing_integers.cpp
new file:   tests/parsing_key_value_pairs.cpp
new file:   tests/parsing_spec_example.cpp
new file:   tests/parsing_strings.cpp
new file:   tests/parsing_tables.cpp
new file:   tests/tests.cpp
new file:   tests/tests.h
new file:   toml.hpp
new file:   vs/.runsettings
new file:   vs/example.vcxproj
new file:   vs/test_char.vcxproj
new file:   vs/test_char8.vcxproj
new file:   vs/test_char8_noexcept.vcxproj
new file:   vs/test_char_noexcept.vcxproj
new file:   vs/test_strict_char.vcxproj
new file:   vs/test_strict_char8.vcxproj
new file:   vs/test_strict_char8_noexcept.vcxproj
new file:   vs/test_strict_char_noexcept.vcxproj
new file:   vs/toml++.natvis
new file:   vs/toml++.props
new file:   vs/toml++.sln
new file:   vs/toml++.vcxproj
new file:   vs/toml++.vcxproj.filters
2020-01-04 16:21:38 +02:00