'Searches for Mako expressions and then checks if they contain
violations, including checking JavaScript contexts for JavaScript
violations.
Arguments:
mako_template: The contents of the Mako template.
has_page_default: True if the page is marked as default, False
otherwise.
results: A list of results into which violations will be added.'

def _check_mako_expressions(self, mako_template, has_page_default, results):

    expressions = self._find_mako_expressions(mako_template)
    contexts = self._get_contexts(mako_template)
    self._check_javascript_contexts(mako_template, contexts, results)
    for expression in expressions:
        if (expression.end_index is None):
            results.violations.append(ExpressionRuleViolation(Rules.mako_unparseable_expression, expression))
            continue
        context = self._get_context(contexts, expression.start_index)
        self._check_expression_and_filters(mako_template, expression, context, has_page_default, results)
