wincent / docvim

Documentation generator for Vim plug-ins
MIT License
25 stars 0 forks source link

Prune "empty" paths in AST #9

Closed wincent closed 8 years ago

wincent commented 8 years ago

Due to extraction, we can wind up with an AST fragment that looks like this:

Project
  [ Project [ Unit [ DocBlock [] ] , DocBlock [] ]
  , CommandsAnnotation
  , CommandAnnotation "Ack" (Just "{pattern} {options}")
  , Paragraph [ Plaintext "Info." ]
  , CommandAnnotation "Qargs" Nothing
...

Would be nice to get rid of the empty DocBlocks, and in turn the empty Unit, and the empty Project, so the above would reduce to:

Project
  , CommandsAnnotation
  , CommandAnnotation "Ack" (Just "{pattern} {options}")
  , Paragraph [ Plaintext "Info." ]
  , CommandAnnotation "Qargs" Nothing
...