Skip to content

Commit

Permalink
make docs /// now
Browse files Browse the repository at this point in the history
  • Loading branch information
altalk23 committed Dec 23, 2023
1 parent 657d19d commit dd69611
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/attribute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ namespace broma {
one<')'>
> {};

struct docs_attribute : seq<ascii::string<'/', '*'>, tagged_rule<docs_attribute, string_literal>, until<seq<ascii::string<'*', '/'>>>> /*basic_attribute<TAO_PEGTL_KEYWORD("docs"), tagged_rule<docs_attribute, string_literal>>*/ {};
struct docs_literal : until<eolf> {};
struct docs_attribute : seq<ascii::string<'/', '/', '/'>, tagged_rule<docs_attribute, docs_literal> > {};

// seq<ascii::string<'/', '*'>, tagged_rule<docs_attribute, string_literal>, until<seq<ascii::string<'*', '/'>>>> /*basic_attribute<TAO_PEGTL_KEYWORD("docs"), tagged_rule<docs_attribute, string_literal>>*/ {};
struct depends_attribute : basic_attribute<TAO_PEGTL_KEYWORD("depends"), tagged_rule<depends_attribute, qualified>> {};

template <typename Attribute>
Expand Down Expand Up @@ -84,12 +87,12 @@ namespace broma {
struct run_action<tagged_rule<docs_attribute, string_literal>> {
template <typename T>
static void apply(T& input, Root* root, ScratchData* scratch) {
auto docs = input.string().substr(1, input.string().size() - 1);
auto docs = input.string(); //.substr(0, input.string().size() - 1);
if (scratch->is_class) {
scratch->wip_mem_fn_proto.docs = docs;
scratch->wip_mem_fn_proto.docs += docs;
}
else {
scratch->wip_fn_proto.docs = docs;
scratch->wip_fn_proto.docs += docs;
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/basic_components.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace broma {
/// @brief C and C++-style comments.
struct comment :
disable<sor<
seq<ascii::string<'/', '/'>, until<eolf>>
seq<ascii::string<'/', '/'>, not_at<one<'/'>>, until<eolf>>
>> {};

/// @brief Noisy filler grammar elements we want to ignore when parsing.
Expand Down

0 comments on commit dd69611

Please sign in to comment.