-
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Describe the bug
Comments starting with /+ and ending with ++/ (opposite to +/ ) are not matched by grammar rule comment: (_) =>.
Additional context
Found this when looking at the definition struct ByLineBuffer(Char) in D module std.net.curl being
/+
struct ByLineBuffer(Char)
{
bool linePresent;
bool EOF;
Char[] buffer;
ubyte[] decodeRemainder;
bool append(const(ubyte)[] data)
{
byLineBuffer ~= data;
}
@property bool linePresent()
{
return byLinePresent;
}
Char[] get()
{
if (!linePresent)
{
// Decode ubyte[] into Char[] until a Terminator is found.
// If not Terminator is found and EOF is false then raise an
// exception.
}
return byLineBuffer;
}
}
++/. I could try to fix this myself but the current
comment: (_) =>
token(
choice(
seq("//", /(\\+(.|\r?\n)|[^\\\n])*/),
seq("/*", /[^*]*\*+([^/*][^*]*\*+)*/, "/"),
// nesting comments, we "only" support 5 levels of nesting
seq(
"/+",
repeat(
choice(
/[^+]/,
/\+[^\/]/,
seq(
"/+",
repeat(
choice(
/[^+]/,
/\+[^\/]/,
seq(
"/+",
repeat(
choice(
/[^+]/,
/\+[^\/]/,
seq(
"/+",
repeat(
choice(
/[^+]/,
/\+[^\/]/,
seq(
"/+",
repeat(choice(/[^+]/, /\+[^\/]/)),
"+/",
),
),
),
"+/",
),
),
),
"+/",
),
),
),
"+/",
),
),
),
"+/",
),
),
),
is not easy to parse.
Metadata
Metadata
Assignees
Labels
No labels