Project

General

Profile

« Previous | Next » 

Revision 4756

xml_func.py: simplify(): Run xml_dom.prune_empty() on function nodes that don't have an explicit simplifying function. This allows single-arg functions with no arg to be pruned rather than called with no args (causing errors if the single param does not have a default value).

View differences:

lib/xml_func.py
109 109
    # Pass-through optimizations
110 110
    if is_func_name(name):
111 111
        try: func = simplifying_funcs[name]
112
        except KeyError: pass
112
        except KeyError: xml_dom.prune_empty(node)
113 113
        else: func(node)
114 114
    # Pruning optimizations
115 115
    else: # these should not run on functions because they would remove args

Also available in: Unified diff