dparse.trivia

Module to work with trivia tokens (comment, whitespace, specialTokenSequence) which are attached to tokens near them when source code gets tokenized.

Types 2

enumCommentType : ubyte
none
docLine
docBlock
normalLine
normalBlock
private structMultiLineCommentHelper(CharType : const(char))

Gives a line per line view on DDOC comments of type `/++` and `/**` which makes easier to remove the decoration and in an almost 100% nogc way.

Fields
char[][] lines
size_t lastLineInBlockPlusOne
const(char) commentChar
ubyte firstLineInBlock
Methods
auto opAssign(T)(T t) @disable
void stripIndent() @safe @nogc pure nothrow
void processFirstLine() @safe @nogc pure nothrow
void processLastLine() @safe @nogc pure nothrow
void unDecorate() @safe @nogc pure nothrow
void stripLeft() @safe @nogc pure nothrow
void stripRight() @safe @nogc pure nothrow
void run() @safe @nogc pure nothrow
void process(T)(ref T outbuffer)
Constructors
this(CharType[] text)

Functions 6

fnCommentType determineCommentType(string comment) pure nothrow @safe
fnbool isDocComment(CommentType type) @safe nothrow pure
fnvoid unDecorateComment(T)(string comment, auto ref T outputRange) if (isOutputRange!(T, string))Removes "decoration" such as leading whitespace, leading + and * characters, and places the result into the given output range
fnstring extractDdocFromTrivia(Tokens)(Tokens tokens) if (isInputRange!Tokens && (is(ElementType!Tokens : Token) || is(ElementType!Tokens : TriviaToken))) pure nothrow @safeExtracts and combines ddoc comments from trivia comments.
fnstring extractLeadingDdoc(const Token token) pure nothrow @safe
fnstring extractTrailingDdoc(const Token token) pure nothrow @safe