-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Description
template parseNodeQ(string VarName, string NodeName)
{
enum parseNodeQ = `{ if ((` ~ VarName ~ ` = parse` ~ NodeName ~ `()) is null) return null; }`;
}
// many lines...
mixin(parseNodeQ!(`node.type`, `Type`));This hides the important code of node.type = parseType. Clearer mixin usage would be something like:
mixin(checkNull!`node.type = parseType()`);And it's only 2 characters longer. Now the important code is at least visible and will show up when grepping for parseType. (Or for more clarity the mixin could be named returnIfNull).
I'm happy to make a PR if this is acceptable.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels