• Guido van Rossum's avatar
    Implemented more sensible behavior of define-slot and fill-slot: · 9f313808
    Guido van Rossum authored
    - Define-slot can now be nested inside fill-slot, so that a macro can
      call another macro and use one of its slots to fill that other
      macro's slots.  (This is essential for sensible semantics of nested
      macros.)
    
    - Inside a use-macro, if the macro defines a slot that's not filled,
      the define-slot turns into fill-slot.  (This is just a convenience
      feature.)
    
    To implement this, the current macro call and its slots are turned
    into a stack (they already had stack behavior but the stack was
    inaccessible) and added a variable indicating the macro currently
    being defined (if any).
    
    In the process, refactored startTagCommon a bit, turning the decision
    procedure for argument replacement into a separate method
    (attrAction()).
    
    Added a safeguard to the attribute-wrapping feature: if the alignment
    column is too far to the right (half of the wrap column), change
    alignment to 4 spaces.  This solves the problem reported by Gregor
    Hoffleit with attribute wrapping in a long line containing several
    elements.
    9f313808
TALInterpreter.py 17.4 KB