Guest User

Untitled

a guest
Mar 25th, 2012
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Awk 0.53 KB | None | 0 0
  1. #!/usr/bin/awk -f
  2.  
  3. BEGIN {
  4.      FS = " ";
  5.      module = "";
  6. }
  7.  
  8. /^\** Module .*$/ {
  9.      module = $3;
  10.      FS = ": *";
  11.  
  12.      gsub (/\./, "/", module);
  13.      module = module ".py";
  14. }
  15.  
  16. /^[CWEF]: *[0-9]+,[0-9]+/ {
  17.      split ($2, tokens, ",");
  18.      line_num = tokens[1];
  19.  
  20.      print $0
  21.      system ("source-highlight --line-range=" (line_num - 1) \
  22.              "-" (line_num + 1) " --failsafe -f esc " \
  23.              "--style-file=esc.style -s python -n -i " module);
  24.      print "";
  25.      next;
  26. }
  27.  
  28. {
  29.      print;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment