haml/haml — pull request #734 by teeparham (2014-01-18 00:23:15+00:00)
Title: Refactor #format_script

This PR is not ready to be merged yet, but I wanted to open it for review while I continue working on it.

Basically, the `format_script` method is nearly impossible to understand or change. More accurately, `def_static_method` generates 2^7 (128) `format_script` methods of the styles `format_script_true_false_true_false_true_false_true`. `static_method` is then used to build the method name from the options.

The proposed change converts `format_script` into a normal method, removes the entire `StaticConditionalContext` class, which is not used by anything else. I cannot imagine anyone is using it.

The original commit was intended to speed things up, but the tests run faster without it. Furthermore, we should be able to debug and clean up other things in this method now that it's readable.

The original commit where this style was introduced was over 5 years ago: https://github.com/haml/haml/commit/addaa09a99bd0798