Skip to content
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

Fix some typos in strings and comments #408

Merged
merged 4 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/fkYAML/detail/assert.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// SPDX-FileCopyrightText: 2023-2024 Kensuke Fukutani <fktn.dev@gmail.com>
// SPDX-License-Identifier: MIT

#ifndef FK_YAML_DETAIL_ASSERT_HPP_
#define FK_YAML_DETAIL_ASSERT_HPP_
#ifndef FK_YAML_DETAIL_ASSERT_HPP
#define FK_YAML_DETAIL_ASSERT_HPP

// if FK_YAML_ASSERT is not user-defined. apply the default assert impl.
#ifndef FK_YAML_ASSERT
Expand All @@ -19,4 +19,4 @@
#endif
#endif

#endif /* FK_YAML_DETAIL_ASSERT_HPP_ */
#endif /* FK_YAML_DETAIL_ASSERT_HPP */
8 changes: 4 additions & 4 deletions include/fkYAML/detail/conversions/from_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// SPDX-FileCopyrightText: 2023-2024 Kensuke Fukutani <fktn.dev@gmail.com>
// SPDX-License-Identifier: MIT

#ifndef FK_YAML_DETAIL_CONVERSIONS_FROM_NODE_HPP_
#define FK_YAML_DETAIL_CONVERSIONS_FROM_NODE_HPP_
#ifndef FK_YAML_DETAIL_CONVERSIONS_FROM_NODE_HPP
#define FK_YAML_DETAIL_CONVERSIONS_FROM_NODE_HPP

#include <limits>
#include <map>
Expand Down Expand Up @@ -267,7 +267,7 @@ namespace // NOLINT(cert-dcl59-cpp,fuchsia-header-anon-namespaces,google-build-n
{
#endif

/// @brief A blobal object to represent ADL friendly from_node functor.
/// @brief A global object to represent ADL friendly from_node functor.
// NOLINTNEXTLINE(misc-definitions-in-headers)
FK_YAML_INLINE_VAR constexpr const auto& from_node = detail::static_const<detail::from_node_fn>::value;

Expand All @@ -277,4 +277,4 @@ FK_YAML_INLINE_VAR constexpr const auto& from_node = detail::static_const<detail

FK_YAML_NAMESPACE_END

#endif /* FK_YAML_DETAIL_CONVERSIONS_FROM_NODE_HPP_ */
#endif /* FK_YAML_DETAIL_CONVERSIONS_FROM_NODE_HPP */
8 changes: 4 additions & 4 deletions include/fkYAML/detail/conversions/scalar_conv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
// types. So, some implementations don't follow the convensions in the standard C++ functions. For example, octals must
// begin with "0o" (not "0"), which is specified in the YAML spec 1.2.

#ifndef FK_YAML_CONVERSIONS_SCALAR_CONV_HPP_
#define FK_YAML_CONVERSIONS_SCALAR_CONV_HPP_
#ifndef FK_YAML_CONVERSIONS_SCALAR_CONV_HPP
#define FK_YAML_CONVERSIONS_SCALAR_CONV_HPP

#include <cmath>
#include <cstring>
Expand Down Expand Up @@ -761,7 +761,7 @@ inline bool atof_impl(const char* p_begin, const char* p_end, double& f) {

/// @brief Converts a scalar into a floating point value.
/// @tparam CharItr The type of char iterators. Its value type must be char (maybe cv-qualified).
/// @tparam FloatType The output floatint point value type.
/// @tparam FloatType The output floating point value type.
/// @param begin The iterator to the first element of the scalar.
/// @param end The iterator to the past-the-end element of the scalar.
/// @param f The output floating point value holder.
Expand Down Expand Up @@ -829,4 +829,4 @@ inline bool atof(CharItr begin, CharItr end, FloatType& f) noexcept(noexcept(ato

FK_YAML_DETAIL_NAMESPACE_END

#endif /* FK_YAML_CONVERSIONS_SCALAR_CONV_HPP_ */
#endif /* FK_YAML_CONVERSIONS_SCALAR_CONV_HPP */
14 changes: 7 additions & 7 deletions include/fkYAML/detail/conversions/to_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// SPDX-FileCopyrightText: 2023-2024 Kensuke Fukutani <fktn.dev@gmail.com>
// SPDX-License-Identifier: MIT

#ifndef FK_YAML_DETAIL_CONVERSIONS_TO_NODE_HPP_
#define FK_YAML_DETAIL_CONVERSIONS_TO_NODE_HPP_
#ifndef FK_YAML_DETAIL_CONVERSIONS_TO_NODE_HPP
#define FK_YAML_DETAIL_CONVERSIONS_TO_NODE_HPP

#include <utility>

Expand All @@ -25,11 +25,11 @@ FK_YAML_DETAIL_NAMESPACE_BEGIN
///////////////////////////////////

/// @brief The external constructor template for basic_node objects.
/// @note All the non-specialized instanciations results in compilation error since such instantiations are not
/// @note All the non-specialized instantiations results in compilation error since such instantiations are not
/// supported.
/// @warning All the specialization must call n.m_node_value.destroy() first in the construct function to avoid
/// memory leak.
/// @tparam node_type The resulting YAMK node value type.
/// @tparam node_type The resulting YAML node value type.
template <node_type>
struct external_node_constructor;

Expand Down Expand Up @@ -213,7 +213,7 @@ inline void to_node(BasicNodeType& n, T&& s) noexcept {
}

/// @brief to_node function for BasicNodeType::mapping_type objects.
/// @tparam BasicNodeType A basid_node template instance type.
/// @tparam BasicNodeType A basic_node template instance type.
/// @tparam T A mapping node value type.
/// @param n A basic_node object.
/// @param m A mapping node value object.
Expand Down Expand Up @@ -327,7 +327,7 @@ namespace // NOLINT(cert-dcl59-cpp,fuchsia-header-anon-namespaces,google-build-n
{
#endif

/// @brief A blobal object to represent ADL friendly to_node functor.
/// @brief A global object to represent ADL friendly to_node functor.
// NOLINTNEXTLINE(misc-definitions-in-headers)
FK_YAML_INLINE_VAR constexpr const auto& to_node = detail::static_const<detail::to_node_fn>::value;

Expand All @@ -337,4 +337,4 @@ FK_YAML_INLINE_VAR constexpr const auto& to_node = detail::static_const<detail::

FK_YAML_NAMESPACE_END

#endif /* FK_YAML_DETAIL_CONVERSIONS_TO_NODE_HPP_ */
#endif /* FK_YAML_DETAIL_CONVERSIONS_TO_NODE_HPP */
6 changes: 3 additions & 3 deletions include/fkYAML/detail/conversions/to_string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// SPDX-FileCopyrightText: 2023-2024 Kensuke Fukutani <fktn.dev@gmail.com>
// SPDX-License-Identifier: MIT

#ifndef TO__string_HPP_
#define TO__string_HPP_
#ifndef FK_YAML_DETAIL_CONVERSIONS_TO_STRING_HPP
#define FK_YAML_DETAIL_CONVERSIONS_TO_STRING_HPP

#include <cmath>
#include <limits>
Expand Down Expand Up @@ -89,4 +89,4 @@ inline enable_if_t<std::is_floating_point<FloatType>::value> to_string(FloatType

FK_YAML_DETAIL_NAMESPACE_END

#endif /* TO__string_HPP_ */
#endif /* FK_YAML_DETAIL_CONVERSIONS_TO_STRING_HPP */
10 changes: 5 additions & 5 deletions include/fkYAML/detail/document_metainfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// SPDX-FileCopyrightText: 2023-2024 Kensuke Fukutani <fktn.dev@gmail.com>
// SPDX-License-Identifier: MIT

#ifndef FK_YAML_DETAIL_DOCUMENT_METAINFO_HPP_
#define FK_YAML_DETAIL_DOCUMENT_METAINFO_HPP_
#ifndef FK_YAML_DETAIL_DOCUMENT_METAINFO_HPP
#define FK_YAML_DETAIL_DOCUMENT_METAINFO_HPP

#include <string>
#include <map>
Expand All @@ -23,18 +23,18 @@ template <typename BasicNodeType, typename = enable_if_t<is_basic_node<BasicNode
struct document_metainfo {
/// The YAML version used for the YAML document.
yaml_version_type version {yaml_version_type::VERSION_1_2};
/// Whether or not the YAML version has been specified.
/// Whether the YAML version has been specified.
bool is_version_specified {false};
/// The prefix of the primary handle.
std::string primary_handle_prefix {};
/// The prefix of the secondary handle.
std::string secondary_handle_prefix {};
/// The map of handle-prefix pairs.
std::map<std::string /*handle*/, std::string /*prefix*/> named_handle_map {};
/// The map of anchor node which allowes for key duplication.
/// The map of anchor node which allows for key duplication.
std::multimap<std::string /*anchor name*/, BasicNodeType> anchor_table {};
};

FK_YAML_DETAIL_NAMESPACE_END

#endif /* FK_YAML_DETAIL_DOCUMENT_METAINFO_HPP_ */
#endif /* FK_YAML_DETAIL_DOCUMENT_METAINFO_HPP */
6 changes: 3 additions & 3 deletions include/fkYAML/detail/encodings/uri_encoding.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// SPDX-FileCopyrightText: 2023-2024 Kensuke Fukutani <fktn.dev@gmail.com>
// SPDX-License-Identifier: MIT

#ifndef FK_YAML_DETAIL_ENCODINGS_URI_ENCODING_HPP_
#define FK_YAML_DETAIL_ENCODINGS_URI_ENCODING_HPP_
#ifndef FK_YAML_DETAIL_ENCODINGS_URI_ENCODING_HPP
#define FK_YAML_DETAIL_ENCODINGS_URI_ENCODING_HPP

#include <cctype>
#include <string>
Expand Down Expand Up @@ -122,4 +122,4 @@ class uri_encoding {

FK_YAML_DETAIL_NAMESPACE_END

#endif /* FK_YAML_DETAIL_ENCODINGS_URI_ENCODING_HPP_ */
#endif /* FK_YAML_DETAIL_ENCODINGS_URI_ENCODING_HPP */
8 changes: 4 additions & 4 deletions include/fkYAML/detail/encodings/utf_encode_detector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// SPDX-FileCopyrightText: 2023-2024 Kensuke Fukutani <fktn.dev@gmail.com>
// SPDX-License-Identifier: MIT

#ifndef FK_YAML_DETAIL_ENCODINGS_UTF_ENCODE_DETECTOR_HPP_
#define FK_YAML_DETAIL_ENCODINGS_UTF_ENCODE_DETECTOR_HPP_
#ifndef FK_YAML_DETAIL_ENCODINGS_UTF_ENCODE_DETECTOR_HPP
#define FK_YAML_DETAIL_ENCODINGS_UTF_ENCODE_DETECTOR_HPP

#include <cstdint>
#include <istream>
Expand All @@ -23,7 +23,7 @@ FK_YAML_DETAIL_NAMESPACE_BEGIN
/// @brief Detect an encoding type for UTF-8 expected inputs.
/// @note This function doesn't support the case where the first character is null.
/// @param[in] bytes 4 bytes of an input character sequence.
/// @param[out] has_bom Whether or not the input contains a BOM.
/// @param[out] has_bom Whether the input contains a BOM.
/// @return A detected encoding type.
inline utf_encode_t detect_encoding_type(const std::array<uint8_t, 4>& bytes, bool& has_bom) noexcept {
has_bom = false;
Expand Down Expand Up @@ -332,4 +332,4 @@ struct stream_utf_encode_detector {

FK_YAML_DETAIL_NAMESPACE_END

#endif /* FK_YAML_DETAIL_ENCODINGS_UTF_ENCODE_DETECTOR_HPP_ */
#endif /* FK_YAML_DETAIL_ENCODINGS_UTF_ENCODE_DETECTOR_HPP */
6 changes: 3 additions & 3 deletions include/fkYAML/detail/encodings/utf_encode_t.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// SPDX-FileCopyrightText: 2023-2024 Kensuke Fukutani <fktn.dev@gmail.com>
// SPDX-License-Identifier: MIT

#ifndef FK_YAML_DETAIL_ENCODINGS_UTF_ENCODE_T_HPP_
#define FK_YAML_DETAIL_ENCODINGS_UTF_ENCODE_T_HPP_
#ifndef FK_YAML_DETAIL_ENCODINGS_UTF_ENCODE_T_HPP
#define FK_YAML_DETAIL_ENCODINGS_UTF_ENCODE_T_HPP

#include <fkYAML/detail/macros/version_macros.hpp>

Expand All @@ -25,4 +25,4 @@ enum class utf_encode_t {

FK_YAML_DETAIL_NAMESPACE_END

#endif /* FK_YAML_DETAIL_ENCODINGS_UTF_ENCODE_T_HPP_ */
#endif /* FK_YAML_DETAIL_ENCODINGS_UTF_ENCODE_T_HPP */
6 changes: 3 additions & 3 deletions include/fkYAML/detail/encodings/utf_encodings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// SPDX-FileCopyrightText: 2023-2024 Kensuke Fukutani <fktn.dev@gmail.com>
// SPDX-License-Identifier: MIT

#ifndef FK_YAML_DETAIL_ENCODINGS_UTF_ENCODINGS_HPP_
#define FK_YAML_DETAIL_ENCODINGS_UTF_ENCODINGS_HPP_
#ifndef FK_YAML_DETAIL_ENCODINGS_UTF_ENCODINGS_HPP
#define FK_YAML_DETAIL_ENCODINGS_UTF_ENCODINGS_HPP

#include <array>
#include <cstdint>
Expand Down Expand Up @@ -284,4 +284,4 @@ inline void from_utf32(const char32_t utf32, std::array<uint8_t, 4>& utf8, uint3

FK_YAML_DETAIL_NAMESPACE_END

#endif /* FK_YAML_DETAIL_ENCODINGS_UTF_ENCODINGS_HPP_ */
#endif /* FK_YAML_DETAIL_ENCODINGS_UTF_ENCODINGS_HPP */
6 changes: 3 additions & 3 deletions include/fkYAML/detail/encodings/yaml_escaper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// SPDX-FileCopyrightText: 2023-2024 Kensuke Fukutani <fktn.dev@gmail.com>
// SPDX-License-Identifier: MIT

#ifndef FK_YAML_DETAIL_ENCODINGS_YAML_ESCAPER_HPP_
#define FK_YAML_DETAIL_ENCODINGS_YAML_ESCAPER_HPP_
#ifndef FK_YAML_DETAIL_ENCODINGS_YAML_ESCAPER_HPP
#define FK_YAML_DETAIL_ENCODINGS_YAML_ESCAPER_HPP

#include <string>

Expand Down Expand Up @@ -340,4 +340,4 @@ class yaml_escaper {

FK_YAML_DETAIL_NAMESPACE_END

#endif /* FK_YAML_DETAIL_ENCODINGS_YAML_ESCAPER_HPP_ */
#endif /* FK_YAML_DETAIL_ENCODINGS_YAML_ESCAPER_HPP */
20 changes: 10 additions & 10 deletions include/fkYAML/detail/input/deserializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// SPDX-FileCopyrightText: 2023-2024 Kensuke Fukutani <fktn.dev@gmail.com>
// SPDX-License-Identifier: MIT

#ifndef FK_YAML_DETAIL_INPUT_DESERIALIZER_HPP_
#define FK_YAML_DETAIL_INPUT_DESERIALIZER_HPP_
#ifndef FK_YAML_DETAIL_INPUT_DESERIALIZER_HPP
#define FK_YAML_DETAIL_INPUT_DESERIALIZER_HPP

#include <algorithm>
#include <deque>
Expand Down Expand Up @@ -458,7 +458,7 @@ class basic_deserializer {
// foo: !!map
// !!str 123: true
// ^
// this !!str tag overwrites the preceeding !!map tag.
// this !!str tag overwrites the preceding !!map tag.
// ```
*mp_current_node = basic_node_type::mapping();
apply_directive_set(*mp_current_node);
Expand All @@ -469,7 +469,7 @@ class basic_deserializer {
}

if (token.type == lexical_token_t::SEQUENCE_BLOCK_PREFIX) {
// a key separator preceeding block sequence entries
// a key separator preceding block sequence entries
*mp_current_node = basic_node_type::sequence();
apply_directive_set(*mp_current_node);
apply_node_properties(*mp_current_node);
Expand Down Expand Up @@ -601,7 +601,7 @@ class basic_deserializer {
});
bool is_indent_valid = (target_itr != m_context_stack.rend());
if FK_YAML_UNLIKELY (!is_indent_valid) {
throw parse_error("Detected invalid indentaion.", line, indent);
throw parse_error("Detected invalid indentation.", line, indent);
}

pop_num = static_cast<uint32_t>(std::distance(m_context_stack.rbegin(), target_itr));
Expand All @@ -615,7 +615,7 @@ class basic_deserializer {
}
}
else if FK_YAML_UNLIKELY (m_flow_token_state == flow_token_state_t::NEEDS_SEPARATOR_OR_SUFFIX) {
throw parse_error("Flow sequence begininng is found without separated with a comma.", line, indent);
throw parse_error("Flow sequence beginning is found without separated with a comma.", line, indent);
}

++m_flow_context_depth;
Expand Down Expand Up @@ -748,7 +748,7 @@ class basic_deserializer {
});
bool is_indent_valid = (target_itr != m_context_stack.rend());
if FK_YAML_UNLIKELY (!is_indent_valid) {
throw parse_error("Detected invalid indentaion.", line, indent);
throw parse_error("Detected invalid indentation.", line, indent);
}

pop_num = static_cast<uint32_t>(std::distance(m_context_stack.rbegin(), target_itr));
Expand All @@ -762,7 +762,7 @@ class basic_deserializer {
}
}
else if FK_YAML_UNLIKELY (m_flow_token_state == flow_token_state_t::NEEDS_SEPARATOR_OR_SUFFIX) {
throw parse_error("Flow mapping begininng is found without separated with a comma.", line, indent);
throw parse_error("Flow mapping beginning is found without separated with a comma.", line, indent);
}

++m_flow_context_depth;
Expand Down Expand Up @@ -998,7 +998,7 @@ class basic_deserializer {
});
bool is_indent_valid = (target_itr != m_context_stack.rend());
if FK_YAML_UNLIKELY (!is_indent_valid) {
throw parse_error("Detected invalid indentaion.", line, indent);
throw parse_error("Detected invalid indentation.", line, indent);
}

pop_num = static_cast<uint32_t>(std::distance(m_context_stack.rbegin(), target_itr));
Expand Down Expand Up @@ -1298,4 +1298,4 @@ class basic_deserializer {

FK_YAML_DETAIL_NAMESPACE_END

#endif /* FK_YAML_DETAIL_INPUT_DESERIALIZER_HPP_ */
#endif /* FK_YAML_DETAIL_INPUT_DESERIALIZER_HPP */
Loading
Loading