Skip to content
Open
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
15 changes: 11 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -561,12 +561,19 @@ if (MRDOCS_BUILD_TESTS)
message(FATAL_ERROR "Java is needed to run xml-lint")
endif()

# Generate mrdocs.rnc via the --schemas option, then
# convert it to a .rng for xmllint validation.
add_custom_command(
COMMAND mrdocs --schemas=${CMAKE_CURRENT_BINARY_DIR}
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mrdocs.rnc
DEPENDS mrdocs
COMMENT "Generating mrdocs.rnc from --schemas")
add_custom_command(
COMMAND ${Java_JAVA_EXECUTABLE} -jar ${CMAKE_CURRENT_SOURCE_DIR}/util/trang.jar
${CMAKE_CURRENT_SOURCE_DIR}/mrdocs.rnc ${CMAKE_CURRENT_BINARY_DIR}/mrdocs.rng
OUTPUT mrdocs.rng
DEPENDS mrdocs.rnc)
add_custom_target(mrdocs_rng ALL DEPENDS mrdocs.rng)
${CMAKE_CURRENT_BINARY_DIR}/mrdocs.rnc ${CMAKE_CURRENT_BINARY_DIR}/mrdocs.rng
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mrdocs.rng
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/mrdocs.rnc)
add_custom_target(mrdocs_rng ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/mrdocs.rng)

file(GLOB_RECURSE XML_SOURCES CONFIGURE_DEPENDS test-files/golden-tests/*.xml)
add_test(NAME xml-lint
Expand Down
19 changes: 2 additions & 17 deletions include/mrdocs/Metadata/DocComment/Block/ParamDirection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <mrdocs/Platform.hpp>
#include <mrdocs/Dom.hpp>
#include <mrdocs/Support/Describe.hpp>

namespace mrdocs::doc {

Expand All @@ -33,23 +34,7 @@ enum class ParamDirection
inout
};

/** Return the name of the ParamDirection as a string.
*/
MRDOCS_DECL
dom::String
toString(ParamDirection kind) noexcept;

/** Return the ParamDirection from a @ref dom::Value string.
*/
inline
void
tag_invoke(
dom::ValueFromTag,
dom::Value& v,
ParamDirection const kind)
{
v = toString(kind);
}
MRDOCS_DESCRIBE_ENUM(ParamDirection, none, in, out, inout)

} // mrdocs::doc

Expand Down
22 changes: 2 additions & 20 deletions include/mrdocs/Metadata/Specifiers/AccessKind.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <mrdocs/Platform.hpp>
#include <mrdocs/Dom.hpp>
#include <string>
#include <mrdocs/Support/Describe.hpp>

namespace mrdocs {

Expand All @@ -41,25 +41,7 @@ enum class AccessKind
Private,
};

/** Convert access specifier to its string form.
*/
MRDOCS_DECL
dom::String
toString(AccessKind kind) noexcept;

/** Return the AccessKind as a @ref dom::Value string.
*/
inline
void
tag_invoke(
dom::ValueFromTag,
dom::Value& v,
AccessKind const kind)
{
v = toString(kind);
}


MRDOCS_DESCRIBE_ENUM(AccessKind, None, Public, Protected, Private)

} // mrdocs

Expand Down
20 changes: 2 additions & 18 deletions include/mrdocs/Metadata/Specifiers/ConstexprKind.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#define MRDOCS_API_METADATA_SPECIFIERS_CONSTEXPRKIND_HPP

#include <mrdocs/Platform.hpp>
#include <string>
#include <mrdocs/Support/Describe.hpp>

namespace mrdocs {

Expand All @@ -33,23 +33,7 @@ enum class ConstexprKind
Consteval,
};

/** Convert a constexpr/consteval specifier kind to a string.
*/
MRDOCS_DECL
dom::String
toString(ConstexprKind kind) noexcept;

/** Return the ConstexprKind as a @ref dom::Value string.
*/
inline
void
tag_invoke(
dom::ValueFromTag,
dom::Value& v,
ConstexprKind const kind)
{
v = toString(kind);
}
MRDOCS_DESCRIBE_ENUM(ConstexprKind, None, Constexpr, Consteval)

} // mrdocs

Expand Down
24 changes: 12 additions & 12 deletions include/mrdocs/Metadata/Specifiers/OperatorKind.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,6 @@ enum class OperatorKind
Coawait,
};

/** Map an operator kind to a DOM value (its underlying integer).
*/
inline
void
tag_invoke(
dom::ValueFromTag,
dom::Value& v,
OperatorKind kind)
{
v = static_cast<std::underlying_type_t<OperatorKind>>(kind);
}

/** Determines whether the operator is potentially unary.
*/
MRDOCS_DECL
Expand All @@ -156,6 +144,18 @@ getOperatorName(
OperatorKind kind,
bool include_keyword = false) noexcept;

/** Map an operator kind to a DOM value.
*/
inline
void
tag_invoke(
dom::ValueFromTag,
dom::Value& v,
OperatorKind kind)
{
v = getOperatorName(kind);
}

/** Return the short name of an operator as a string.
*/
MRDOCS_DECL
Expand Down
20 changes: 2 additions & 18 deletions include/mrdocs/Metadata/Specifiers/StorageClassKind.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <mrdocs/Platform.hpp>
#include <mrdocs/Dom.hpp>
#include <string>
#include <mrdocs/Support/Describe.hpp>

namespace mrdocs {

Expand All @@ -40,23 +40,7 @@ enum class StorageClassKind
Register
};

/** Convert a storage class kind to its string form.
*/
MRDOCS_DECL
dom::String
toString(StorageClassKind kind) noexcept;

/** Return the StorageClassKind as a @ref dom::Value string.
*/
inline
void
tag_invoke(
dom::ValueFromTag,
dom::Value& v,
StorageClassKind const kind)
{
v = toString(kind);
}
MRDOCS_DESCRIBE_ENUM(StorageClassKind, None, Extern, Static, Auto, Register)

} // mrdocs

Expand Down
2 changes: 1 addition & 1 deletion include/mrdocs/Metadata/Type/TypeKind.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ MRDOCS_DECL
dom::String
toString(TypeKind kind) noexcept;

inline
/** Map a TypeKind into a DOM value.
*/
inline
void
tag_invoke(
dom::ValueFromTag,
Expand Down
Loading
Loading