Menu

#6 NOT count curly brackets in cloc

v1.61
pending
nobody
None
1
2014-03-25
2014-03-25
Anonymous
No

If I do not want to count open and closing curly brackets such as "{" and "}" in C and C++ source file, can I tell cloc to do that by modifying the lang filter definition? Does cloc (v1.60) support this feature? Thank you.

Discussion

  • Anonymous

    Anonymous - 2014-03-25

    I mean I do not want to count the line that contains only open and closing curly brackets such as "{" and "}" in C and C++ source file

     
  • Al Danial

    Al Danial - 2014-03-25

    Yes, that's possible. Include this line in your custom language definition file for C:

    filter remove_matches ^\s*[{}]\s*$
    
     
    • Anonymous

      Anonymous - 2014-03-26
      • Could you please explain for this filter: filter remove_matches ? What does it mean for ^\s, [{}], \s$?
      • Can I add several filter remove_matches for a specific language such as:
        filter remove_matches ^\s//
        filter remove_matches ^\s
        {\s//
        filter remove_matches ^\s
        [{}]\s*$
      • What does it mean for filter remove_inline //.*$?
       
  • Al Danial

    Al Danial - 2014-03-25
    • status: open --> pending
     

Anonymous
Anonymous

Add attachments
Cancel