mve.awk 484 B

123456789101112131415161718192021222324
  1. #!/usr/bin/nawk -f
  2. #
  3. # Change "nawk" to "awk" or "gawk" if you get errors.
  4. #
  5. # Make Vim Errors
  6. # Processes errors from cc for use by Vim's quick fix tools
  7. # specifically it translates the ---------^ notation to a
  8. # column number
  9. #
  10. BEGIN { FS="[:,]" }
  11. /^cfe/ { file=$3
  12. msg=$5
  13. split($4,s," ")
  14. line=s[2]
  15. }
  16. # You may have to substitute a tab character for the \t here:
  17. /^[\t-]*\^/ {
  18. p=match($0, ".*\\^" )
  19. col=RLENGTH-2
  20. printf("%s, line %d, col %d : %s\n", file,line,col,msg)
  21. }