Page MenuHomePhabricator

CachingParser::checkSyntax should only try to build the AST without evaluating it
Closed, ResolvedPublic


I've been having this idea for a while, and already implemented some code to help with that. Not evaluating the AST means avoiding to deal with unavailable variables etc., although there shouldn't be a sensible difference runtime-wise.
The acceptance criterion here is that we should be able to report more errors at syntax-check time. Some kinds of errors will be hard to report there, e.g. if a variable is of the right type, so we may end up declining this task. Or alternatively, have a dedicated wiki page for runtime errors (T193064 / r429381). However, I still believe it's worth investigating. To make things easier, this should be done after enabling CachingParser in production, and inverting the inheritance between the old and the new parser (or even deleting the old one).

Event Timeline

Change 551966 had a related patch set uploaded (by Nullzero; owner: Nullzero):
[mediawiki/extensions/AbuseFilter@master] [DO NOT MERGE] Add a static analyzer for the filter language

Change 551966 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] Add a static analyzer for the filter language

Calling this resolved, the new static checker is enough for our purposes.