tokei icon indicating copy to clipboard operation
tokei copied to clipboard

Add Haml support with indented comments and embeddings

Open qnighy opened this issue 3 years ago • 1 comments

This is an alternative proposal to https://github.com/XAMPPRocky/tokei/pull/869.

This PR adds support for Haml with indented comments and embeddings like:

  -# Embeddings
  :javascript
    // This is JavaScript code:
    console.log("Hello!");

  -# Comments
  /
    %p
      This is emitted in an HTML comment.

Compared to https://github.com/XAMPPRocky/tokei/pull/869 this is more feature-complete but it makes the Rust implementation more complex. That is why I filed it as a separate proposal.

Known problems:

  • Trailing empty lines in embeddings are entirely dropped from counting.
  • Trailing empty lines in indented comments are counted as comments, not blanks.

qnighy avatar Dec 29 '21 07:12 qnighy

Thank you for your PR! Sorry for the delay I'd like to consider allowing indented comments, however, I'd like to know that it would be useful for more than a single language. Do you know of other languages that use indented comments that could use this?

XAMPPRocky avatar Feb 01 '22 15:02 XAMPPRocky

I'm going to go with the simpler solution for now, but if you know of multiple languages that use indented comments, and fix the known problems you listed in the PR, I'd be happy to revisit this.

XAMPPRocky avatar Aug 14 '22 16:08 XAMPPRocky