You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (js_parse_var(s, PF_IN_ACCEPTED, tok, /*export_flag*/true))
goto fail;
It works okay because PF_IN_ACCEPTED == 1 and true == 1 but it's confusing.
In the particular case of js_parse_var, that export_flag boolean could maybe be a PF_ flag instead. On the other hand, you could argue module exports aren't a parser concern and I wouldn't disagree.
The text was updated successfully, but these errors were encountered:
I'll take a look after I get my head out of this printf hole I've dug for myself 😅
Re: the export flag. There are more parsing functions that do that and I'm afraid a significant refactor would be necessary to detach the parser from handling the exports.
General pattern, specific example:
Definition:
Ergo, the call site should look like this:
It works okay because
PF_IN_ACCEPTED == 1
andtrue == 1
but it's confusing.In the particular case of js_parse_var, that
export_flag
boolean could maybe be a PF_ flag instead. On the other hand, you could argue module exports aren't a parser concern and I wouldn't disagree.The text was updated successfully, but these errors were encountered: