Changeset 660


Ignore:
Timestamp:
Sep 7, 2003, 10:59:28 PM (22 years ago)
Author:
bird
Message:

doxygen like @file headers not the other stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/testcase/statshdr.cmd

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r659 r660  
    7373
    7474/*
    75  * Do testing.
     75 * Do parsing.
    7676 */
    7777sOut = 'STDOUT';
     
    8181call lineout sOut, left('File', 24)||X2C('09')||left('Level', 16);
    8282call lineout sOut, left('-', 24, '-')||X2C('09')||left('-', 16,'-');
     83asTodos.0 = 0;
    8384do i = 1 to asFiles.0
    8485    call statfile sOut, sInclude, asFiles.i;
    8586end
    8687call lineout sOut;
     88
     89/*
     90 * Print todos.
     91 */
     92say '';
     93say 'TODOs:'
     94do i = 1 to asTodos.0
     95    call lineout sOut, '-'||asTodos.i;
     96end
    8797
    8898exit(asFailed.0);
     
    96106 * @param   sFile   The include file to test, full path.
    97107 */
    98 statfile: procedure expose asExcludes.
     108statfile: procedure expose asExcludes. asTodos.
    99109parse arg sOut, sDir, sFile
    100110    sName = substr(sFile, length(sDir) + 2);
    101111    sLevel = '--';
    102     sRemark = '';
    103     sChanged = '';
     112    asRemarks.0 = 0;
     113    asChanges.0 = 0;
    104114    if (isExcluded(sName)) then
    105115    do
     
    108118    end
    109119
    110     iLine = 1;
    111     do while (lines(sFile) & iLine < 200)
     120    iLine = 0;
     121    fComment = 0;
     122    do while (lines(sFile) > 0)
    112123        sLine = strip(linein(sFile));
    113         if (left(sLine, 1) = '*' & pos('@@', sLine) > 0) then
     124        iLine = iLine + 1;
     125
     126        if (pos('/'||'*', sLine) > 0) then
     127            fComment = 1;
     128
     129        if (left(sLine, 3) = '/'||'*'||'*' & pos('@file', sLine) > 0) then
    114130        do
    115             iPos = pos('@@', sLine);
    116             sWord = word(substr(sLine, iPos + 2), 1);
    117             if (sWord == 'level') then
    118                 sLevel = strip(substr(sLine, iPos + 2 + 5));
    119             else if (sWord == 'remark') then
    120                 sRemark = strip(substr(sLine, iPos + 2 + 6));
    121             else if (sWord == 'changed') then
    122                 sChanged = strip(substr(sLine, iPos + 2 + 7));
     131            sLine = strip(linein(sFile));
     132            sLevel = strip(strip(sLine, 'L', '*'));
    123133        end
    124         iLine = iLine + 1;
    125     end
    126 
     134        else
     135        do
     136            do while (fComment &,
     137                        (   (left(space(sLine), 3) = '* @'),
     138                         |  (left(space(sLine), 5) = '/'||'*'||'*'||' @')) )
     139                iPos = pos(' @', sLine);
     140                sWord = word(substr(sLine, iPos + 2), 1);
     141                sText = strip(substr(sLine, pos('@'sWord, sLine) + length(sWord) + 1));
     142
     143                /* read following lines */
     144                do forever
     145                    if (pos('*'||'/', sLine) > 0) then
     146                    do
     147                        fComment = 0;
     148                        leave
     149                    end
     150                    sLine = strip(linein(sFile));
     151                    iLine = iLine + 1;
     152                    if (strip(sLine) = '*'||'/') then
     153                    do
     154                        fComment = 0;
     155                        leave
     156                    end
     157                    if (left(sLine, 1) = '*' & pos(' @', sLine) > 0) then
     158                        leave;
     159
     160                    sText = sText || ' ' || strip(strip(sLine, 'L', '*'));
     161                end
     162                if (right(sText, 2) = '*/') then
     163                    sText = strip(substr(sText, 1, length(sText) - 2));
     164
     165                if (sWord = 'remark') then
     166                do
     167                    i = asRemarks.0 + 1;
     168                    asRemarks.i = sText
     169                    asRemarks.0 = i;
     170                end
     171                else if (sWord = 'changed') then
     172                do
     173                    i = asChanges.0 + 1;
     174                    asChanges.i = sText
     175                    asChanges.0 = i;
     176                end
     177                else if (sWord = 'todo') then
     178                do
     179                    i = asTodos.0 + 1;
     180                    asTodos.i = sText;
     181                    asTodos.0 = i;
     182                end
     183            end
     184        end
     185    end
     186
     187    /*
     188     * Produce output.
     189     */
    127190    call lineout sOut, left(sName, 24)||X2C('09')||left(sLevel, 16);
    128     if (sRemark <> '') then
    129         call lineout sOut, X2C('09')'remark:  '||sRemark;
    130     if (sChanged <> '') then
    131         call lineout sOut, X2C('09')'changes by '||sChanged
     191    do i = 1 to asRemarks.0
     192        call lineout sOut, X2C('09')'remark: '||asRemarks.i;
     193    end
     194
     195    do i = 1 to asChanges.0
     196        if (pos(':', word(asChanges.i, 1)) > 0) then
     197            call lineout sOut, X2C('09')'changes by '||asChanges.i
     198        else
     199            call lineout sOut, X2C('09')'changes: '||asChanges.i
     200    end
    132201return 0;
    133202
Note: See TracChangeset for help on using the changeset viewer.