Skip to content

Commit 5c3eeba

Browse files
committed
Fixes unittests failure introduced by dlang-community#272
Essentially we never need to keep the discard nodes
1 parent 8ccbcf2 commit 5c3eeba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pegged/peg.d

+3-3
Original file line numberDiff line numberDiff line change
@@ -1294,10 +1294,10 @@ template and(rules...) if (rules.length > 0)
12941294
return node.name.startsWith("keep!(")
12951295
|| ( !node.name.startsWith("discard!(")
12961296
//&& !node.name.startsWith("drop!(")
1297-
&& node.matches !is null
1297+
&& (node.matches !is null
1298+
|| node.failEnd >= node.end)
12981299
//&& node.begin != node.end
1299-
)
1300-
|| (node.failEnd >= node.end);
1300+
);
13011301
}
13021302
13031303
version (tracer)

0 commit comments

Comments
 (0)