It's hard to grep for (since with is used in comments quite often),Try to search for "with(" or "with\s(", that are less common in normal text.
There is no tool (maybe the compiler could provide such a tool) to remove all comments?
That way, you could do: cat file.d | tool | grep whatever