Ignore:
Timestamp:
2008-08-17T16:19:25+02:00 (6 years ago)
Author:
moo
Message:

add id/name in comments for readability

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mkopcode_spec.awk

    r565 r566  
    1010/OPDEF/ { 
    1111    if (started) { 
    12         sub(/".*"/, "") 
     12        name = ""; 
     13        if (match($0, /"([^"]+)"/, m)) {  
     14            name = m[1];  
     15        }  
     16        sub(/"[^"]*"/, ""); 
    1317        if (!match($0, /EXT_([^ |]+).*OP[1S]_([^ |]+).*OP2_([^ |]+).*RES_([^ |)]+).*/, array)) { 
    1418            print "error" $0 
    1519            exit 
    1620        } 
    17         comment = ""; 
    18         if (match($0, /\/\* (\d+) \*\//, comments)) { 
    19             comment = comments[1]; 
     21        id = ""; 
     22        if (match($0, /\/\* *([0-9]+) *\*\//, comments)) { 
     23            id = comments[1]; 
    2024        } 
    21         printf "\tOPSPEC(%10s, %10s, %10s, %10s)%s\n", array[1], array[2], array[3], array[4], comment; 
     25        printf "\tOPSPEC(%10s, %10s, %10s, %10s) /* %s %-30s */\n", array[1], array[2], array[3], array[4], id, name; 
    2226        next 
    2327    } 
Note: See TracChangeset for help on using the changeset viewer.