• scottmg's avatar
    gn format: fix comments at end of blocks · f7e13e52
    scottmg authored
    Fixes comments at the end of a block like:
    
      stuff() {
        sources = []
        # wee
      }
    
    This is done by storing an EndNode (instead of just a Token) as the
    end of Block and List nodes. This means there's a node in the tree
    traversal for the trailing ], and gives a place to attach the comment.
    
    Also collapses some of the expression output code to reuse Sequence.
    
    R=brettw@chromium.org
    BUG=348474
    
    Review URL: https://codereview.chromium.org/607173002
    
    Cr-Commit-Position: refs/heads/master@{#297226}
    f7e13e52
parse_tree.h 16 KB