From 0e85f165a95a4260093311be882d5aefbd8f402d Mon Sep 17 00:00:00 2001 From: WebFreak001 Date: Thu, 27 Apr 2023 03:00:57 +0200 Subject: [PATCH] fix section header being included in some traits --- common/src/dcd/common/constants2.d | 15 +++------------ constants-gen/generator.d | 5 +++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/common/src/dcd/common/constants2.d b/common/src/dcd/common/constants2.d index 044170a..8f958ad 100644 --- a/common/src/dcd/common/constants2.d +++ b/common/src/dcd/common/constants2.d @@ -329,10 +329,7 @@ $(CONSOLE tuple("pure", "nothrow", "@nogc", "@trusted") ) ) -) - - -$(H2 $(LNAME2 function-parameters, Function Parameter Traits))`), +)`), ConstantCompletion("getFunctionVariadicStyle", `$(P Takes one argument which must either be a function symbol, or a type that is a function, delegate or a function pointer. @@ -891,10 +888,7 @@ void main() C c = cast(C) ptr; assert(c.i == 4); } ---- - - -$(H2 $(LNAME2 functions, Function Traits))`), +---`), ConstantCompletion("isAbstractClass", `$(P If the arguments are all either types that are abstract classes, or expressions that are typed as abstract classes, then $(D true) is returned. @@ -1670,10 +1664,7 @@ void foreachExample(C c, int x) static assert(is(typeof(__traits(parameters)) == AliasSeq!(C, int))); } } ---- - - -$(H2 $(LNAME2 symbols, Symbol Traits))`), +---`), ConstantCompletion("parent", `$(P Takes a single argument which must evaluate to a symbol. The result is the symbol that is the parent of it. )`), diff --git a/constants-gen/generator.d b/constants-gen/generator.d index 6675063..28e46c2 100755 --- a/constants-gen/generator.d +++ b/constants-gen/generator.d @@ -135,6 +135,11 @@ ConstantCompletion[] parseTraits(string ddoc) foundTerminator = true; break; } + else if (line.startsWith("$(H2 $(LNAME2")) + { + addCurrent(); + seekingToFirst = true; + } else if (line.canFind("$(GNAME ")) { addCurrent();