Changeset 14393


Ignore:
Timestamp:
2022-04-11T01:21:22Z (4 months ago)
Author:
marios
Message:

Update todo_search.pl

Cloudy does not follow a single format to TODO's, which causes the
script to work incorrectly.

The script has been updated to handle such variations:

  • It handles \todo entries, in addition to TODO.
  • It processes entries in C++ comments (starting with ).
  • It does not require a priority number to immediately follow the TODO / \todo string.
    • If a dash occurs in lieu of a priority number, it removes it from the comment.
  • It accepts any kind of whitespace character after the TODO string, not just tabs.
  • It accepts comments in Doxygen docstrings (starting with /) and properly extracts comments from them.
  • It does not print the '#'-only separator in the HTML file.

The few files that do not conform to these rules were edited and
committed previously.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/c17_branch/source/todo_search.pl

    r6023 r14393  
    4949   
    5050    # If line has TODO
    51     if($line =~/TODO/ && $flag == 0){
     51    if($line =~/TODO/i && $flag == 0){
    5252      # Retrieving the priority
    5353      $line_no = $countline;
    5454      $priority = $line;
    55       $priority =~s/(.*TODO\t)(\d*)(\t.*)/$2/;
     55      $priority =~s/(.*TODO\s*)(\d*)(\s.*)/$2/i;
    5656      $priority =~s/\n$//;
     57
    5758      $comment = $line;
    58       $comment =~s/(.*TODO\t$priority\t)(.*)/$2/;
     59      if( $priority ne '' )
     60      {
     61        $comment =~s/(.*TODO\s+$priority)(.*)/$2/i;
     62      }
     63      else
     64      {
     65        $comment =~s/(.*TODO\s+)(.*)/$2/i;
     66      }
     67      $comment =~s/^\s*-\s+//;
    5968      $comment =~s/\*\///;
     69      $comment =~s/\/\*\*//;
    6070      $comment =~s/\t*//gi;
    6171      $prev = join '',$prev,$comment; 
    6272     
    6373      # Checks if TODO comments extend more than one line
    64       if($line !~/\*\//){
     74      if($line !~/\*\// and $line !~ m/\/\// ){
    6575        $flag = 1;
    66       }         
     76      }
    6777      else{ # Print into output temporary file
    6878        print TEMPFILE "$priority\t$sourcefile\t$line_no\t$prev";
     
    116126open(FINAL, "< $finalout");
    117127while(<FINAL>){
     128        next if $_ =~ m/^#+$/;
    118129        $_=~s/\t/\<\/TD\>\<TD\>/g;  #formatting the data into rows and columns
    119130        print FHTM "<TR><TD>$_</TD></TR>"
Note: See TracChangeset for help on using the changeset viewer.