Skip to content

Commit

Permalink
refactor List and bitcode for Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
vinniefalco committed Apr 19, 2023
1 parent 4d51a10 commit 99dca89
Show file tree
Hide file tree
Showing 124 changed files with 1,981 additions and 581 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.vs/
.vscode/
CMakeSettings.json
bin64/
build/
temp/
test/
Expand Down
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#-------------------------------------------------

cmake_minimum_required(VERSION 3.13)
cmake_policy(SET CMP0111 OLD)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
project(
MrDox
Expand All @@ -24,13 +25,14 @@ project(
LANGUAGES CXX C
)

set(BUILD_SHARED_LIBS OFF CACHE STRING "")
set(CMAKE_CXX_EXTENSIONS OFF CACHE STRING "")
#set(BUILD_SHARED_LIBS OFF CACHE STRING "")
#set(CMAKE_CXX_EXTENSIONS OFF CACHE STRING "")
# VFALCO this is to link optimized llvm for debug builds
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL" CACHE STRING "")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON CACHE STRING "")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL ON CACHE STRING "")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON CACHE STRING "")
#set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL" CACHE STRING "")
#set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON CACHE STRING "")
#set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL ON CACHE STRING "")
#set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON CACHE STRING "")

option(MRDOX_BUILD_TESTS "Build tests" ON)

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
Expand Down
61 changes: 38 additions & 23 deletions include/mrdox/meta/Javadoc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ struct Javadoc
{
Kind kind;

auto operator<=>(Node const&) const noexcept = default;
auto operator<=>(Node const&
) const noexcept = default;

explicit Node(Kind kind_) noexcept
: kind(kind_)
Expand All @@ -85,7 +86,10 @@ struct Javadoc
{
String string;

auto operator<=>(Text const&) const noexcept = default;
static constexpr Kind static_kind = Kind::text;

auto operator<=>(Text const&
) const noexcept = default;

explicit
Text(
Expand All @@ -111,7 +115,8 @@ struct Javadoc
{
Style style;

auto operator<=>(StyledText const&) const noexcept = default;
auto operator<=>(StyledText const&
) const noexcept = default;

StyledText(
String string_ = String(),
Expand All @@ -128,7 +133,10 @@ struct Javadoc
*/
struct Block : Node
{
auto operator<=>(Block const&) const noexcept = default;
static constexpr Kind static_kind = Kind::block;

auto operator<=>(Block const&
) const noexcept = default;

protected:
explicit
Expand All @@ -149,7 +157,8 @@ struct Javadoc
return children.empty();
}

auto operator<=>(Paragraph const&) const noexcept = default;
auto operator<=>(Paragraph const&
) const noexcept = default;

Paragraph() noexcept
: Block(Kind::paragraph)
Expand All @@ -170,7 +179,8 @@ struct Javadoc
*/
struct Brief : Paragraph
{
auto operator<=>(Brief const&) const noexcept = default;
auto operator<=>(Brief const&
) const noexcept = default;

Brief() noexcept
: Paragraph(Kind::brief)
Expand All @@ -184,7 +194,8 @@ struct Javadoc
{
Admonish style;

auto operator<=>(Admonition const&) const noexcept = default;
auto operator<=>(Admonition const&
) const noexcept = default;

explicit
Admonition(
Expand All @@ -202,7 +213,8 @@ struct Javadoc
// VFALCO we can add a language (e.g. C++),
// then emit attributes in the generator.

auto operator<=>(Code const&) const noexcept = default;
auto operator<=>(Code const&
) const noexcept = default;

Code()
: Paragraph(Kind::code)
Expand All @@ -216,7 +228,8 @@ struct Javadoc
{
String name;

auto operator<=>(Param const&) const noexcept = default;
auto operator<=>(Param const&
) const noexcept = default;

Param(
String name_ = String(),
Expand All @@ -235,7 +248,8 @@ struct Javadoc
{
String name;

auto operator<=>(TParam const&) const noexcept = default;
auto operator<=>(TParam const&
) const noexcept = default;

TParam(
String name_ = String(),
Expand All @@ -252,7 +266,8 @@ struct Javadoc
*/
struct Returns : Paragraph
{
auto operator<=>(Returns const&) const noexcept = default;
auto operator<=>(Returns const&
) const noexcept = default;

Returns()
: Paragraph(Kind::returns)
Expand All @@ -272,17 +287,6 @@ struct Javadoc
List<TParam> tparams,
Returns returns);

/** Comparison
These are used internally to impose a
total ordering, and not visible in the
output format.
*/
/** @{ */
bool operator<(Javadoc const&) const noexcept;
bool operator==(Javadoc const&) const noexcept;
/* @} */

/** Return true if this is empty
*/
bool
Expand Down Expand Up @@ -333,13 +337,24 @@ struct Javadoc

//--------------------------------------------

/** Comparison
These are used internally to impose a
total ordering, and not visible in the
output format.
*/
/** @{ */
bool operator==(Javadoc const&) const noexcept;
bool operator!=(Javadoc const&) const noexcept;
/* @} */

/** Merge other into this.
This is used to combine separate doc
comments which are semantically attached
to the same symbol.
*/
void merge(Javadoc& other);
void merge(Javadoc&& other);

/** Calculate the brief.
Expand Down
Loading

0 comments on commit 99dca89

Please sign in to comment.